-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apis #235
Apis #235
Conversation
Apis feb 13
self.recovered[recovered_sev] = True | ||
|
||
# Trigger deaths | ||
deaths = ss.true(self.ti_dead <= sim.year) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a check - shouldn't remove agents as they can still transmit
"cell_type": "markdown", | ||
"source": [ | ||
"\n", | ||
"This will scale all your results to represent a population of 50 million people, and will apply annual birth and death rates as specified in the `pars` dict. Alternatively, we can make demographic components:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where the 50 million came from?
"Both achieve the same thing. \n", | ||
"\n", | ||
"## Scaling results to whole populations\n", | ||
"Even though we've been simulating populations of a few thousand agents, we can also use the `total_pop` parameter to scale our results so that they reflect a much larger population. You can think of this as a kind of statistical sampling approximation. If we want to model the population of Nigeria, for example, it would be much too computationally intensive to simulate 200 million agents. However, we could simulate 50,000 agents and then say that each agent represents 4,000 people. Again, we can do this by passing `total_pop=200e6` to the sim or in the `pars` dictionary.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should probably a note somewhere (perhaps not right here though) that this is like having 4000 towns/cities so results need to be interpreted accordingly - this is probably most relevant to outbreaks where 1 outbreak with 10 infections could behave quite differently to 10 outbreaks with 1 infection
"\n", | ||
"# Read in age-specific fertility rates\n", | ||
"fertility_rates = pd.read_csv(ss.root / 'tests/test_data/nigeria_asfr.csv')\n", | ||
"pregnancy = ss.Pregnancy(pars={'fertility_rate': fertility_rates})\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also maybe not specific to this PR but how does a user find out what format dataframes (like fertility_rates
need to be in? Or rather, what they can/can't put in their CSVs. It's difficult to tell by looking through the code. I guess it's in Pregnancy.metadata
? Maybe we should have a data container class that centralises these operations e.g., have the module contain a data object that has a specification of the columns/types etc. and also handles standardization/parsing - then the module's constructor could pass whatever representation of the data the user provided to a load
method or similar on that class, and subsequently access the sanitised data via that class too (e.g.,Pregnancy.fertility_rates.df
)
APIs tutorial fixes
Having reviewed further, still happy to merge this in and carry on from there, but I think we need to finish the discussion about the |
Lots of changes, including:
People
toSim
FusedArray
toUIDArray
)MultiSim
(not yet functional due to ScipyDistribution can't be pickled #257)pars
entries can now be specified as scalars, which will be converted to distributions according to keys inpar_dists