-
Notifications
You must be signed in to change notification settings - Fork 320
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
Generate classes from dfns on get-modflow #2385
base: develop
Are you sure you want to change the base?
Generate classes from dfns on get-modflow #2385
Conversation
Ignore generated py and dfn files for generated classes
Supported: modflow6 as repository, or executables that contain mf6
@@ -556,6 +561,10 @@ def add_item(key, fname, do_chmod): | |||
items.append(fname) | |||
if not fname.endswith(lib_suffix): | |||
chmod.add(fname) | |||
|
|||
if repo == "modflow6": |
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 able to get this working for the nightly builds, because there doesn't seem to be a reference from the nightly to which git commit of modflow was used to build it.
@@ -31,6 +31,7 @@ requires-python = ">=3.9" | |||
dependencies = [ | |||
"numpy>=1.20.3", | |||
"matplotlib >=1.4.0", | |||
"modflow-devtools", |
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 happy with this dependency, but it's how generate_classes
currently downloads and unzips. Perhaps we should move it, or copy it.
When calling get-modflow from the executables or the modflow6 repo, it will automatically generate the mf6 package, model, and simulation classes.
It is also possible to call
generate-mf6-classes
directly as a command. So if you have your own dfn files stored somewhere, you can generate the classes using that folder.Changes
__init__.py
file inflopy/mf6/modflow/__init__.py
. When you have generated the files, you will see a change in the init file. This should never be committed when developing flopy. The file must remain empty.Why?
With this functionality in place, we can release flopy independently from modflow6. Meaning that we can push bug fixes to flopy without releasing modflow6, and vice versa.
And we will now be backwards compatible. Flopy can generate python classes from older modflow6 releases.