Skip to content

com4FlowPy: variable raster value validation - #1328

Merged
fso42 merged 1 commit into
masterfrom
HM_com4_input_validation
Sep 1, 2026
Merged

com4FlowPy: variable raster value validation#1328
fso42 merged 1 commit into
masterfrom
HM_com4_input_validation

Conversation

@MunsMan

@MunsMan MunsMan commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

An attempt to improve the input validation.

Validates the variable input rasters (alpha, umax) before the simulation.

closes #1327

This implementation currently breakes:

avaframe/tests/test_com4FlowPy.py::test_runCom4FlowPy
with:
rasterio.errors.RasterioIOError: '/private/var/folders/57/n7xtvxg905j6tywq55t9..

PR Checklist

Please confirm before requesting review:

  • I ran pytest locally without fails
  • I added/updated tests where needed
  • I updated documentation where needed

Confirm before the final merge/rebase into master

  • Commits are sensibly squashed and rebased onto latest master
  • Standardtest run without difference (with recompiled cython code)

@qltysh

qltysh Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

All good ✅

Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/tests/test_com4FlowPy.py Outdated
Comment thread avaframe/tests/test_com4FlowPy.py Outdated
@MunsMan
MunsMan force-pushed the HM_com4_input_validation branch from 0981a0b to 960467c Compare August 17, 2026 17:09
@fso42
fso42 requested a review from PaulaSp3 August 18, 2026 07:05
@MunsMan
MunsMan force-pushed the HM_com4_input_validation branch from aa4eee7 to d3fa467 Compare August 18, 2026 09:17
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
@qltysh

qltysh Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

⬆️ Merging this pull request will increase total coverage on master by 0.2%.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: F Coverage rating: D
avaframe/com4FlowPy/com4FlowPy.py100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py
Comment thread avaframe/tests/test_com4FlowPy.py Outdated
Comment thread avaframe/tests/test_com4FlowPy.py
Comment thread avaframe/tests/test_com4FlowPy.py Outdated
@ahuber-bfw
ahuber-bfw force-pushed the HM_com4_input_validation branch from a982070 to 8648719 Compare August 26, 2026 12:12
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated

@ahuber-bfw ahuber-bfw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hab's noch ein bisschen umstrukturiert

  • die "valid parameter ranges" aus dem .ini entfernt und in eine extra funktion gegeben, wo sie bei Bedarf angepasst werden können (außer die limits für max_u und max_z macht eine user-Anpassung aber wenig bis keinen Sinn, weil mit anderen Wertebereichen dann entweder numerisch Probleme auftauchen, bzw. diese auch einfach keinen Sinn ergeben)
  • die sys.exit(1) durch raise ValueError ersetzt

was noch fehlt:

  • pytests für die neuen funktionen zusätzlich zu validateInputArray() (mach ich noch bevor ich die pytest und doku häkchen setze)

für später:

  • Entsprechende Anpassung der anderen hard exits mit sys.exit() bei Zeit und Muße

Comment thread avaframe/com4FlowPy/com4FlowPy.py Outdated
Comment thread avaframe/com4FlowPy/com4FlowPy.py
Comment thread avaframe/tests/test_com4FlowPy.py
@PaulaSp3
PaulaSp3 force-pushed the HM_com4_input_validation branch 2 times, most recently from 1c5fa98 to 63dc1b8 Compare August 31, 2026 08:18
@fso42 fso42 self-assigned this Sep 1, 2026
- improved roved input parameter/data checks for com4FlowPy

- fix(com4FlowPy): defining default as fallback

- add(com4FlowPy) raster value validation

- refactor array validation

- add (test) array validation

- fixing pra detection

- moving limit into cfg

- updating to python conventions

- releasePath to releasePathWork - fixes pytest issue with .shp input

re-structuring input paramter check and raising ValueError instead of sys.exit(1)

f strings in check function consistently

import suggestions Paula for added com4FlowPy pytest

expose valid parameter limits in .ini

minor formatting fix

add tests
@fso42
fso42 force-pushed the HM_com4_input_validation branch from 63dc1b8 to aefc2ce Compare September 1, 2026 10:00
@fso42 fso42 added the enhancement New feature or request label Sep 1, 2026
@fso42

fso42 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Standardtests ident, apart from known com5

@fso42
fso42 merged commit 0946314 into master Sep 1, 2026
5 of 6 checks passed
@fso42
fso42 deleted the HM_com4_input_validation branch September 1, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[com4]: checkInputParameterValues - adapt for spatially variable input parameter rasters

4 participants