Skip to content

Track upstream PyBaMM fixes, towards an empty compat/ #39

Open

Description

@brosaplanella

Tracker for the PyBaMM changes PyTES depends on. Goal: an empty src/pytes/compat/, with each workaround removed once its fix is in the supported PyBaMM range (DESIGN D16), plus the upstream items that need no shim but limit PyTES.

Not every item is a PyBaMM bug: some are features that PyTES can contribute upstream instead of waiting for them. Whatever remains at 1.0 is decided in #28. Gaps found by the interoperability check (#29) are added here.

Last checked 2026-11-01, PyBaMM 26.10.1.1 (latest release, 2026-10-20).

Workarounds in compat

Shim Problem Upstream Removal condition (from the shim)
compat/upwind.py upwind/downwind take the inflow from the ghost point 2 T_bc - T_1, so fluid colder than the inlet can flow in pybamm-team/PyBaMM#5860 (open); fix in pybamm-team/PyBaMM#5861 (open, waits for pybamm-team/PyBaMM#5524) Upwinding uses the Dirichlet value itself as the inflow value
compat/advection.py pybamm.upwind is first order, which smears thermal fronts (#7) pybamm-team/PyBaMM#3526, PR #3979 (earlier work); no issue for a limited scheme yet PyBaMM's finite volumes offer a limited upwind scheme. Candidate to contribute: LimitedFiniteVolume (MUSCL, van Albada) already exists here. Builds on #5860.
compat/coupled.py CoupledVariables are resolved only with resolve_coupled_variables=True; the default fails with a misleading error Default: not filed (draft ready). Prerequisite: pybamm-team/PyBaMM#6001 (open), fixed by pybamm-team/PyBaMM#6002 (open): with the option on, a CoupledVariable in a boundary condition is not resolved, and inplace=False still modifies the input model Resolution is the default in pybamm.Discretisation and everything that builds one

compat/solution.py: removed in #54 (F-057). The runner now matches step solutions to steps by position, as PyBaMM does, so it no longer attaches step descriptions to pybamm.Solution. The Solution metadata request is withdrawn.

Upstream items with no shim (yet)

Item Upstream Effect on PyTES
Citation databases for downstream packages pybamm-team/PyBaMM#5950 (open) pybamm.print_citations() drops the PyTES parameter sources. A compat/citations.py shim is planned, tagged with this issue
QuickPlot ignores matplotlib's colour cycle pybamm-team/PyBaMM#5951, fixed by pybamm-team/PyBaMM#5953 (merged 2026-10-29, not yet released) No shim; pass colors=. From the next PyBaMM release, a customised axes.prop_cycle reaches QuickPlot
Package defaults for QuickPlot: style and options not filed (draft ready); a follow-up to pybamm-team/PyBaMM#5953, now unblocked A package cannot set how QuickPlot shows its models. Every PyTES notebook passes spatial_unit="m" (PyBaMM's default is micrometres) and a time unit (the automatic one never picks minutes), and the PyTES colours (#43) can be the default only by changing matplotlib's global rcParams. Proposal: a pybamm_plot_defaults entry point (beside pybamm_parameter_sets and pybamm_models) returning a style (rcParams) and QuickPlot options; PyBaMM's own values become the "pybamm" defaults instead of being hard-coded; the first model's package is found through its class's MRO; passed arguments win, and the user's rcParams win key by key. Also to discuss: which defaults belong to a package and which to a model, more units (cm, days), smarter automatic units
Boundary values of edge-defined variables pybamm-team/PyBaMM#5094 (open) Would let a coupling impose a face flux directly. The ledger (D6) stays exact either way; this may become an option if measurably faster
A hook for renamed variable and parameter names not filed Needed to deprecate variable and parameter names (DESIGN §3, issue #17): PyBaMM looks names up itself (FuzzyDict, dict.get in solutions)
Experiments on non-battery models pybamm-team/PyBaMM#6013 (open), fixed by pybamm-team/PyBaMM#6014 (open) pybamm.Experiment fails on a model without summary_variables, then silently ignores steps on a model that does not read "Current function [A]". Step 1 towards running PyTES experiments on PyBaMM's own runner
Experiment steps that drive any parameter pybamm-team/PyBaMM#6015 (open), implemented in pybamm-team/PyBaMM#6016 (open; builds on #6014) Steps can only drive the battery current. With controls per step and a generic ControlStep, PyBaMM's unified mode could drive a heat battery's inlet temperature and mass flow rate. Step 2: the goal is to retire the PyTES runner (D10). PyBaMM roadmap area #5103 is related
Experiment steps with long drive cycles collide pybamm-team/PyBaMM#6017 (open) Steps are keyed by their text, which numpy shortens beyond 1000 entries, so two long drive cycles that differ only in the middle become the same step. Would affect PyTES time-series steps once they run on PyBaMM's runner

Tasks

  • File the coupled-variables default issue (draft in the gitignored docs/upstream/), after #6002, and tag compat/coupled.py with its number
  • File the Solution metadata request and tag compat/solution.py: not needed, the shim is removed (Match experiment step solutions to steps by position #54, F-057)
  • After #5950 is settled, add compat/citations.py, tagged with it
  • Draft the higher-order upwinding issue (after #5860), offering LimitedFiniteVolume
  • Decide whether to file the rename hook before the name deprecations are needed
  • Now that #5953 has merged, open the PyBaMM issue or PR for package QuickPlot defaults (draft in the gitignored docs/upstream/); then PyTES registers its colours and units through the entry point (Adopt the PyTES Thermal colour cycle and the ember colourmap in pytes.plotting #43) and the notebooks drop spatial_unit="m"
  • Once #6014 and #6016 are released, evaluate moving pytes.experiments onto PyBaMM's runner (D10)
  • Remove each shim when its condition is met in the supported PyBaMM range (oldest release in the 3-month window, see CI job against the oldest supported PyBaMM release (from December 2026) #8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions