1442 hydrology model improve rainfall generation#1444
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1444 +/- ##
===========================================
+ Coverage 94.94% 94.97% +0.02%
===========================================
Files 71 71
Lines 7460 7498 +38
===========================================
+ Hits 7083 7121 +38
Misses 377 377 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…tps://github.com/ImperialCollegeLondon/virtual_rainforest into 1442-hydrology-model-improve-rainfall-generation
|
@jacobcook1995 is this error related to what you spoke about earlier ? If not have you come across this?
|
I don't think so, no. I think this is one of the classic "haven't used the correct indent somewhere in your docstrings" cases |
Oh gods. For some reason, something about creating links for the pydantic field values causes issues with sphinx. I'm not sure why these fields. I think there might be a way to extend the nitpicking using a regexp? |
haha, what? Could you point me to where I can find out about this? |
|
https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-nitpick_ignore_regex I think we could use: nitpick_ignore_regex = [
(r"py:class", r'virtual_ecosystem.models..*.model_config..*')
]That would (possibly) mute all similar warnings on all models. There are a couple of packages that are specifically intended to help document pydantic objects better:
|
…tps://github.com/ImperialCollegeLondon/virtual_rainforest into 1442-hydrology-model-improve-rainfall-generation
| p_wet_wet: float = 0.6 | ||
| """Probability a wet day follows a wet day.""" | ||
| p_wet_dry: float = Field(ge=0.1, le=0.5, default=0.3) | ||
| p_wet_dry: float = 0.3 | ||
| """Probability a wet day follows a dry day.""" | ||
| rainfall_shape_parameter: float = Field(ge=0.7, le=4.0, default=1.5) | ||
| rainfall_shape_parameter: float = 1.5 | ||
| """Shape parameter of the Gamma distribution controlling rainfall variability.""" | ||
| rainfall_scale_parameter: float = Field(ge=0.1, le=2.0, default=1.0) | ||
| rainfall_scale_parameter: float = 1.0 | ||
| """Scale parameter of the Gamma distribution controlling magnitude of rainfall.""" |
There was a problem hiding this comment.
Oh god, we shouldn't need to cripple the checking and validation just because sphinx is being shit. I mean, the example three lines above works fine. I really don't understand what the hell sphinx is doing here.
There was a problem hiding this comment.
I agree, I only removed it to see what happens before diving into nitpicking... like you say, the previous lines work so this makes no sense. @dalonsoa any immediate thoughts?
There was a problem hiding this comment.
After not being successful here, I created an issue #1450 and will merge this so I can move on with the science side of things.
…tps://github.com/ImperialCollegeLondon/virtual_rainforest into 1442-hydrology-model-improve-rainfall-generation
This PR replaces the random rainfall generator with a more realistic function. It also makes the hydrology_model tests a bit more generalised.
I haven't updated the docs as I wasn't sure if we have the new version released ye, so opened #1443.
Fixes #1442
Type of change
Key checklist
pre-commitchecks:$ pre-commit run -a$ poetry run pytestFurther checks