666 repair model attribute typing and docstrings#692
Conversation
Codecov Report✅ All 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. 🚀 New features to boost your workflow:
|
dalonsoa
left a comment
There was a problem hiding this comment.
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.
davidorme
left a comment
There was a problem hiding this comment.
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
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 |
Description
Move attribute declarations out of
_setupto 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-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks