[ana6, com8]: Add ana6Optimisation Module, apply changes in com8MoTPSA#1245
[ana6, com8]: Add ana6Optimisation Module, apply changes in com8MoTPSA#1245RolandFischbacher wants to merge 1 commit intomasterfrom
Conversation
❌ 10 blocking issues (18 total)
@qltysh one-click actions:
|
| # 4) Plot | ||
| x = np.arange(len(df)) | ||
| fig, ax = plt.subplots(figsize=(12, 6)) | ||
| bars = ax.bar( |
| tmp.insert(0, "table", t) | ||
| frames.append(tmp) | ||
| pd.concat(frames, ignore_index=True).to_csv(csv_path, index=False) | ||
|
|
| return f"{x:.2e}" # small numbers in scientific notation | ||
| elif abs(x) < 100: | ||
| return f"{x:.2g}" # 2 significant digits | ||
| else: |
| fig.tight_layout() | ||
|
|
||
| if outpath is not None: | ||
| fig.savefig(outpath, dpi=300, bbox_inches="tight") |
f66f702 to
38e42ca
Compare
| index = config['VISUALISATION']['scenario'] | ||
| if 'sampleMethod' in config['VISUALISATION']: | ||
| sampleMethod = config['VISUALISATION']['sampleMethod'] | ||
| else: |
| @@ -0,0 +1,140 @@ | |||
| # ana6 – Sensitivity Analysis & Optimisation | |||
| 'parameterSet': paramSet, # [row for row in paramSet], # Wrap each row as a list | ||
| 'order': pd.to_numeric(order), # convert to int | ||
| 'sampleMethods': sampleMethods | ||
| }) |
Squash of 20 commits from RF_com8MoTPSA branch including: - com8MoTPSA workflow improvements (chunked multiprocessing, path handling) - Bayesian optimisation integration (ana6Optimisation module) - Morris sensitivity analysis scripts - AIMEC runout reference implementation - probAna pickle saving and bounds - Plotting and config improvements
| error_score="raise" # fail fast if something else is wrong | ||
| ) | ||
|
|
||
| # NOTE: rmse/mae were returned as NEGATIVE numbers because the higher is better internally |
| print(f"📊 sigma: {best_sigma:.4f}") | ||
|
|
||
| return { | ||
| f"TopNBest": { |
| # Delete folder in Work directory after postprocessing to reduce memory costs | ||
| avaDir = cfgMain["MAIN"]["avalancheDir"] | ||
| for sim in simNamesChunk: | ||
| folderName = "Work/com8MoTPSA/" + sim |
|
|
||
| # Postprocess the simulations | ||
| com8MoTPSAPostprocess(simDict, cfgMain, inputSimFiles) | ||
| if returnSimName is not None and simDict: |
|
Coverage Impact ⬇️ Merging this pull request will decrease total coverage on Modified Components (1)
Modified Files with Diff Coverage (2)
🤖 Increase coverage with AI coding...🚦 See full report on Qlty Cloud » 🛟 Help
|
| if modName in ["com1DFA", "com5SnowSlide", "com6RockAvalanche", "com8MoTPSA", "com9MoTVoellmy"]: | ||
| # load dataFrame for all configurations of simulations in avalancheDir | ||
| simDF = cfgUtils.createConfigurationInfo(avalancheDir) | ||
| # create data frame that lists all available simulations and path to their result type result files | ||
| inputsDF, resTypeList = fU.makeSimFromResDF(avalancheDir, "com1DFA") |
There was a problem hiding this comment.
previously "com8MoTPSA" was not in if modName in [...], com1DFA is hard coded, thus not work for com8MoTPSA
removing com8MoTPSA works

This PR introduces a new optimisation module
ana6Optimisationforcom8MoTPSAand updates the simulation workflow.The module ana6Optimisation includes:
New files in ana6Opitmisaton:
runMorrisSA.py(configuration:runMorrisSACfg.ini)runPlotMorrisConvergence.py(usesrunMorrisSACfg.ini)runOptimisation.py(configuration:runOptimisationCfg.ini)optimisationUtils.pyREADME_ana6.md(contains usage instructions)New file in out3Plot:
outAna6Plots.pyChanged workflow of runing com8MoTPSA: