Skip to content

[com4]: Add thalweg computation option#1320

Open
PaulaSp3 wants to merge 8 commits into
masterfrom
PS_thalweg_onlyFP
Open

[com4]: Add thalweg computation option#1320
PaulaSp3 wants to merge 8 commits into
masterfrom
PS_thalweg_onlyFP

Conversation

@PaulaSp3

@PaulaSp3 PaulaSp3 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

The goal is to derive thalweg data for each flow path (release from one release cell or from all cells having the same release ID).
The location of a thalweg is derived as the center of zDelta or energy or flux of the locations within one generation.

So the computation within the flowCore.py is changed so that we remember and track which cells are hidden within each generation.

Please be aware that simulations with computing thalwegs increases the computation time and the consumed RAM.

Short description of the changed files:

  • com4FlowPy/com4FlowPy.py

    • black formatter
    • allow thalweg calculation (input parameter handling)
  • com4FlowPy/flowClass.py

    • compute flow energy as: flux * zdelta * 9.81
  • com4FlowPy/flowCore.py

    • option for a calculation generation wise (considering the order of cells that are computed) -> different results!
    • get_start_idx, split_release (line 25-165):when thalweg is calculated for continuous release areas, check that all start cells belonging to one release area are computed in one Core
  • com4FlowPy/flowPath.py

    • compute averaged values for each generation (e.g., x and y values -> location of thalweg)
    • save thalweg Data as pickle
  • com4FlowPy/splitAndMerge.py

    • add a function that computes tiling extents, that do not split release cells that have the same release ID
  • data/avaParabChannelPaperFP:

    • topo: parabola with channel
  • in3Utils/geoTrans.py:

    • black formatter
    • indicesToCoords(): compute row and col to x and y (is there already a function for this computation? - I could not find it)
  • runCom4FlowPy.py:

    • black formatter
    • allow thalweg computation (input parameters and path handling)
  • runScripts/runRegionalThalweg2DPlot.py:

    • runscript for plotting com4 thalweg data
  • runStandardTestsCom4FlowPy.py:

    • run "simple" benchmark test for com4FlowPy
    • data: avaParabChannelPaperFP and avaArzlerAlm
    • simulation results are compared and the difference of the simulation results is written into the report

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)

@PaulaSp3 PaulaSp3 self-assigned this Jul 20, 2026
@PaulaSp3 PaulaSp3 added the flowPyDev Ideas for future development label Jul 20, 2026
@qltysh

qltysh Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Analysis for project AvaFrame

❌ 11 blocking issues (39 total)

Tool Category Rule Count
ripgrep Lint # TODO: we could put this checking part in an extra function, if we can move updateInfraDirGraph 10
ruff Style Incorrect formatting, autoformat by running qlty fmt. 1
qlty Structure Deeply nested control flow (level = 4) 19
qlty Structure Function with high complexity (count = 26): tileInputLayers 6
qlty Duplication Found 17 lines of similar code in 2 locations (mass = 140) 2
qlty Structure High total complexity (count = 71) 1

@qltysh one-click actions:

  • Auto-fix formatting (qlty fmt && git push)

@PaulaSp3
PaulaSp3 requested a review from ahuber-bfw July 20, 2026 16:23
@PaulaSp3 PaulaSp3 changed the title Add thalweg computation option [com4]: Add thalweg computation option Jul 20, 2026
@qltysh

qltysh Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

⬇️ Merging this pull request will decrease total coverage on master by 1.65%.

Modified Files with Diff Coverage (6)

RatingFile% DiffUncovered Line #s
Coverage rating: F Coverage rating: F
avaframe/com4FlowPy/flowCore.py25.1%56, 63, 107-487...
Coverage rating: C Coverage rating: B
avaframe/com4FlowPy/splitAndMerge.py99.3%332
Coverage rating: F Coverage rating: F
avaframe/com4FlowPy/flowClass.py100.0%
Coverage rating: F Coverage rating: F
avaframe/com4FlowPy/com4FlowPy.py0.0%80-701
Coverage rating: A Coverage rating: A
avaframe/in3Utils/geoTrans.py14.3%2264-2269
New Coverage rating: F
avaframe/com4FlowPy/flowPath.py7.9%40-84, 106-114...
Total32.2%
🤖 Increase coverage with AI coding...
In the `PS_thalweg_onlyFP` branch, add test coverage for this new code:

- `avaframe/com4FlowPy/com4FlowPy.py` -- Line 80-701
- `avaframe/com4FlowPy/flowCore.py` -- Lines 56, 63, 107-487, 599-600, 666-668, 723-1021, 1029, 1033-1039, 1050, 1057-1068, 1081, 1087, 1121, 1126-1132, 1141, 1147, and 1161-1194
- `avaframe/com4FlowPy/flowPath.py` -- Lines 40-84, 106-114, 117-138, 145-159, 182-195, 210-245, 265-270, 286-322, and 332-388
- `avaframe/com4FlowPy/splitAndMerge.py` -- Line 332
- `avaframe/in3Utils/geoTrans.py` -- Line 2264-2269

🚦 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.

@PaulaSp3
PaulaSp3 force-pushed the PS_thalweg_onlyFP branch from b82c060 to 8c33e6f Compare July 23, 2026 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flowPyDev Ideas for future development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant