Skip to content

[com4]: Add result file: minimum of travel length and travel angle#1159

Merged
fso42 merged 1 commit into
masterfrom
PS_FP_addOutput
Aug 6, 2025
Merged

[com4]: Add result file: minimum of travel length and travel angle#1159
fso42 merged 1 commit into
masterfrom
PS_FP_addOutput

Conversation

@PaulaSp3
Copy link
Copy Markdown
Contributor

@PaulaSp3 PaulaSp3 commented Jul 8, 2025

@PaulaSp3 PaulaSp3 self-assigned this Jul 8, 2025
@PaulaSp3 PaulaSp3 added the flowPyDev Ideas for future development label Jul 8, 2025
@PaulaSp3 PaulaSp3 requested a review from ahuber-bfw July 8, 2025 15:59
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented Jul 8, 2025

Diff Coverage: The code coverage on the diff in this pull request is 20.6%.

Total Coverage: This PR will increase coverage by 1.1%.

File Coverage Changes
Path File Coverage Δ Indirect
avaframe/com4FlowPy/flowClass.py 33.8
avaframe/com4FlowPy/flowCore.py 29.4
🛟 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.

@fso42 fso42 added this to the Version 1.13 milestone Jul 8, 2025
Copy link
Copy Markdown
Contributor

@ahuber-bfw ahuber-bfw left a comment

Choose a reason for hiding this comment

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

Thx for the PR,

  • the new outputs (travelLengthMin, fpTravelAngleMin) are producing expected results!
  • In release areas the use of min when overlaying results from different paths leads to the effect, that (probably all) release cells will have values of 0 for both the travelAngle and the travelLength output --> this has to be interpreted accordingly in the results (I tried to describe this in #1160 - since this behavior might lead to unexpected results when interpreting these outputs)

two minor change requests:

  • maybe we can also initialize the travelLenghtMax and fpTravelAngleMax with np.ones_like() * -9999 - so behaviour is the same for min and max outputs
  • if it's easy to implement, we could only execute code parts if the respective output layers are defined in the (local_)com4FlowPy.ini file.

Comment thread docs/moduleCom4FlowPy.rst Outdated
Comment thread docs/moduleCom4FlowPy.rst Outdated
Comment thread avaframe/com4FlowPy/flowCore.py
Comment thread avaframe/com4FlowPy/flowCore.py Outdated
@qltysh
Copy link
Copy Markdown
Contributor

qltysh Bot commented Jul 9, 2025

2 new issues

Tool Category Rule Count
qlty Structure Deeply nested control flow (level = 4) 2

Comment thread avaframe/runCom4FlowPy.py
@PaulaSp3 PaulaSp3 force-pushed the PS_FP_addOutput branch 2 times, most recently from a1eb82e to 57b5738 Compare July 9, 2025 15:25
@PaulaSp3 PaulaSp3 added the enhancement New feature or request label Jul 9, 2025
Copy link
Copy Markdown
Contributor

@ahuber-bfw ahuber-bfw left a comment

Choose a reason for hiding this comment

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

Looks good from my perspective now!

  • The remaining code improvements discussed in #1161 (also using -9999 for non-affected cells in the model domain for all outputs that uses sums) can be addressed at a later stage.

@PaulaSp3 PaulaSp3 assigned awirb and unassigned PaulaSp3 Jul 9, 2025
fix bug

fix bug

doc for additional output files

small adaptation

null data values are 0

Revert "null data values are 0"

This reverts commit aa46b4b.

travelLength, fpTravelAngle, slTravelAngle, flux have value -9999 in cells that are not hit by a process

Update docs/moduleCom4FlowPy.rst

Co-authored-by: ahuber-bfw <112931921+ahuber-bfw@users.noreply.github.com>

Update docs/moduleCom4FlowPy.rst

Co-authored-by: ahuber-bfw <112931921+ahuber-bfw@users.noreply.github.com>

minor

minor mod to runCom4FlowPy.py to include new outputs as valid output options

only comupte rasters when specified in outputs

add test

test calculation
@PaulaSp3 PaulaSp3 assigned fso42 and unassigned awirb Jul 28, 2025
@fso42 fso42 merged commit 5833658 into master Aug 6, 2025
4 of 5 checks passed
@fso42 fso42 deleted the PS_FP_addOutput branch August 6, 2025 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request flowPyDev Ideas for future development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

com4FlowPy: travelLengthArray - why is the maximum taken of the minimum distance?

4 participants