Skip to content
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

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

deltamarnix
Copy link
Contributor

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

  • Emptied the __init__.py file in flopy/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.
  • Removed all the dfn files from flopy, they will be downloaded from the correct ref in MODFLOW6.
  • Remove all simulation, model, package python files, they should be generated based on which modflow you are developing for.

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.

@@ -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":
Copy link
Contributor Author

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",
Copy link
Contributor Author

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.

@wpbonelli wpbonelli marked this pull request as draft November 29, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant