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

Skip to content

Commit 5ca6087

Browse files
authored
Issue #1542 Bug fix case sensitivity of periods keyword in iMOD project file. (#1543)
Fixes #1542 # Description <!--- Thanks for opening a PR! Please add your description here of changes made and how they are going to resolve the linked issue --> This fixes a minor bug related to unwanted case sensitivity of the periods keyword 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
1 parent c2703ec commit 5ca6087

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

docs/api/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Fixed
4646
- Fixed bug in :meth:`imod.mf6.Well.cleanup` and
4747
:meth:`imod.mf6.LayeredWell.cleanup` which caused an error when called with an
4848
unstructured discretization.
49+
- Fixed bug in :func:`imod.formats.prj.open_projectfile_data` which caused an
50+
error when a periods keyword was used having an upper case.
4951

5052
Changed
5153
~~~~~~~

imod/formats/prj/prj.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ def open_projectfile_data(path: FilePath) -> tuple[dict[str, Any], dict[str, Any
10521052
# Set the year of a repeat date to 1899: this ensures it falls outside
10531053
# of the iMOD calendar. Collisions are then always avoided.
10541054
periods = {
1055-
key: _process_time(time, yearfirst=False).replace(year=1899)
1055+
key.lower(): _process_time(time, yearfirst=False).replace(year=1899)
10561056
for key, time in periods_block.items()
10571057
}
10581058

imod/tests/test_formats/test_prj.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@
8282
1900-01-01
8383
001,001
8484
1,2, 001, 1.0, 0.0, -999.9900,"{basepath}/rch.idf",
85-
summer
85+
SUMMER
8686
001,001
8787
1,2, 001, 1.0, 0.0, -999.9900,"{basepath}/rch.idf",
88-
winter
88+
WINTER
8989
001,001
9090
1,2, 001, 1.0, 0.0, -999.9900,"{basepath}/rch.idf",
9191
@@ -109,9 +109,9 @@
109109
QERROR= 0.1000000
110110
111111
Periods
112-
summer
112+
SUMMER
113113
01-04-1900 00:00:00
114-
winter
114+
WINTER
115115
01-10-1900 00:00:00
116116
117117
Species

0 commit comments

Comments
 (0)