Skip to content

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

Merged
fso42 merged 2 commits into
masterfrom
addSpatialToCom6
Aug 12, 2026
Merged

[com6]: add support for spatialVoellmy friction model#1312
fso42 merged 2 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.

@fso42
fso42 force-pushed the addSpatialToCom6 branch from bc8725d to 206f602 Compare July 9, 2026 06:28
@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)

@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

@fso42
fso42 requested a review from awirb July 15, 2026 08:23
@fso42
fso42 force-pushed the addSpatialToCom6 branch from b22c6c9 to cfe8362 Compare August 12, 2026 12:26
fso42 added 2 commits August 12, 2026 14:30
… 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.

feat(spatialVoellmyInputs): unify `mu` and `xsi` shapefiles into a single 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.

docs(spatialVoellmyInputs): update instructions for unified shapefile input

- Revised documentation to reflect the use of a single shapefile containing `mu` and `xsi` attributes.

feat(spatialVoellmyInputs): add check for existing output files

- Added validation to prevent overwriting existing raster output files by checking their existence before writing (`muOut` and `xiOut`).
- 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.
@fso42
fso42 force-pushed the addSpatialToCom6 branch from cfe8362 to e2d559a Compare August 12, 2026 12:30
@fso42

fso42 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Standard tests ok, apart from known hof

@fso42
fso42 merged commit 5b46391 into master Aug 12, 2026
5 of 7 checks passed
@fso42
fso42 deleted the addSpatialToCom6 branch August 12, 2026 12:49
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