-
Notifications
You must be signed in to change notification settings - Fork 2
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
666 repair model attribute typing and docstrings #692
666 repair model attribute typing and docstrings #692
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #692 +/- ##
===========================================
+ Coverage 94.60% 94.66% +0.05%
===========================================
Files 73 73
Lines 4800 4833 +33
===========================================
+ Hits 4541 4575 +34
+ Misses 259 258 -1 ☔ View full report in Codecov by Sentry. |
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.
The changes look good, and indeed this is a more canonical approach than using fake class variables.
Probably the docs should be updated to explain what goes in __init__
and what in _setup
when creating a new model.
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 is looking good. Can you update the doc API files for the models to include inherited members? I think that's what we want as we currently can't see anything being inherited from the base class.
For example:
virtual_ecosystem/docs/source/api/models/plants/plants_model.md
Lines 29 to 36 in 7838fa8
## The {mod}`~virtual_ecosystem.models.plants.plants_model` module | |
```{eval-rst} | |
.. automodule:: virtual_ecosystem.models.plants.plants_model | |
:autosummary: | |
:members: | |
:exclude-members: model_name | |
``` |
should go to (I think):
```{eval-rst}
.. automodule:: virtual_ecosystem.models.plants.plants_model
:autosummary:
:members:
:exclude-members: model_name
:inherited_members:
```
I added this. I'm a bit confused about how the docs work TBH because in the version that I built and linked in the description above, it does seem to be showing? Is that in a different place? Anyways, added |
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 good - we really need to update the model creation docs, but we also need to do that to reflect the static model changes as well, so lets do that separately under #676
Description
Move attribute declarations out of
_setup
to subclass__init__
functions. The attributes are now defined and documented in the proper place (e.g. see updated hydrology docs as compared to old hydrology docs).It would be great to get general feedback, as well as everyone looking over the changes to their modules in order to make sure the variables are all typed correctly etc @vgro @davidorme @jacobcook1995 @TaranRallings.
Fixes #666
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks