Skip to content

[com6]: add support for spatialVoellmy friction model - #1312

Open
fso42 wants to merge 5 commits into
masterfrom
addSpatialToCom6
Open

[com6]: add support for spatialVoellmy friction model#1312
fso42 wants to merge 5 commits into
masterfrom
addSpatialToCom6

Conversation

@fso42

@fso42 fso42 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
  • Add --friction_calibration flag to runCom6RockAvalanche.py (voellmy | spatialVoellmy)
  • Auto-generate mu/xi rasters from *_spatialVoellmy.shp when spatialVoellmy selected
  • Fill default values from rock avalanche Voellmy config (mu=0.035, xi=700)
  • Error if rasters and shapefile both present (ambiguous)
  • Consolidate two-shapefile input (*_mu.shp / *_xsi.shp) into single *_spatialVoellmy.shp with
    mu and xsi attributes across spatialVoellmyInputs and runSpatialVoellmyInputs
  • Update tests and docs

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)

@fso42 fso42 self-assigned this Jul 8, 2026
@fso42 fso42 added the enhancement New feature or request label Jul 8, 2026
@qltysh

qltysh Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Qlty


Coverage Impact

This PR will not change total coverage.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
Coverage rating: A Coverage rating: A
avaframe/in3Utils/spatialVoellmyInputs.py89.5%49, 88
Total89.5%
🤖 Increase coverage with AI coding...
In the `addSpatialToCom6` branch, add test coverage for this new code:

- `avaframe/in3Utils/spatialVoellmyInputs.py` -- Lines 49 and 88

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

… model

- Introduced a `calibration` parameter to select between `voellmy` or `spatialVoellmy` friction models.
- Added error handling for ambiguous or missing inputs.
- Updated CLI parser to include a new `--friction_calibration` argument.
@fso42
fso42 force-pushed the addSpatialToCom6 branch from bc8725d to 206f602 Compare July 9, 2026 06:28
…ngle input

- Combined separate `mu` and `xsi` shapefiles into a single `*_spatialVoellmy.shp` containing both fields.
- Updated error handling to validate the presence of required fields (`mu` and `xsi`) in the single shapefile.
@qltysh

qltysh Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Analysis for project AvaFrame

❌ 1 blocking issue (1 total)

Tool Category Rule Count
black Style Incorrect formatting, autoformat by running qlty fmt. 1

@qltysh one-click actions:

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

… input

- Revised documentation to reflect the use of a single shapefile containing `mu` and `xsi` attributes.
@fso42 fso42 changed the title feat(runCom6RockAvalanche): add support for spatialVoellmy friction model [com6]: add support for spatialVoellmy friction model Jul 9, 2026
@fso42
fso42 requested a review from awirb July 9, 2026 11:57

@awirb awirb 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.

if *_mu.asc and *_xi.asc available in Inputs/RASTERS no error is raised (when using runScripts/runSpatialVoellmy) and also files are overwritten if already there with same name

- Added validation to prevent overwriting existing raster output files by checking their existence before writing (`muOut` and `xiOut`).
@fso42
fso42 requested a review from awirb July 15, 2026 08:23
- Replaced all occurrences of `xsi` with `xi` in function names, variables, comments, and tests for consistency.
- Updated configuration files, documentation, and error messages to reflect this change.
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.

2 participants