Skip to content

Commit 1a835a4

Browse files
authored
Merge branch 'develop' into telemetry
2 parents 8d1e192 + e52a406 commit 1a835a4

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121

2222
## Bug Fixes
2323

24+
- Disabled IREE on MacOS due to compatibility issues and added the CasADI
25+
path to the environment to resolve issues on MacOS and Linux. Windows
26+
users may still experience issues with interpolation. ([#4528](https://github.com/pybamm-team/PyBaMM/pull/4528))
2427
- Added `_from_json()` functionality to `Sign` which was erroneously omitted previously. ([#4517](https://github.com/pybamm-team/PyBaMM/pull/4517))
2528
- Fixed bug where IDAKLU solver failed when `output variables` were specified and an extrapolation event is present. ([#4440](https://github.com/pybamm-team/PyBaMM/pull/4440))
2629

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ Editable notebooks are made available using [Google Colab](https://colab.researc
468468

469469
GitHub does some magic with particular filenames. In particular:
470470

471-
- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/PyBaMM) displays the contents of [README.md](https://github.com/pybamm-team/PyBaMM/blob/develop/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
472-
- The license for using PyBaMM is stored in [LICENSE](https://github.com/pybamm-team/PyBaMM/blob/develop/LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
471+
- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/PyBaMM) displays the contents of [README.md](https://github.com/pybamm-team/PyBaMM/blob/develop/README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://docs.github.com/articles/about-readmes/).
472+
- The license for using PyBaMM is stored in [LICENSE](https://github.com/pybamm-team/PyBaMM/blob/develop/LICENSE.txt), and [automatically](https://docs.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
473473
- This file, [CONTRIBUTING.md](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.
474474

475475
## Acknowledgements

noxfile.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
import sys
44
import warnings
5-
import platform
65
from pathlib import Path
76

87

@@ -27,28 +26,15 @@ def set_iree_state():
2726
"""
2827
state = "ON" if os.getenv("PYBAMM_IDAKLU_EXPR_IREE", "OFF") == "ON" else "OFF"
2928
if state == "ON":
30-
if sys.platform == "win32":
29+
if sys.platform == "win32" or sys.platform == "darwin":
3130
warnings.warn(
3231
(
33-
"IREE is not enabled on Windows yet. "
32+
"IREE is not enabled on Windows and MacOS. "
3433
"Setting PYBAMM_IDAKLU_EXPR_IREE=OFF."
3534
),
3635
stacklevel=2,
3736
)
3837
return "OFF"
39-
if sys.platform == "darwin":
40-
# iree-compiler is currently only available as a wheel on macOS 13 (or
41-
# higher) and Python version 3.11
42-
mac_ver = int(platform.mac_ver()[0].split(".")[0])
43-
if (not sys.version_info[:2] == (3, 11)) or mac_ver < 14:
44-
warnings.warn(
45-
(
46-
"IREE is only supported on MacOS 13 (or higher) and Python"
47-
"version 3.11. Setting PYBAMM_IDAKLU_EXPR_IREE=OFF."
48-
),
49-
stacklevel=2,
50-
)
51-
return "OFF"
5238
return state
5339

5440

src/pybamm/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import sys
2-
31
from pybamm.version import __version__
42

53
# Demote expressions to 32-bit floats/ints - option used for IDAKLU-MLIR compilation
@@ -201,8 +199,11 @@
201199
# Pybamm Data manager using pooch
202200
from .pybamm_data import DataLoader
203201

204-
# Remove any imported modules, so we don't expose them as part of pybamm
205-
del sys
202+
# Fix Casadi import
203+
import os
204+
import pathlib
205+
import sysconfig
206+
os.environ["CASADIPATH"] = str(pathlib.Path(sysconfig.get_path('purelib')) / 'casadi')
206207

207208
__all__ = [
208209
"batch_study",

0 commit comments

Comments
 (0)