Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 9 additions & 3 deletions tools/trame/canop_campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,15 +1385,16 @@ 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)
ids = reset_names(rows)
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:
Expand Down Expand Up @@ -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)
Expand Down
Loading