Skip to content

[ana5]: add general thalweg extension & resampling - #1323

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

[ana5]: add general thalweg extension & resampling#1323
fso42 merged 1 commit into
masterfrom
PS_FP_thalweg

Conversation

@PaulaSp3

@PaulaSp3 PaulaSp3 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The goal is to derive a thalweg profile from very general thalweg data (containing x and y coordinates).

This changed in each file:

  • ana5Utils/DFAPathGeneration.py:

    • black formatter
    • extendProfileTop : add extension option that extends the path to the top similar as the bottom extension that depends on the flow/ path direction
      (for option 2, the code is very similar as in extendProfileBottom, should we summarize both in one function with options/different handling for top nd bottom extension?)
    • extendProfileBottom: add possibility to consider lower left center when reading z values from DEM
    • resamplePath : add parameter in configfile that can change the degree of the spline
  • ana5Utils/DFAPathGenerationCfg.ini:

    • add parameter in configfile that can change the degree of the spline (for resampling a path)
  • ana5Utils/preparePathGeneral.py
    functions to prepare a path/thalweg that has only x and y coordinates:

    • extend path to top and bottom
    • resample path
    • read z values along path (from DEM)
    • compute s values along path
  • out3Plot/outCom3Plots.py

    • black formatter
    • generateCom1DFAPathPlot: put the avalanche thalweg location plot into a separate function avalancheThalwegPlot

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 requested review from awirb and fso42 July 31, 2026 10:27
@PaulaSp3 PaulaSp3 self-assigned this Jul 31, 2026
@PaulaSp3 PaulaSp3 added the enhancement New feature or request label Jul 31, 2026
@PaulaSp3 PaulaSp3 linked an issue Jul 31, 2026 that may be closed by this pull request
7 tasks
@PaulaSp3 PaulaSp3 changed the title [ana5]: add general thalweg generation [ana5]: add general thalweg extension & resampling Jul 31, 2026
@PaulaSp3 PaulaSp3 linked an issue Jul 31, 2026 that may be closed by this pull request
14 tasks
@qltysh

qltysh Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

All good ✅

Comment thread avaframe/ana5Utils/DFAPathGeneration.py
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/ana5Utils/DFAPathGeneration.py
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/out3Plot/outCom3Plots.py
Comment thread avaframe/out3Plot/outCom3Plots.py Outdated
Comment thread avaframe/out3Plot/outCom3Plots.py Outdated
Comment thread avaframe/out3Plot/plotUtils.py
Comment thread avaframe/tests/test_preparePathGeneral.py
@qltysh

qltysh Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

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

Modified Components (1)

RatingComponent% Diff
Coverage rating: C Coverage rating: C
com1DFA90.0%

Modified Files with Diff Coverage (3)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
avaframe/com1DFA/DFAtools.py90.0%190
Coverage rating: C Coverage rating: B
avaframe/ana5Utils/DFAPathGeneration.py77.5%54-133, 181-199...
New file Coverage rating: B
avaframe/ana5Utils/preparePathGeneral.py82.1%49-59
Total78.4%
🤖 Increase coverage with AI coding...
In the `PS_FP_thalweg` branch, add test coverage for this new code:

- `avaframe/ana5Utils/DFAPathGeneration.py` -- Lines 54-133, 181-199, 566-569, 607-609, 678-679, 704-705, 1036-1037, and 1107-1137
- `avaframe/ana5Utils/preparePathGeneral.py` -- Line 49-59
- `avaframe/com1DFA/DFAtools.py` -- Line 190

🚦 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_FP_thalweg branch 3 times, most recently from ea6399c to da66642 Compare August 13, 2026 11:26
Comment thread avaframe/ana5Utils/preparePathGeneral.py
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/out3Plot/outCom3Plots.py
Comment thread avaframe/ana5Utils/preparePathGeneral.py Outdated
Comment thread avaframe/ana5Utils/preparePathGeneral.py Outdated
Comment thread avaframe/ana5Utils/preparePathGeneral.py Outdated
Comment thread avaframe/ana5Utils/preparePathGeneral.py
@PaulaSp3
PaulaSp3 force-pushed the PS_FP_thalweg branch 2 times, most recently from a41f2bf to 673066c Compare August 24, 2026 16:40
Comment thread docs/moduleAna5Utils.rst Outdated
Comment thread avaframe/ana5Utils/DFAPathGeneration.py
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/ana5Utils/DFAPathGeneration.py Outdated
Comment thread avaframe/ana5Utils/DFAPathGeneration.py
Comment thread avaframe/ana5Utils/preparePathGeneral.py Outdated
Comment thread avaframe/ana5Utils/preparePathGeneral.py
Comment thread avaframe/com1DFA/DFAtools.py Outdated
Comment thread avaframe/com1DFA/DFAtools.py
Comment thread avaframe/out3Plot/outCom1DFA.py
Comment thread avaframe/tests/test_preparePathGeneral.py
Comment thread avaframe/ana5Utils/preparePathGeneral.py
Comment thread avaframe/ana5Utils/DFAPathGeneration.py
@PaulaSp3 PaulaSp3 assigned fso42 and unassigned PaulaSp3 Sep 1, 2026
resample path

comments FSO

correct comment

adapt test

comments AW

adapt dou

fix typo

Co-authored-by: Anna Wirbel <68687423+awirb@users.noreply.github.com>

move extension with direction into separate function

can compute extension for 2 points

use parameter from ini file

adapt tests; config ini
@fso42

fso42 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Standardtests ok, apart from known com5

@fso42
fso42 merged commit 22eba9a into master Sep 1, 2026
6 of 7 checks passed
@fso42
fso42 deleted the PS_FP_thalweg branch September 1, 2026 12:02
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]: thalweg identification [com4], [ana5]: Add Flowpy thalweg postprocessing

3 participants