Repository navigation
Bring rubem calibrate to parity with the previous calibration workflow - #350
Closed
soaressgabriel wants to merge 6 commits into
Closed
soaressgabriel wants to merge 6 commits into
soaressgabriel wants to merge 6 commits into
Conversation
decision_space(fixed, bounds) builds the vector the search runs on: a fixed parameter leaves the vector and is re-inserted in the nine parameters every candidate runs with; a per-run bound may only narrow the range of the application settings; fixing one weight narrows the other so the derived w_3 stays in range and drops the pair constraint, a narrowing that leaves it one value fixes it as well, and fixing both weights checks w_3 before the search. The module-level helpers become thin wrappers over the default space.
…y station Every model output is a non-negative flux or storage, so a negative observed value is a gap. A ';' table without the "0;<id>;..." header and a PCRaster time series without its header are refused naming the two accepted layouts, instead of numbering columns by position; a byte order mark is ignored. StationMetrics gives, per shared station, the valid pairs, the means and standard deviations of both series, the Pearson correlation, the RMSE and the NSE, and evaluate_series averages the NSE over a chosen selection of stations while measuring the others.
…libration The run directory receives observed.csv before the search (per station the selection, the pairs in the compared window, the dropped values and the summary statistics) and, after it, stations.csv with the winner's per-station metrics and best_<variable>.csv with its simulated series beside the observed one, from one more run of the best candidate in the pool. Every record carries started_at and station_metrics, the table the started_at column. The budget line, one line per generation with the best objective and NSE, and the final summary go through the rubem.progress logger the command line prints. An interrupted or failed search still consolidates evaluations.csv, and a worker killed by the system is reported with the advice to lower the number of workers. The decision space travels to the workers in the evaluation context.
…n the command line --bound NAME=MIN:MAX and --fix NAME=VALUE, repeatable and refused with the expected spelling when malformed, --stations ID[,ID...], --init, --strategy and --polish/--no-polish reach the calibration settings; the closing summary lists every artifact of the run.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/345-calibration-docs #350 +/- ##
=============================================================
+ Coverage 92.58% 92.96% +0.38%
=============================================================
Files 65 65
Lines 4573 4935 +362
Branches 557 617 +60
=============================================================
+ Hits 4234 4588 +354
- Misses 270 275 +5
- Partials 69 72 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4 tasks done
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Description
Stacked on #346 (base
feat/345-calibration-docs).rubem/calibration/parameters.py):DecisionSpacebuilt bydecision_space(fixed, bounds); a fixed parameter leaves the decision vector and is re-inserted in the nine emitted parameters; a per-run bound may only narrow the range ofappsettings.json(refused otherwise, naming both ranges); fixing one ofw_1/w_2narrows the other so the derivedw_3stays in range and drops the linear constraint, fixing both checksw_3; a narrowing that collapses a weight to a point moves it into the fixed set, so the announced dimension and budget describe the real search. The population size,x0, the constraint positions and the explicitinitwidth follow the space;result.jsonrecords the effective bounds, the fixed values and the stations.--bound NAME=MIN:MAXand--fix NAME=VALUE(repeatable, malformed forms refused with the expected spelling),--stations ID[,ID...],--init(sobol,latinhypercube,halton,random),--strategy,--polish/--no-polish; the closing summary lists every artifact.objective.py): negative values are gaps (every model output is a non-negative flux or storage); a;table without the0;<id>;...header and a PCRaster time series without its header are refused naming the two accepted layouts (no head-less numbering); a byte order mark is ignored.StationMetrics(pairs, mean and standard deviation of both series, Pearsonr, RMSE, NSE) per shared station;evaluate_series(..., stations=...)averages the NSE over the selected stations and still measures the others.runner.py,_worker.py):observed.csv(per station: selection, pairs in the compared window, dropped values, mean, std, min, max) and the coverage of the compared window logged before the search; every evaluation record carriesstarted_at(UTC) andstation_metrics; after the search the best candidate is run once more in the pool to writebest_<variable>.csv(step, observed and simulated per shared station) andstations.csv(the per-station metrics of the winner);evaluations.csvgainsstarted_at; an interrupted or failed search still consolidatesevaluations.csv; a worker killed by the system is reported with the advice to lower--workers.rubem.progresslogger the command line routes to standard output, asrubem rundoes.pointstation, the reported best is an evaluated candidate, budget withNfree parameters, memory per worker, where the winner's per-station efficiency is); the user guide's help block is regenerated from the command.Related Issue
Motivation and context
Left as design notes in the code: a
BrokenProcessPoolin the final re-run of the best candidate is reported without the--workersadvice (that pool runs one task); the per-generation progress re-reads the records (negligible beside the model runs).How has this been tested
python -m pytest -q -p no:cacheprovider --ignore=tests/integration/doc -n 2: 1445 passed, 2 skipped (Linux, Python 3.13, PCRaster 4.4.2, SciPy 1.18.1). Every numeric expectation was re-derived by hand a second time (mask table,StationMetricson a concrete pair, bounds narrowing, constraint positions after removing a dimension, round trips); mutation checks (record withoutstation_metrics, constraint kept with a fixed weight, mask accepting negatives) are caught.--fix x=0 --bound alpha=1:10 --stations 1 --init latinhypercube(7 free parameters, 35 members, artifacts consistent:stations.csvrecomputed frombest_arn.csvbit for bit).RUBEM_DATASET_DIR=<local datasets> python -m pytest tests/dataset: the Ipojuca smoke passes with the extra re-run of the best candidate.uvx ruff@0.16.4 format --check .anduvx ruff@0.16.4 check .: clean.sphinx-build -W -b html doc/sourcewith the documentation's Python 3.13 environment: no warnings.Screenshots