Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ classifiers = [
]
dependencies = [
"pathsim>=0.22",
"pybamm>=25.12",
# PyBaMM ships native code that can't be installed in Pyodide. The
# marker resolves to a normal eager install on every real platform and
# is skipped on Emscripten so the pure-Python parts of the toolbox
# (`pathsim_batt.thermal`) still install in the browser.
"pybamm>=25.12; sys_platform != 'emscripten'",
]

[project.optional-dependencies]
Expand Down
35 changes: 21 additions & 14 deletions src/pathsim_batt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,26 @@
except ImportError:
__version__ = "unknown"

from .cells import (
CellCoSimElectrical,
CellCoSimElectrothermal,
CellElectrical,
CellElectrothermal,
)
from .thermal import LumpedThermal

__all__ = [
"__version__",
"CellElectrical",
"CellElectrothermal",
"CellCoSimElectrical",
"CellCoSimElectrothermal",
"LumpedThermal",
]
__all__ = ["__version__", "LumpedThermal"]

# Cell blocks rely on pybamm (+ its casadi backend), which can't load in
# Pyodide. Re-export them only when the import succeeds; on a normal pip
# install both submodules load eagerly.
try:
from .cells import (
CellCoSimElectrical,
CellCoSimElectrothermal,
CellElectrical,
CellElectrothermal,
)

__all__ += [
"CellElectrical",
"CellElectrothermal",
"CellCoSimElectrical",
"CellCoSimElectrothermal",
]
except ImportError:
pass
Loading