-
Notifications
You must be signed in to change notification settings - Fork 330
feat(netcdf): support creating and loading model netcdf input files #2417
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2417 +/- ##
=========================================
+ Coverage 76.1% 76.3% +0.2%
=========================================
Files 296 297 +1
Lines 64215 64934 +719
=========================================
+ Hits 48885 49564 +679
- Misses 15330 15370 +40
🚀 New features to boost your workflow:
|
afb01ba
to
a29363e
Compare
1f7ae2f
to
f280aa7
Compare
e536392
to
4187da8
Compare
e966728
to
8cec938
Compare
8cec938
to
2ddc04b
Compare
2ddc04b
to
4c1e0ff
Compare
""" | ||
Open an existing dataset. Assumes the dataset has been annotated | ||
with the necessary attributes to read and update, including global | ||
attributes modflow_model and modflow_grid. |
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 there a specification of the necessary annotations (modflow_model
, modflow_grid
, etc) somewhere? flopy4 will need to know about them too, right?
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 basically our own convention about what's expected in a netcdf dataset, on top of whichever other conventions we may use internally, right?
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 annotations have been in flux with the dynamic (timeseries) input work ongoing in MODFLOW 6
now (GHBA
, etc). After that PR goes in (or with it), documentation will be updated to formalize and share these annotations. The first place might be the MODFLOW 6
wiki but could also be mf6io/markdown files, etc. And yes, these are are own annotations, the most important of which are associated with individual variables, e.g. modflow_input
which represents the mempath. These annotations identify the file as a valid input source for MODFLOW 6
.
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.
As far as alternative approaches- I would say that sort of approach is consistent with pyphoenix and maybe would help with integration or a cutover. xarray
itself wouldn't be sufficient though as this utility also supports creating UGRID compliant inputs- we would have needed to also use xugrid
or something similar. At the time, it was unclear what the path would be in pyphoenix, and I took what I thought was an Flopy3 consistent approach. Maybe we should talk about this more before it is merged- I'll need to update some tests first at any rate to bring what it there up to level with where MODFLOW 6
is.
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.
Ah, ok- so we'll have to use xugrid objects. That makes sense.
I dunno if functions are the best way. It doesn't really matter if they stand alone or live on a class. I just feel like we should be wary of redefining a data model, and try to lean on xarray/xugrid/etc as much as possible. I'd say as soon as you get the tests up to date it can come in and we can refactor as we go?
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.
Yeah that sounds good to me, updates will be needed soon for timeseries data and then whatever refactoring makes sense.
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.
Since this provides the functionality we need for now, I say bring it in.
But I wonder about introducing a new class hierarchy. Could we instead have factory functions creating xr.Dataset
? What do we get here by wrapping a custom class around a dataset?
Initial support for NetCDF model utility classes: