-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/data object toml #201
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #201 +/- ##
========================================
Coverage 94.22% 94.22%
========================================
Files 33 33
Lines 1333 1333
========================================
Hits 1256 1256
Misses 77 77 📣 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.
LGTM! I added a couple of comments for areas where we might need to settle on a consistent style
[[variable]] | ||
name = "bulk_aerodynamic_resistance" | ||
description = "bulk aerodynamic resistance" | ||
unit = "s m-1" |
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.
We might have to think about how we express this type of unit, I think calling this "m^-1" might be better. Might be somewhat tricky to address now though as it very much depends on a what can be read correctly (which I'm not totally sure on)
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.
Or if it even needs to be parsed. I'm not sure how we'd actually use parsed units unless we attach units to everything.
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.
Good point, I think it is still useful at the moment while we use it as a lookup table, too
name = "pH" | ||
description = "Soil pH" | ||
unit = "pH" | ||
source = "external + soil" |
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.
We probably also need to make sure we can express this consistently. "source1 + source2" definitely would be parseable downstream, but we would need to make sure we use it in every case
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.
oh yes, there was something similar with an abiotic variables, I wanted to put a comment here but forgot. I think it might be best to split in into two variables?
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.
I'm not quite sure what it means when there is external and a model? If it means that soil modifies external pH then it isn't a source, but it could mean that soil provides a default? This could be a list of sources? source = ["external", "soil"]
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.
I wasn't sure how to notate this one, basically pH will be drawn from data but down the line we might introduce a pH model to modify pH as the simulation proceeds (either based on changes in N or due to disturbance scenarios).
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 could maybe become "modified_by" rather than "source" as I guess that's what we want to capture here
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.
There is a difference between variables that come from an external source and others that are updated internally. I think they should have different names, such as pH_input
or something like that. I used _ref
for variables at reference height.
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.
Wouldn't this basically double the number of variables? At least in the soil module pretty much every variable stored in the data
object will be initialised using external data, duplicating everything seems like it could get pretty confusing. I guess the problem can be avoided once we store variables over time (rather than replacing everything at each time step) as the initial state will be preserved.
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.
Though maybe I'm confused and you are referring to continuous data from external sources, which the soil module doesn't have any of at the moment (I doubt it ever will)
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.
I was referring to external data that comes as a time series and is used at every time step. I would say initialization is a a different story
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.
Ahhh right I misunderstood then 🙃. Completely agree that we should not be altering continuous input data!
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.
LGTM
I changes the |
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.
All the soil ones are correct!
This is an intermediate solution, however, I merge so that others can add their variables easily. Need to discuss units and use in VR in the future, see #202 |
This is a list that contains (eventually all) variables that could potentially be stored in the data object. This list should be used to check for consistent variables names and properties across all modules. At the moment, it is just a collection where everyone can add their variables in a central location.
In the future, we might want to split the list according to the source or use of the variables, but this can be discussed when needed. Further, we already spoke about adding a flag for optional variables, but this is also not urgent.
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks