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 constant values in PRJ #1323

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

Comments

@WouterSwierstra
Copy link

Bug description
Modflow6Simulation.from_imod5_data does not work when constant is in PRJ file.
Minor issue, it can be easily replaced by a contstant IDF, but thought this should work so submitted it.

Steps to reproduce

  1. What error message do you get?

File "c:\data\projdirs\Peelvenen\Fase1_OLO\models\Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-COND-imodpython\src\mf6.py", line 67, in mf6_simulation_from_prj
simulation = Modflow6Simulation.from_imod5_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\logging\logging_decorators.py", line 32, in wrapper
return_value = fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\mf6\simulation.py", line 1422, in from_imod5_data
groundwaterFlowModel = GroundwaterFlowModel.from_imod5_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\logging\logging_decorators.py", line 32, in wrapper
return_value = fun(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\mf6\model_gwf.py", line 357, in from_imod5_data
drn_pkg = Drainage.from_imod5_data(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\mf6\drn.py", line 272, in from_imod5_data
regridded_package_data["conductance"] = distribute_drn_conductance(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\util\dims.py", line 15, in decorator
x = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\prepare\topsystem\conductance.py", line 210, in distribute_drn_conductance
PLANAR_GRID.validate(conductance)
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\schemata.py", line 139, in validate
schema.validate(obj, **kwargs)
File "c:\data\projdirs\iMOD-Suite-tutorial_03.pixi\envs\default\Lib\site-packages\imod\schemata.py", line 239, in validate
actual = tuple(obj.dims)
^^^^^^^^
AttributeError: 'numpy.float64' object has no attribute 'dims'. Did you mean: 'dumps'?

  1. Can you create a minimum reproducible example?
    An example model can be downloaded here:
    Model, dit is zelfde model als in HFB issue melding, 1x downloaden is genoeg

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

  • Model_Bugmelding\FixPaths.bat

Zonder constante 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 Constante in PRJ 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-COND-imodpython\01 CreateINI.bat
  • Model_Bugmelding\RUNFILES\BASIS1\BASIS1_STAT-MF6-COND-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 en een constante ingevuld onder CONDUCTANCE) 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.

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: 📯 New
Development

No branches or pull requests

1 participant