-
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
abiotic_tools introduced #186
Conversation
@@ -0,0 +1,54 @@ | |||
"""Test abiotic_tools.py.""" | |||
|
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 tests are cut and paste from the wind
submodule, so they already went through PR process.
Codecov Report
@@ Coverage Diff @@
## develop #186 +/- ##
===========================================
+ Coverage 95.51% 95.53% +0.02%
===========================================
Files 24 25 +1
Lines 1181 1187 +6
===========================================
+ Hits 1128 1134 +6
Misses 53 53
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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 seems like a sensible idea, I noticed a typo, but otherwise looks good to me!
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 only thing I'd query here is that abiotic_tools
is a bit vague. You basically have functions
and constants
. I could definitely see us having a standard structure within models of having model.constants
and model.functions
.
I don't think that should stop this PR - the aim of centralising those objects is fine - but we might revisit how these are arranged. For example, one thing might be that all constants classes typically go in a file (Wind and Radiation going with the general ones). There's also a case for them staying with their classes though.
"""The ``models.abiotic.abiotic_tools`` module contains a set of general functions and | ||
universal constants that are shared across submodels in the abiotic 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.
Is this deliberately not a link? It might well be, because it would be a link to itself, basically, but just checking.
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.
Yes, I followed the syntax from other modules here. I could add a link to the abiotic_model
, but I think that can wait until I had a think about what else to write in the docstring that is a bit more descriptive. For know it's just to continue with other things more easily.
We should definitely have a general discussion about constants and where they should go, at the moment each abiotic submodule has a data class at the top but this is not meant to stay there, it could well go in an abiotic.constants
file that constains all data classes.
Further discussion on uniform structure of constants needed, see #129 and #186 (review) |
I found a number of functions and universal constants that will be used by multiple submodules of the
abiotic_model
.I introduced a new submodule called
abiotic_tools
which contains them all and can be accessed easily by other submodules.The
AbioticConstants
might eventually go to a central point or can be accessed by others, for now it just makes theabiotic
part of the model easier to manage.Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks