Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug] - failing usage of relative paths for extra MetaSWAP files in iMOD projectfile #1528

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

Closed
verkaik opened this issue May 19, 2025 · 0 comments · Fixed by #1529
Closed
Assignees
Labels
bug Something isn't working

Comments

@verkaik
Copy link
Contributor

verkaik commented May 19, 2025

Bug description
When relative paths are used for the extra MetaSWAP files in the iMOD project (.prj) file, e.g.

006,EXTRA FILES
.\DATA\metaswap\fact_svat.inp
.\DATA\metaswap\luse_svat.inp
.\DATA\metaswap\meteo\mete_grid.inp
.\DATA\metaswap\para_sim.inp
.\DATA\metaswap\tiop_sim.inp
.\DATA\metaswap\init_svat.inp

this will result in a crash like:

Exception has occurred: FileNotFoundError
[Errno 2] No such file or directory: './DATA/metaswap/para_sim.inp'
File "C:\data\codes\git\imod-python_trunk\imod\msw\utilities\parse.py", line 47, in read_para_sim
with open(file, "r") as f:
^^^^^^^^^^^^^^^
File "C:\data\codes\git\imod-python_trunk\imod\msw\model.py", line 430, in from_imod5_data
parasim_settings = read_para_sim(path_to_parasim)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\data\projects\project_iMOD-Python\conversion\import_msw.py", line 37, in
msw_model = imod.msw.MetaSwapModel.from_imod5_data(imod5_data, dis_pkg, times)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './DATA/metaswap/para_sim.inp'

Steps to reproduce
Simply specify relative paths for the extra MetaSWAP files.

@verkaik verkaik added the bug Something isn't working label May 19, 2025
@github-project-automation github-project-automation bot moved this to 📯 New in iMOD Suite May 19, 2025
github-merge-queue bot pushed a commit that referenced this issue May 19, 2025
…in iMOD projectfile (#1529)

Fixes #1528 

# Description
<!---
Thanks for opening a PR!

Please add your description here of changes made and how they are going
to
resolve the linked issue 
-->
Fixes the issue of using relative paths for the extra MetaSWAP files in
the iMOD project file.

# Checklist
<!---
Before requesting review, please go through this checklist:
-->

- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [ ] **If feature added**: Added/extended example

---------

Co-authored-by: JoerivanEngelen <[email protected]>
@github-project-automation github-project-automation bot moved this from 📯 New to ✅ Done in iMOD Suite May 19, 2025
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
1 participant