-
Notifications
You must be signed in to change notification settings - Fork 5
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
Remove gempyor.seeding
Dependence On gempyor.model_info.ModelInfo
#422
Remove gempyor.seeding
Dependence On gempyor.model_info.ModelInfo
#422
Conversation
* Added explicit exports, * Reordered imports, * Added general structure comments, and * Refactored all lines to be less than 92 characters.
Remvoed the `modinf` arg from the `_DataFrame2NumbaDict` internal utility and replaced it with the individual attributes from the `modinf` object that are needed.
Untangled the `Seeding` class from the `ModelInfo` class by adding a method to `ModelInfo` that interfaces with the `Seeding` class.
Updated remaining references in inactive code, notebooks and the `gempyor.dev` module.
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 mostly good, some minor adjustments suggested.
Documenting my opinion re "why" For quick-and-dirty-one-off scripts, the polymorphic behavior is great(*until it isn't, but it is generally faster to write). For libraries, however, we want to avoid setting ourselves traps. Even one-argument methods might in the future be revised to have more or in a different order or ...etc. When comparing across diffs here, keeping the argument names makes it easier to grok what's happening. To the extent that code feels noisy, verbose, ... - I agree, but the fix to that is better abstractions, not using syntax sugar likely to lead to a hard-to-find bug in future work. |
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 aside from one missed arg=
revision
1f24393
to
fa7c048
Compare
* Per @pearsonca, @jcblemai suggestions call positional arguements with names. * Restyle call to `get_seeding_data` in `gempyor.seir.onerun_SEIR`.
fa7c048
to
085beca
Compare
Describe your changes.
This pull request untangles
gempyor.seeding.Seeding
fromgempyor.model_info.ModelInfo
by requiring explicit values be passed togempyor.seeding.Seeding
. This eases the unit testability of thegempyor.seeding
module. Also adds theModelInfo.get_seeding_data
method which replaces prior calls to theseeding
instance from theModelnfo
instance with amodinf
argument.Does this pull request make any user interface changes? If so please describe.
The user interface changes are:
gempyor.model_info.ModelInfo.get_seeding_data
method,gempyor.seeding.Seeding.get_from_config/file
methods, andgempyor.seeding.Seeding.get_from_file
in favor ofgempyor.seeding.Seeding.get_from_config
.Those are reflected in updates to the documentation in the docstrings of these methods.
What does your pull request address? Tag relevant issues.
This pull request addresses part of GH-397.