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

Modflow6Simulation.from_imod5_data does not work with HFB #1322

Closed
WouterSwierstra opened this issue Dec 4, 2024 · 3 comments
Closed

Modflow6Simulation.from_imod5_data does not work with HFB #1322

WouterSwierstra opened this issue Dec 4, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@WouterSwierstra
Copy link

Bug description
Modflow6Simulation.from_imod5_data does not work if there is HFB package in PRJ file.

Steps to reproduce

  1. What error message do you get?

Traceback (most recent call last):
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\xarray\core\extension_array.py", line 112, in getattr
return getattr(self.array, attr)
^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\xarray\core\extension_array.py", line 112, in getattr
return getattr(self.array, attr)
^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\xarray\core\extension_array.py", line 112, in getattr
return getattr(self.array, attr)
^^^^^^^^^^
[Previous line repeated 997 more times]
RecursionError: maximum recursion depth exceeded

  1. Can you create a minimum reproducible example?
    An example model can be downloaded here:
    download model, link verloopt 2025-1-3

Als je het model uitpakt run fix_path.exe om alle paden (oa in PRJ files) goed te zetten:

  • Model_Bugmelding\FixPaths.bat

Zonder HFB kan het model doorgerekend worden met iMOD python. Run hiervoor onderstaande 2 batch files. N.B. dit werkt.

  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-imodpython\01 CreateINI.bat
  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-imodpython\02 RUN MODEL.bat (
    - in deze batch wel de verwijzing naar python installatie goed zetten

Met HFB rekent het model niet met iMOD python. Run hiervoor onderstaande 2 batch files. N.B. dit werkt niet.

  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-HFB-imodpython\01 CreateINI.bat
  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-HFB-imodpython\02 RUN MODEL.bat
    - in deze batch wel de verwijzing naar python installatie goed zetten

Om het model met iMOD5 door te rekenen (inclusief de HFB) N.B. dit werkt.

  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6\01 runmodel-PRJ MF6.bat

Let op
als je het model met iMOD5 runt komen de resulten te staan in Model_Bugmelding\RESULTS
De iMOD python berekeningen worden in een folder RESULTS weggeschreven op de locatie waar de berekening ook aangeroepen wordt.

Desktop (please complete the following information):

  • OS: Windows 11
  • iMOD Python Version 0.18.1

Additional context
Add any other context about the problem here. The more information you can
provide us, the quicker we respond and fix the problem.

@JoerivanEngelen
Copy link
Contributor

Thanks for the reproducible example! @Manangka tackled this and it should be fixed by #1327. I'll leave the issue open for now until either one of us has verified that the provided example is also fixed by this PR.

@JoerivanEngelen
Copy link
Contributor

I've tried running the code with the latest fixes, which improved things, but still some things are missing to run the code without error, I've made separate subissues for that, which I added to this issue.

@JoerivanEngelen
Copy link
Contributor

I managed to run your script with the changes in #1351

It requires one modification though, you need to deactivate the strict hfb validation as follows:

...
Simulation._validation_context.strict_hfb_validation = False
Simulation.write(MODELOUTPUTFOLDER, binary=True, validate=False)

Context: This setting is automatically set to False when importing from iMOD5, but when importing from iMOD5, dumping to file, then loading from file, this setting is lost. I've created a separate issue for this, as I think it is beyond the scope of this issue. #1352

@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in iMOD Suite Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants