Skip to content

[com4FlowPy] minor Bugfix, documentation update and added feature for "forestFriciton", "forestDetrainment" and "forestFrictionLayer" model options#1071

Closed
ahuber-bfw wants to merge 36 commits intomasterfrom
AH_com4FlowPy_improvForestFricitonDist
Closed

[com4FlowPy] minor Bugfix, documentation update and added feature for "forestFriciton", "forestDetrainment" and "forestFrictionLayer" model options#1071
ahuber-bfw wants to merge 36 commits intomasterfrom
AH_com4FlowPy_improvForestFricitonDist

Conversation

@ahuber-bfw
Copy link
Contributor

  • fixed minor bug in runCom4FlowPy.py that caused an unhandled exception if the workDir did not exist a priori with useCustomPaths option set to True
  • updated com4FlowPy documentation (additional references, and small changes)
  • new Feature/modelOption skipForestDist:
    • skipForestDist allows the definition of a length [m] along the track (calculated in X,Y,Z and not in projected distances X,Y- to account for different track inclinations) that needs to be surpassed, before added forestFriction is modeled. This affects all forestFriction related code if forestFriction, forestFrictionLayer or forestDetrainment are selected.
    • the feature allows to define an "initial acceleration distance" for GMFs that release in or directly above dense forest and should provide a mechanism to prevent potential under-estimation of GMF runouts in these cases.
    • By leaving the default value skipForestDist = 0 the prior model behavior remains unchanged.
  • note: This makes the code ~ 5% to 10% slower in first tests

@ahuber-bfw ahuber-bfw added confirmed Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jan 21, 2025
@pep8speaks
Copy link

pep8speaks commented Jan 21, 2025

Hello @ahuber-bfw! Thanks for updating this PR.

Line 565:121: E501 line too long (121 > 120 characters)
Line 344:121: E501 line too long (121 > 120 characters)

Line 561:121: E501 line too long (124 > 120 characters)

Comment last updated at 2025-01-23 18:07:17 UTC

@ahuber-bfw ahuber-bfw requested a review from PaulaSp3 January 21, 2025 15:08
Copy link
Contributor

@PaulaSp3 PaulaSp3 left a comment

Choose a reason for hiding this comment

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

Nice function.
I haven't tested it a lot, I recognized larger zDelta - values with a longer skipForestDist (when computing with forestFriction).

ahuber-bfw and others added 2 commits January 23, 2025 16:57
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
ahuber-bfw and others added 4 commits January 23, 2025 18:12
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
@PaulaSp3 PaulaSp3 self-requested a review January 24, 2025 09:43
ahuber-bfw and others added 8 commits February 11, 2025 14:38
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>
Copy link

@qlty-cloud-legacy qlty-cloud-legacy bot left a comment

Choose a reason for hiding this comment

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

The PR diff size of 10820 lines exceeds the maximum allowed for the inline comments feature.

@codecov
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 72.98797% with 292 lines in your changes missing coverage. Please review.

Project coverage is 73.56%. Comparing base (eea271a) to head (846037d).
Report is 90 commits behind head on master.

Files with missing lines Patch % Lines
avaframe/out3Plot/outParticlesAnalysis.py 29.06% 122 Missing ⚠️
avaframe/in3Utils/generateTopo.py 73.21% 45 Missing ⚠️
avaframe/com1DFA/deriveParameterSet.py 80.48% 40 Missing ⚠️
avaframe/in3Utils/fileHandlerUtils.py 83.42% 29 Missing ⚠️
avaframe/in3Utils/geoTrans.py 91.15% 13 Missing ⚠️
avaframe/out1Peak/outPlotAllPeak.py 64.86% 13 Missing ⚠️
avaframe/out3Plot/outQuickPlot.py 46.15% 7 Missing ⚠️
avaframe/ana1Tests/testUtilities.py 80.00% 5 Missing ⚠️
avaframe/in2Trans/ascUtils.py 0.00% 5 Missing ⚠️
avaframe/ana1Tests/FPtest.py 0.00% 2 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1071      +/-   ##
==========================================
- Coverage   73.82%   73.56%   -0.26%     
==========================================
  Files          66       67       +1     
  Lines       14916    15621     +705     
==========================================
+ Hits        11012    11492     +480     
- Misses       3904     4129     +225     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

PaulaSp3 and others added 2 commits February 11, 2025 17:06
author PaulaSp3 <paula.spannring@gmail.com> 1737114502 +0100
committer ahuber-bfw <andreas.huber@bfw.gv.at> 1739289947 +0100

parent a638226
author PaulaSp3 <paula.spannring@gmail.com> 1737114502 +0100
committer ahuber-bfw <andreas.huber@bfw.gv.at> 1739289880 +0100

parent a638226
author PaulaSp3 <paula.spannring@gmail.com> 1737114502 +0100
committer ahuber-bfw <andreas.huber@bfw.gv.at> 1739289804 +0100

parent a638226
author PaulaSp3 <paula.spannring@gmail.com> 1737114502 +0100
committer ahuber-bfw <andreas.huber@bfw.gv.at> 1739289200 +0100

parent a638226
author PaulaSp3 <paula.spannring@gmail.com> 1737114502 +0100
committer ahuber-bfw <andreas.huber@bfw.gv.at> 1739288900 +0100

zDeltaSum computed as sum of paths, for every path the max is computed in every cell

remove setting label for contourline at collections

update docu ana5Utils DFAPath

optionally: move Automated path generation above Distance-Time Analysis

Add gdal related dependencies. rasterio, geopandas, fiona

  - add basemap to plot; rename ascUtils to rasterUtils
  - start inclusion of geotiff; working commit, squash
  - add cropshape option in plotAll
  - add alr tif

Add resampling using rasterio

  - rework new remesh to reproduce old remeshing
  - update reference remesh file for pytest test_geoTrans
  - remove unecessary code and test
    -> if raster is found with correct size, it already returns. There is no need for an overwrite then

Update parts to .asc and .tif compatibility

  - Fixes deriveParameterSet pytests
  - make search for sim and comp file (standard test) tif compatible
  - add pytest-mock to runTestSinglePython.yml action
  - This commit also updates the Code Climate action to version 9.0.0.
  - add check if CRS is none if online background flag is true - error
BREAKING CHANGES:

Removed the `plotASCwithWmts` function and the `plotPeaksWithMap.py` file.  This functionality is no longer required.

Improve input file handling: adds 'raster' option to getAndCheckInputFiles

add getInput pytests

feat(in2Trans): readd ascUtils module (addGdalStuff)

This commit readds the `ascUtils` module, which provides
functionality for reading and writing ASCII grid files.
All functions include deprecation warnings, directing users
to the `rasterUtils` module for replacements.

Upgrade twine and install pkginfo before upload

update to com4FlowPy documentation

fixed minor log BUG in runCom4.. + replaces nSkipForestCells with skipForestDist [m]

creation of custom WorkDir - fixed Bug with logfile if workDir doesn't exit a priori

minor re-write of forestFriction part of calc_z_delta()

minor code clean-up

code style

fixed minor log BUG in runCom4.. + replaces nSkipForestCells with skipForestDist [m]

Update docs/moduleCom4FlowPy.rst

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

Update docs/moduleCom4FlowPy.rst

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

Update avaframe/com4FlowPy/flowClass.py

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

Apply suggestions from code review

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

deleted note in moduleCom4FlowPy.rst documentation finle

review suggestion

fixed minor log BUG in runCom4.. + replaces nSkipForestCells with skipForestDist [m]

creation of custom WorkDir - fixed Bug with logfile if workDir doesn't exit a priori

minor code clean-up

code style

fixed minor log BUG in runCom4.. + replaces nSkipForestCells with skipForestDist [m]

creation of custom WorkDir - fixed Bug with logfile if workDir doesn't exit a priori

minor code clean-up

code style

Update docs/moduleCom4FlowPy.rst

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

Update avaframe/com4FlowPy/flowClass.py

Co-authored-by: Paula Spannring <95042192+PaulaSp3@users.noreply.github.com>

deleted note in moduleCom4FlowPy.rst documentation finle

review suggestion

deleted 1 line in runCom4FlowPy.py
@ahuber-bfw ahuber-bfw assigned fso42 and unassigned fso42, PaulaSp3 and ahuber-bfw Feb 11, 2025
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 2769065 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 9.3% (50% is the threshold).

This pull request will bring the total coverage in the repository to 69.2% (0.0% change).

View more on Code Climate.

@fso42
Copy link
Contributor

fso42 commented Feb 12, 2025

Closed in favor of #1087

@fso42 fso42 closed this Feb 12, 2025
fso42 pushed a commit that referenced this pull request Feb 19, 2025
fso42 pushed a commit that referenced this pull request Feb 20, 2025
fso42 pushed a commit that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

confirmed Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants