-
Notifications
You must be signed in to change notification settings - Fork 17
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
Model registry cleanup #230
Conversation
This makes model loaders simpler, since they don’t have to deal with the FileHandle.
Also clears outputs from notebook, to make diffs clearer in the future
Also removes `param_combinations` property. Instead, call `get_param_combinations` directly. This saves boilerplate code and is more extensible.
previous code changed the type since [val] was no longer a Quantity
Result of Benchmark Tests
|
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.
This looks great! The comments I have should be very easy to address. The most important one being, I think snewpy.models._init_model
should be public-facing. Is there a reason it is named with a leading underscore?
Co-authored-by: Spencer Griswold <39808718+sgriswol@users.noreply.github.com>
Eventually, yes. But for now, I think it’s not yet ready—see #225. For this PR, I just wanted to move that out of the |
Also adds `param` and `get_param_combinations()` to Analytic3Species class
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.
Thanks for putting this all together @JostMigenda! I have a few comments, most of which are cosmetic and should be easy to address.
- The citation links
OConnor_2013.ipynb
,Zha_2021.ipynb
, andWarren_2020.ipynb
are missing. - The output of code cell 3 in
Nakazato_2013.ipynb
is rather hard to read. - The population of valid
eos
andprogenitor_mass
parameters in the docstring ofsnewpy.models.ccsn.OConnor_2013
isn't happening because python/snewpy/models/ccsn.py:415 is commented. - In many of the example notebooks I received a warning over importing from
snewpy.models
rather thansnewpy.models.ccsn
. I have added suggestions to change most notebooks, but I was unable to make a suggestion forFornax_2019.ipynb
orOConnor_2013.ipynb
I will push a commit shortly to address these comments, aside from the suggestions I was able to make as part of the review (apologies for the mixed formats!).
Co-authored-by: Spencer Griswold <sgriswold@icecube.wisc.edu>
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 good to me!
This fixes #224. Two things I want to highlight in particular:
Model.param_combinations
property in favour ofModel.get_param_combinations()
(which already existed anyway). In addition to saving some boilerplate code, this is also more extensible. For example, I could imagine adding the ability to give additional arguments likeget_param_combinations(eos='shen')
to narrow the list down.During the review, please note that thus far, I’ve only updated
Nakazato_2013.ipynb
with the new model initialisation. Let me know if that looks reasonable; if so, I will updatebefore we can merge this PR.