Skip to content

v1.0.0 Phase 6: Run instead of Logger, model comparison, documentation, release 1.0.0 - #76

Merged
PatrickHenkel1 merged 1 commit into
refactoring_v1.0.0from
v1/phase-6-docs
Nov 6, 2026
Merged

PatrickHenkel1 merged 1 commit into
refactoring_v1.0.0from
v1/phase-6-docs

Conversation

@PatrickHenkel1

Copy link
Copy Markdown
Collaborator

Phase 6 of the 1.0.0 refactoring, the last phase: Run replaces the Logger, models can be compared across several training runs each, the documentation is rewritten and the version is 1.0.0. After this merge, refactoring_v1.0.0 can go to main.

Run instead of the Logger

physXAI.utils.logging is removed (Logger, get_full_path, create_full_path):

  • Run.save(name, prep, model, td) writes everything about a trained model:

    • {name}_preprocessing.json
    • {name}_model.json
    • {name}_training_data.json (metrics, horizon metrics, history)
    • the model file
    • {name}.html (the report)

    It uses the same file layout as AgentLib-MPC; save_for_agentlib now calls it.

  • Saving in pipeline: pipeline / online_pipeline save only with an explicit save_path. There is no default directory anymore. model.trained_model holds the model of the last pipeline.

  • Logging: messages go through the physXAI logger from the standard library.

    • set_log_level('warning') replaces Logger.print_level.
    • The Keras progress bars follow the log level.
    • If the application configures logging itself, the messages are handed to it instead of being printed.
  • Feature selection: save_result(result, run) writes into a run directory.

Model comparison (physXAI.evaluation.comparison)

  • repeat_training(path, prep, model, seeds=5, run=run, name='ann') trains a model with several seeds and saves each run to <run>/<name>/seed_<seed>/.

    • By default the seed changes both the data split and the weight initialization (vary=('split', 'init')).
    • Models trained with the same seeds share the same splits.
  • ModelComparison collects the runs:

    • ModelComparison.load(run.path) treats each sub directory as a model.
    • It also accepts a list of directories, {label: dir}, or training data held in memory.
    • Runs saved by physXAI 0.x can be loaded too.
  • Tables:

    • runs(): seeds, model class, training time.
    • metrics() and horizon().
    • scores(): one row per run.
    • summary(): per model the number of runs, mean, std, min, median and max.
  • The errors over the horizon are compared on the horizon that all runs reach. This makes models with different outputs comparable, e.g. Change(T) against the trajectory of an RNN.

  • Plot:

    • box plots of the single step RMSE, one panel per output (each point is one run);
    • RMSE and bias over the horizon: median and min–max band (or IQR);
    • box plots of the mean RMSE over the horizon and of the RMSE at its end;
    • a summary table.
  • New executables/bestest_hydronic_heat_pump/TAir_compare.py: LinReg, ANN, a modular model with recursive training and an LSTM, 3 seeds each, about 2 min.

    Horizon RMSE reaTZon_y (test, K) mean std min max
    linreg 0.33 0.09 0.24 0.42
    ann 0.30 0.09 0.20 0.37
    modular_recursive 0.26 0.12 0.16 0.39
    rnn 0.29 0.18 0.10 0.47

    The spread across seeds is larger than the differences between the models. With 14 days of BOPTEST data, the test set of each RNN run holds only a single window.

Documentation

  • User guide: getting started, expressions, data pipeline and split, models, multi step evaluation and training, recurrent models, evaluation and comparison, AgentLib-MPC export.
  • Migration guide 0.x → 1.0: a table mapping old to new calls, and TAir_sim_linreg rewritten for 1.0 (vT inside the model with ModularANN(solver='ols'), and the column alternative).
  • API reference for all modules (expr, io, training, splitting, windows, comparison, …). The pages for removed modules are gone.
  • README updated (example, model types, structure).
  • mkdocs build --strict passes. To get there, four docstrings that named parameters missing from their signatures were fixed, and warnings about missing types are switched off.

CI and cleanup

  • New workflow quality.yml: ruff check and mkdocs build --strict for PRs. gh-pages.yml also builds with --strict.
  • Ruff findings fixed in the legacy files (imports, whitespace, an undefined type name, ambiguous names). regression_prototype.py is excluded as experimental.
  • test_coverage.py: each test writes into its own tmp_path run, so the tests no longer depend on each other through the shared Logger directory (26 integrate modular anns #37).
  • Version 1.0.0; CHANGELOG entry [1.0.0] – 2026-11-06.

Tests

  • Unit tests: 134 passed, 1 skipped (the RNN contract test against AgentLib main). New tests:
    • comparison: saving, seeds and splits, loading equals the in-memory runs, summary, plot and saving, a single step model and an RNN on a common horizon, runs of 0.x;
    • Run.save;
    • logging and Keras verbosity.
  • AgentLib-MPC main: the test_physXAI_plugin tests (3 passed) and simple_mpc_nn_physXAI.run_example(testing=True) pass.
  • Executables: all executables, including TAir_compare.py, pass the smoke run. TAir_compare.py also ran with the full number of epochs.

🤖 Generated with Claude Code

…, documentation and release 1.0.0

- Run.save writes configs, metrics, model and report; pipelines save only with an explicit path
- physXAI.utils.logging removed, logging via the 'physXAI' logger (set_log_level)
- physXAI.evaluation.comparison: repeat_training and ModelComparison (distributions over seeds,
  common prediction horizon, box and horizon plots, loads saved runs incl. physXAI 0.x)
- User guide, migration guide and API reference, strict docs build and ruff in CI
- Executables use Run, new TAir_compare.py; version 1.0.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@PatrickHenkel1
PatrickHenkel1 merged commit f09e087 into refactoring_v1.0.0 Nov 6, 2026
59 checks passed
@PatrickHenkel1
PatrickHenkel1 deleted the v1/phase-6-docs branch November 6, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants