Compare two saved OSMOSE scenario JSON files, highlighting parameter differences and their scientific impact
Compare two OSMOSE scenarios and explain the scientific implications of their differences.
a: name or path of the first scenariob: name or path of the second scenariostorage (optional): scenario storage directory (default: data/scenarios/)Run from /home/razinka/osmose/osmose-python/
Load and compare scenarios using the built-in ScenarioManager:
.venv/bin/python -c "
from pathlib import Path
from osmose.scenarios import ScenarioManager
mgr = ScenarioManager(Path('{storage}'))
diffs = mgr.compare('{a}', '{b}')
for d in diffs:
marker = '<' if d.value_b is None else ('>' if d.value_a is None else '~')
print(f'{marker} {d.key}: {d.value_a} -> {d.value_b}')
print(f'Total differences: {len(diffs)}')
"
Categorize differences by process domain:
grid.*, map.* — affects spatial distributionspecies.*, growth.*, predation.* — affects population dynamicsmortality.*, fishing.* — affects survival ratesreproduction.*, egg.* — affects recruitmentmovement.* — affects spatial connectivitysimulation.*, output.* — affects run configurationcalibration in the keyAssess scientific impact for each category:
Report in this format:
| Category | Key | {a} | {b} | Impact |
|---|---|---|---|---|
| Species biology | species.linf.sp0 | 20.5 | 22.0 | HIGH — changes asymptotic length |
Summary: X parameters differ across Y categories. Z are high-impact changes that will significantly affect simulation outputs.
.venv/bin/python, never system python/home/razinka/osmose/osmose-python/