Skip to content

Conversation

@fso42
Copy link
Contributor

@fso42 fso42 commented Dec 23, 2025

Currently, simulation names follow the format:

relNameSim_simHash_defID_frictIndi_simType_modelType

This format lacks information about which computational module generated the simulation, making it difficult to:

  • Track simulations across multiple computational modules
  • Distinguish simulations from different modules with identical parameters
  • Support multi-module workflows and comparisons

New Format

Add modName as the third component:

relNameSim_simHash_modName_defID_frictIndi_simType_modelType

Example:

  • Old: release1_a1b2c3_C_S_ent_dfa
  • New: release1_a1b2c3_com1DFA_C_S_ent_dfa

Backward Compatibility

Implement a centralized parser that:

  • Automatically detects old vs new format
  • Returns structured dictionary instead of position-based arrays
  • Provides sensible defaults for missing components
  • Handles both simName and full filenames (with resType/timeStep)

@fso42 fso42 self-assigned this Dec 23, 2025
@fso42 fso42 added the enhancement New feature or request label Dec 23, 2025
@qltysh
Copy link
Contributor

qltysh bot commented Dec 23, 2025

Qlty

Coverage Impact

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

Modified Components (1)

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

Modified Files with Diff Coverage (10)

RatingFile% DiffUncovered Line #s
Coverage rating: D Coverage rating: C
avaframe/ana5Utils/DFAPathGeneration.py0.0%693
Coverage rating: B Coverage rating: B
avaframe/com1DFA/com1DFA.py100.0%
Coverage rating: B Coverage rating: B
avaframe/ana4Stats/probAna.py100.0%
Coverage rating: B Coverage rating: B
avaframe/in3Utils/fileHandlerUtils.py100.0%
Coverage rating: B Coverage rating: B
avaframe/ana3AIMEC/dfa2Aimec.py100.0%
Coverage rating: A Coverage rating: A
avaframe/in3Utils/cfgUtils.py100.0%
Coverage rating: F Coverage rating: F
avaframe/ana1Tests/rotationTest.py33.3%67-123
Coverage rating: B Coverage rating: B
avaframe/log2Report/generateReport.py100.0%
Coverage rating: A Coverage rating: A
avaframe/com1DFA/com1DFATools.py100.0%
Coverage rating: B Coverage rating: B
avaframe/out1Peak/outPlotAllPeak.py100.0%
Total97.6%
🤖 Increase coverage with AI coding...

In the `addModuleToName` branch, add test coverage for this new code:

- `avaframe/ana1Tests/rotationTest.py` -- Line 67-123
- `avaframe/ana5Utils/DFAPathGeneration.py` -- Line 693

🚦 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 requested a review from awirb December 23, 2025 11:00
@fso42 fso42 linked an issue Dec 23, 2025 that may be closed by this pull request
8 tasks
@qltysh
Copy link
Contributor

qltysh bot commented Dec 23, 2025

❌ 3 blocking issues (4 total)

Tool Category Rule Count
black Style Incorrect formatting, autoformat by running qlty fmt. 3
qlty Duplication Found 16 lines of similar code in 3 locations (mass = 117) 1

@qltysh one-click actions:

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

@fso42 fso42 requested a review from awirb January 8, 2026 08:59
fso42 and others added 5 commits January 8, 2026 13:49
…imName`

- Integrated `cfgUtils.parseSimName` to simplify extraction of simulation components across old and new formats.
- Unified reconstruction logic for `simName` using parsed components and removed redundant conditions.
- Updated corresponding logic in dataframe population to use parsed results for consistency.
- Added extensive unit tests in `cfgUtils` to validate `parseSimName` functionality across different naming conventions and edge cases.
- Minor refactors in test cases and `com1DFA` to align with new parsing logic.

refactor(cfgUtils): streamline `parseSimName` to extract short module names

- Updated `parseSimName` to extract short module names (e.g., "com1" instead of "com1DFA").
- Refactored multiple files to consistently use parsed components, replacing manual string parsing.
- Modified tests to cover enhanced `parseSimName` behavior, removing dependency on legacy module patterns.
…odule name addition

- Updated `cfgUtils` docstring with details about new and old simulation name formats, including components and structure.
- Revised `com1DFA` documentation to reflect the addition of the short module name (`com1`) to simulation names
- Noted backward compatibility with older naming conventions.

refactor(fileHandlerUtils): replace `parsed` with `simNameParts`

- Renamed variable `parsed` to `simNameParts`

refactor(dfa2Aimec): simplify mass balance file sorting with lambda function
- Adjusted simulation name structure in docstrings and parsing logic
- Updated examples for old and new formats to remove redundant brackets around `defID`.

test(ana1Tests): add unit tests for `rotationTest` initialization

- Added tests for `initializeRotationTestReport`, verifying report structure and columns.
- Included test cases for mass-related columns when `flagMass` is enabled or disabled.

test(DFAPathGeneration): add unit tests for split point and mass-averaged path generation

- Added `test_getSplitPoint_noPointFound` to validate behavior when no split point meets criteria.
- Added `test_getMassAvgPathFromFields` to test mass-averaged path computation, including velocity and energy fields.
- Added `test_getMassAvgPathFromFields_noVelocity` to cover cases without velocity data.

test(DFAPathGeneration): replace `== True` with `is True` in test assertion
…xtraction

- Introduced `getModuleNames` function to dynamically extract full and shortened module names based on the call stack.

chore(pyproject): add `build`, `clean`, and `rebuild` tasks

- Added custom `build`, `clean`, and `rebuild` tasks

feat(out1Peak, com1DFA, ana4Stats): extend module support and refactor for readability

- Added support for `com5SnowSlide` and `com6RockAvalanche` modules across several workflows, including DEM handling, filtering simulations, and post-processing tasks.

add(tests) add pytests for getModuleNames

fix(com1DFA): handle `com7Regional` as a special case for module name extraction

- Added a condition to treat `com7Regional` as `com1DFA` during module name extraction
refactor(core): apply black formatting

feat(out1Peak, ana4Stats): add `com8MoTPSA` and `com9MoTVoellmy` module support

- Extended support for `com8MoTPSA` and `com9MoTVoellmy` across workflows, including DEM handling, simulation filtering, and result file processing.
@fso42
Copy link
Contributor Author

fso42 commented Jan 9, 2026

Standardtests ident

@fso42 fso42 merged commit d847bb6 into master Jan 9, 2026
4 checks passed
@fso42 fso42 deleted the addModuleToName branch January 9, 2026 07:35
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.

Breaking Change: Adding Module Name to SimName Breaks Parsing Logic

3 participants