-
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
Version 1.0 #581
Version 1.0 #581
Conversation
Improves EmbeddingNet() performance time by 100% where n_agents > 10_000 and extends functionality without termination up to n_agents=100_000.
Updates code and removes omergeleft() and replaces with updated default_pars().
Updated add_pairs() to align with main branch.
Expands test coverage to 79%.
…ameter even if using a subclass. Now `self.pars.p_fertility` in `init_pre` rather than doing everything in `__init__`. Also changing `uint64` to signed `int64` in test_randomness.
…ecause `fertility_rate[max_age+1] = 0` and the fertility rate had indices of -inf and 0: ```python index = pd.MultiIndex.from_arrays([[default_year, default_year], [-np.inf, 0]], names=['year','age']) return pd.Series(index=index, data=[out_of_range, data]) ``` I don't like this approach, too complied and confusing, but at least it seems to work now.
Update network.py
Test coverage 80
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.
Looks great!!!
Playing around with the new repr:
|
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.
Exiting to be so close to 1.0! I've added lots of comments in the new calibration code. Other changes seem great, just some minor suggestions here and there. Calibration changes will likely get push post 1.0 release.
@@ -295,8 +295,9 @@ def make_new_cases(self): | |||
# Tidy up | |||
if len(new_cases) and len(sources): | |||
new_cases = ss.uids.cat(new_cases) | |||
sources = ss.uids.cat(sources) | |||
networks = np.concatenate(networks) | |||
new_cases, inds = new_cases.unique(return_index=True) |
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.
Thoughts on passing an allow_superinfection
argument somewhere that would default to False
? Honestly, I think taking unique is the right think to do in 99% of applications, but it's not 100%.
|
||
__all__ = ['__version__', '__versiondate__', '__license__'] | ||
|
||
__version__ = '0.5.10' | ||
__versiondate__ = '2024-07-03' | ||
__version__ = '1.0.0' |
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.
Feels good!
skestimator (str): if provided, use this scikit-learn estimator instead | ||
estimator (func): if provided, use this custom estimator instead |
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.
Could these be combined? Call if function and otherwise try sk?
), | ||
networks = dict( | ||
randomnet = dict( | ||
n_contacts = [4, 2, 10], |
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.
What if these were ss.poisson
instead of scalars?
@@ -18,14 +18,18 @@ class Result(np.ndarray): | |||
'module', # The name of the module (e.g. hiv) | |||
'scale', # Whether or not the result scales with population size (e.g. True) | |||
'label', # The human-readable label for the result (e.g. Number of infections) | |||
'low', # The lower bound for the values (used with MultiSim) |
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.
Mention these low and high values are used for plotting confidence intervals. If not used for any other purpose, perhaps better to move into the MultiSim
class?
Dev tutorials
Improving pregnancy configuration and fixing test_randomness
Description
Calibration
class, based on Optuna, to facilitate the calibration of Starsim models.mean()
,median()
, andplot()
methods toMultiSim
.low
andhigh
attributes toResult
objects.flatten()
method toResults
, allowing nestedResults
objects to be turned into flat dictionaries.unique()
method toss.uids
.ss.lognorm_im()
from using callable parameters.Sim
string representation to be a single line; the more verbose version is available viasim.disp()
.Checklist