[in3,com8,ana3] Add multi-layer result support; breaking change in com8#1236
[in3,com8,ana3] Add multi-layer result support; breaking change in com8#1236
Conversation
…t in filename parsing and data handling - `fileHandlerUtils.makeSimFromResDF` handle multi-layer result files with layer-suffixed column names. - Updated `cfgUtils.parseSimName` to recognize and parse layer components (`L1`, `L2`, etc.) in filenames.
…g logic - Introduced `layers` configuration for specifying simulation output layers (L1: dense flow, L2: powder snow). - Added `copyRawToLayerPeakFiles` function
- Introduced `runoutLayer` configuration for multi-layer analysis in `ana3AIMECCfg.ini`. - Updated `checkAIMECinputs` to resolve base resType names to layer-suffixed columns. - Refactored functions and logic to error out if multi-layer data is detected without a `runoutLayer`.
❌ 2 blocking issues (4 total)
@qltysh one-click actions:
|
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on Modified Files with Diff Coverage (6)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
| c=cmap3.to_rgba(cmapVal), | ||
| label=resAnalysisRow[varParList[0]], | ||
| ) | ||
| else: |
| baseRunoutResType = inputs.get('baseRunoutResType', runoutResType) | ||
| displayRunoutResType = inputs.get('displayRunoutResType', runoutResType) | ||
| unit = pU.cfgPlotUtils['unit' + baseRunoutResType] | ||
| name = pU.cfgPlotUtils['name' + baseRunoutResType] |
- Added support for resolving base `resType` to layer-suffixed columns in multi-layer simulations using the new `resolveResTypeColumn` function. - Introduced `computeBaseResTypeList` to validate and compute base `resType` names available for all simulations. - Updated `checkAIMECinputs` function to handle both single-layer and multi-layer simulations, with input validation and error handling when `runoutLayer` is not configured.
| dataframe with for each simulation, the full file path, file name, release area scenario, | ||
| simulation type (null, entres, etc.), model type (dfa, ref, etc.), simID, | ||
| path to result files (ppr, pft, etc.), simulation name, | ||
| cell size and optional name of avalanche, optional time step |
| ---------- | ||
| workDir : pathlib.Path | ||
| simulation work directory containing raw MoT-PSA output files | ||
| simType : str |
There was a problem hiding this comment.
why is the simType here provided, couldn't this be done for all the simTypes as this is part of the raw output file names already no?
| Parameters | ||
| ---------- | ||
| row : pandas Series | ||
| a row from inputsDF or resAnalysisDF |
There was a problem hiding this comment.
consider adding what these dataframes contain - dataFrame organized one row per simulation providing info on the simulation, available result files and optional configuration
| if cfgSetup['resTypes'] != '': | ||
| # required res types | ||
| resTypesWanted = cfgSetup['resTypes'].split('|') | ||
| runoutLayer = cfgSetup.get("runoutLayer", "") |
There was a problem hiding this comment.
is this used if runoutLayer not exisiting in cfg file - so for backwards compatibility?
| # compute base resType names available for all sims | ||
| baseResTypeList = computeBaseResTypeList(inputsDF, runoutLayer) | ||
|
|
||
| # determine what we want (base names from config) |
There was a problem hiding this comment.
| # determine what we want (base names from config) | |
| # determine base resTypes used for analysis, if not provided in aimec cfg take base res types available for all sims | |
| runoutResType = pathDict.get('runoutResType', cfgSetup['runoutResType']) | ||
| resAnalysisDF = aimecTools.computeRunOut(cfgSetup, rasterTransfo, resAnalysisDF, newRasters, simRowHash, | ||
| runoutResType=runoutResType) | ||
| runoutLine = aimecTools.computeRunoutLine(cfgSetup, rasterTransfo, newRasters, simRowHash, 'simulation', name='', |
There was a problem hiding this comment.
why is the runoutRestType a new argument in these functions, in there the same thing happens as in line 396 - if not provided take the one found in cfgSetup - why is it needed to be introduced as arguments in the functions if this check happens outside already?

Breaking change:
com8MoTPSA output filenames changed. Previously they used the dfa/psa modelType workaround, now they use L1/L2
layer naming. Anyone with existing com8MoTPSA results or scripts that parse the old filenames will be affected.