diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d6a77a..d0e8a30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ The user-visible changes of canoP, by version (see `CONTRIBUTING.md` for the ver (`simulation.cfl`, `amr.max_refine`). - canoP studio: the git repository of a new campaign has its `README.md` in English, and the commits the studio makes there (creation, physics, launch) have English messages. +- canoP studio: a run prepared again (e.g. in a campaign cloned from its git repository) or + relaunched from the Run tab no longer keeps the metrics of its previous launch; those of the new + launch are computed when it finishes. ## 0.1.0 - 2026-11-27 diff --git a/tools/trame/canop_campaign.py b/tools/trame/canop_campaign.py index 4b0b515..74c7125 100644 --- a/tools/trame/canop_campaign.py +++ b/tools/trame/canop_campaign.py @@ -1385,7 +1385,8 @@ def reset_names(rows): def reset_runs(name): """Prepare again the runs submitted without any file; return (ok, message, number). - The record of their launch moves to doc["history"]. + The record of their launch (dates, versions, metrics) moves to doc["history"]: metrics left there + (those of a clone, made elsewhere) would stop project.py from computing those of the new run. """ proj = project(name) _, rows = jobs_table(name) @@ -1393,7 +1394,7 @@ def reset_runs(name): for job_id in ids: job = proj.open_job(id=job_id) doc = _plain(job.doc()) - past = {k: doc[k] for k in ("submitted", "launched", "canop", "physics") if k in doc} + past = {k: doc[k] for k in ("submitted", "launched", "canop", "physics", "metrics") if k in doc} if past: job.doc["history"] = list(_plain(doc.get("history")) or []) + [past] for k in past: @@ -1588,7 +1589,12 @@ def _on_editor_text(ini_text=None, **_): def _clear_outputs(campaign, job, texts): - """Remove the outputs of a previous launch of the run (before relaunching it).""" + """Remove the outputs and the metrics of a previous launch of the run (before relaunching it). + + The metrics of the new launch are computed when it finishes, only if the run has none. + """ + if "metrics" in job.doc: + del job.doc["metrics"] for text in texts: out_dir = os.path.normpath(os.path.join(job.path, core.ini_get(text, "output", "outputDir", "./") or "./")) prefix = core.output_prefix(text, out_dir)