Repository navigation
Release review 1.0.0: embargo, seeds, shift, unknown arguments, docs - #84
Merged
Merged
Conversation
A training block shorter than gap_steps made apply_embargo purge rows of the neighbouring test or validation block. Rows are now only taken from the run of the purged side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…or AgentLib - shift > 1 gave wrong horizon metrics, recursive training and RNN trajectories. Allowed are 1 (next step, states and interval outputs, AgentLib-MPC) and 0 (algebraic outputs of point sampled data). With shift=0 the output feature must not be an input (also not inside a derived column), no Change outputs, no eval_horizon, no recursive training and no multi step data. - TrainingData stores the shift (saved with save/load). - check_agentlib_compatibility warns about inputs computed by the preprocessing (columns, Change(X), transform), which the MPC has to provide. - TrainingData save/load test covers labels, valid, datetime, loss columns, derived. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- random_seed (and px.RBF random_state) default to the global seed (physXAI.set_seed), else a new seed is drawn and stored in the config. Before, the default 42 overrode set_seed. online_pipeline seeds as well. - Unknown model arguments raise a TypeError; from_config ignores the meta keys of saved configs centrally. test_comparison trained the default network because of a misspelled argument. - Keras single step networks reject several outputs, which were broadcast against their single output neuron. - LinANNModel only fits its linear regression (its evaluation overwrote td), RBF/LinANN take the k-means seed from the model at build time. - RBF construction without normalization, docstrings. - Tests: saved configs of all model classes, monotonicity of CMNN and MonotoneMLP far outside the data, save/load of CMNN, RBF, LinANN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng scripts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- CHANGELOG: example names, model_report path, contradictions between Changed and Removed, entries of this review (seed, shift, unknown arguments, embargo, ...). - Guides: PCNN snippet (td, time column), MonotoneMLP arguments, normalization of blocks, shift and loss_columns options, embargo default, multi step data has no save, feature selection keeps the recursive feature only with criterion='horizon', comparison CLI output, AgentLib-MPC rules (derived inputs, PCNN, branch 143), reproducibility, self-contained snippets. - README: installation order (venv named like the repository), CMNN description, PCNN, project structure. - Example 04: px.Pretrained (model of part B as frozen block) and px.Polynomial. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
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.
… export notice - Upper bounds on the next major versions of all dependencies (keras<4, tensorflow<3, ...); constraints.txt pins the tested versions of all runtime dependencies, the job tested-versions installs them on Linux and Windows. - Extra physXAI[gpu] (tensorflow[and-cuda], Linux / WSL2), documentation of GPU training; set_seed(seed, deterministic=True) enables the deterministic kernels of TensorFlow. - check_agentlib_compatibility warns if the installed AgentLib-MPC cannot load recurrent models; known limitation in the CHANGELOG and the release checklist. - PHYSXAI_REQUIRE_AGENTLIB=1 (set in windows.yml) fails the contract tests instead of skipping them; the model saved with physXAI 0.x is a test fixture. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PatrickHenkel1
added a commit
that referenced
this pull request
Nov 6, 2026
Conflicts: random_seed default None (from #84) next to the shape parameter, CHANGELOG and examples/README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PatrickHenkel1
added a commit
that referenced
this pull request
Nov 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PatrickHenkel1
added a commit
that referenced
this pull request
Nov 7, 2026
Conflict in the dependencies: the bounds of #84 plus scipy>=1.11,<2 (pinned 1.18.1 in constraints.txt). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open
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.
Release review of
refactoring_v1.0.0before the merge intomainand the tag v1.0.0. Architecture, pipeline, models, examples, tests and documentation were checked against each other. The smaller errors are fixed here; larger points are listed at the end as proposals.Fixed errors
gap_steps,apply_embargopurged rows of the neighbouring test or validation block (gap 2:[2,2,2,0,2,2,2]→[2,2,-1,-1,-1,2,2]). This happens with small data sets, wheremin_blocksshortens the blocks. Now only rows of the block at the boundary are purged.physXAI.set_seedhad no effect on the models. All keras models hadrandom_seed=42as default and set it again inprepare(). Nowrandom_seed=Noneresolves to the global seed, otherwise a new seed is drawn and stored in the config (likerandom_stateof the preprocessing). The same holds forpx.RBF(random_state=...)and for the k-means ofRBFModel/LinANNModel. Before, the k-means of these two models ignored the seed thatrepeat_trainingsets.online_pipelinenow seeds as well.SingleStepModel/MultiStepModel.__init__(**kwargs): pass). They now raise aTypeError.from_configdrops the meta keys of saved configs in one place. This also showed a test error:test_comparison.pytrained the default network because ofhidden_layer_size=[4].LinearRegressionModeland RNNs keep supporting several.shiftis now 0 or 1 (decision in the review). Withshift > 1, the horizon metrics, the recursive training and the RNN trajectories were wrong.shift=1(default): states and outputs over the interval[t, t+1), as AgentLib-MPC uses them.shift=0: algebraic outputs of point-sampled data. A leakage guard rejects the output feature as input, also asChange(X)and insidecolumnsexpressions.shift=0allows noChangeoutput, noeval_horizon, no recursive training and no multi step data, and it cannot be exported to AgentLib-MPC.TrainingDatastores the shift.LinANNModelevaluated its linear regression intotd, including a recursive rollout. It is now only fitted..numpy()on a NumPy array.Additions
check_agentlib_compatibilitywarns about inputs that the preprocessing computes (columns,Change(X),transform), because the MPC has to provide them as variables.environment(versions of Python, NumPy, pandas, scikit-learn, Keras, TensorFlow and CasADi). Allfrom_configmethods ignore the key, and AgentLib-MPC reads only known keys.px.Pretrained(the model of part B as a frozen block) plus apx.Polynomialcorrection scaled by apx.Paramthat starts at 0.Tests (+40)
model_from_configfor all 9 model classes, with the meta keys of saved files.CMNNModelandpx.MonotoneMLP: gradient signs at points up to 2× outside the range of the training data. Before, monotonicity was not tested anywhere.shiftvalidation and the leakage guard, plus ashift=0fit.TrainingData.save/loadincluding labels, valid, datetime, loss columns and derived columns.Documentation
Docs and API were compared identifier by identifier. Corrected:
model_report, and contradictions between Changed and Removed (recursive_feature_elimination_pipeline,save_result,ModularModel).tdand notime_index_col.px.MonotoneMLPsignature was wrong: its second positional argument isname.shiftandloss_columnsoptions, and the default of the embargo.TrainingDataMultiStephas nosave.criterion='horizon'.python -m venv physXAIcollided withgit clone.autodoc_inherit_docstrings = False), and'class_name'→'__class_name__'.Verification (Windows, Python 3.12)
PHYSXAI_REQUIRE_AGENTLIB=1 pytest tests: 199 passed, 1 skipped (test_agentlib_rnn: the installed AgentLib-MPC(main) has no RNN support; the saved step model is unchanged by this PR).
constraints.txtresolves on Windows and Linux (pip install --dry-run, Python 3.12).python tests/smoke_examples.py: all 13 examples OK (74 s). Example 04 also ran with full epochs. RMSE of T after 12 h: A 0.353 K, B 0.080 K, D 0.110 K.ruff check physXAI tests examplesandsphinx-apidoc+sphinx-build -W: no findings.Notes for the merge
v1/shape-constraints(Constrained regression as ModularANN(solver='qp') with certified shape constraints #83) changesmodular_ann.py. This PR touches the same file: therandom_seeddefault, a docstring, andfrom_config, which moves toAbstractModel. Mergingrefactoring_v1.0.0into Constrained regression as ModularANN(solver='qp') with certified shape constraints #83 will give a small conflict there. Resolution: dropModularANN.from_config.refactoring_v1.0.0intomainafter physXAI 0.3.0: Python 3.11 - 3.13, dependency versions fixing the security advisories #86 (security pins onmain):requirements.txtgives a modify/delete conflict, resolve by deleting it (1.0 hasconstraints.txt); in the dependency list ofpyproject.tomltake the 1.0 version.pyproject.toml: Constrained regression as ModularANN(solver='qp') with certified shape constraints #83 addsscipy>=1.11to the dependencies, this PR adds upper bounds to the same list. Resolution: keep the bounds and add"scipy>=1.11,<2".set_seed, models no longer use 42 but draw a new seed (stored in the config).Implemented from the review proposals
Dependency bounds:
keras>=3.15.0(older versions are vulnerable when loading models, GitHub advisories; the pins ofconstraints.txtare all patched). Upper bounds on the next major versions (keras<4,tensorflow<3,numpy<3,pandas<4,plotly<8, ...). The CasADi converter of AgentLib-MPC recognises layers by their names and attributes, so a Keras major release could silently break the export.constraints.txtpins all 47 runtime dependencies to the tested versions (pip install . -c constraints.txt). The new jobtested-versionsinwindows.ymlinstalls them and runs the tests on Linux and Windows.GPU: physXAI itself is device-agnostic, but
tensorflowfrom PyPI has no CUDA, and native Windows has no GPU support since TF 2.11. New extraphysXAI[gpu](tensorflow[and-cuda], Linux/WSL2) and a GPU section in Getting started.set_seed(seed, deterministic=True)enablestf.config.experimental.enable_op_determinism()for exactly reproducible runs on a GPU.RNN/PCNN export: the CHANGELOG and the release checklist state it as a known limitation (needs AgentLib-MPC branch
143-feature-multistep-model-support).check_agentlib_compatibilitywarns when the installed AgentLib-MPC cannot load recurrent models.Required contract tests: with
PHYSXAI_REQUIRE_AGENTLIB=1(set inwindows.yml), a missing AgentLib-MPC or plugin fails the contract tests instead of skipping them. Only the RNN tests may still skip, until AgentLib-MPC releases RNN support. The model saved with physXAI 0.x is now versioned as a test fixture (tests/contract/data/legacy_model_0x.keras), sotest_legacy_model_still_loadsruns everywhere.ci.yml(shared template) does not set the variable; the Windows job covers it.Python 3.11–3.13:
constraints.txtpins numpy 2.4.6 and scipy 1.17.1 for Python 3.11, because numpy 2.5 and scipy 1.18 require Python 3.12. Resolution was checked with uv for 3.11, 3.12 and 3.13 on Windows and Linux.tested-versionsruns on 3.11 and 3.13. Python 3.14 needs TensorFlow 2.22, which is only a release candidate so far (noted in Getting started).Still open, fine for 1.0: evaluation as a separate strategy class instead of late imports in
SingleStepModel/MultiStepModel.Notes on #83 (shape constraints)
The findings (undeclared
scipy, certificateexactwithout a check of the corners) are fixed on #83 (verified indc5b36b).🤖 Generated with Claude Code