Skip to content

Commit

Permalink
Release v0.0.5 (#15)
Browse files Browse the repository at this point in the history
* Update version

* Attempt to use brew instead

* Try removing arm logic

* Switch deployment target

* Try ignoring version

* Put version back

* Update code to match pybamm

* Update submodule url (#21)

* Revert a change

* Update docs
  • Loading branch information
kratman authored Jan 8, 2025
1 parent e3b7e10 commit cf288c3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ jobs:
export SDKROOT=${SDKROOT:-$(xcrun --show-sdk-path)}
# Can't download LLVM-OpenMP directly, use conda/mamba and set environment variables
# Can't download LLVM-OpenMP directly, use conda and set environment variables
brew install miniforge
mamba create -n pybammsolvers-dev $OPENMP_URL
conda create -n pybammsolvers-dev $OPENMP_URL
if [[ $(uname -m) == "x86_64" ]]; then
PREFIX="/usr/local/Caskroom/miniforge/base/envs/pybammsolvers-dev"
elif [[ $(uname -m) == "arm64" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "pybind11"]
path = pybind11
url = git@github.com:pybind/pybind11.git
url = https://github.com/pybind/pybind11.git
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
# IDAKLU solver

Standalone repository for the IDAKLU solver used in PyBaMM
Standalone repository for the C/C++ solvers used in PyBaMM

## Installation

```bash
pip install pybammsolvers
```

## Solvers

The following solvers are available:
- PyBaMM's IDAKLU solver

## Local builds

For testing new solvers and unsupported architectures, local builds are possible.

### Nox

Nox can be used to do a quick build:
```bash
pip install nox
nox
```
This will setup an environment and attempt to build the library.

### MacOS

Mac dependencies can be installed using brew
```bash
brew install libomp
brew reinstall gcc
python install_KLU_Sundials.py
pip install .
```

### Linux

Linux installs may vary based on the distribution, however, the basic build can
be performed with the following commands:
```bash
sudo apt-get libopenblas-dev gcc gfortran make g++ build-essential
pip install cmake casadi setuptools wheel
python install_KLU_Sundials.py
pip install .
```
3 changes: 3 additions & 0 deletions src/pybammsolvers/idaklu_source/IDAKLUSolverOpenMP.inl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ void IDAKLUSolverOpenMP<ExprSet>::SetSolverOptions() {
// Initial step size
CheckErrors(IDASetInitStep(ida_mem, solver_opts.dt_init));

// Minimum absolute step size
CheckErrors(IDASetMinStep(ida_mem, solver_opts.dt_min));

// Maximum absolute step size
CheckErrors(IDASetMaxStep(ida_mem, solver_opts.dt_max));

Expand Down
1 change: 1 addition & 0 deletions src/pybammsolvers/idaklu_source/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ SolverOptions::SolverOptions(py::dict &py_opts)
max_order_bdf(py_opts["max_order_bdf"].cast<int>()),
max_num_steps(py_opts["max_num_steps"].cast<int>()),
dt_init(RCONST(py_opts["dt_init"].cast<double>())),
dt_min(RCONST(py_opts["dt_min"].cast<double>())),
dt_max(RCONST(py_opts["dt_max"].cast<double>())),
max_error_test_failures(py_opts["max_error_test_failures"].cast<int>()),
max_nonlinear_iterations(py_opts["max_nonlinear_iterations"].cast<int>()),
Expand Down
1 change: 1 addition & 0 deletions src/pybammsolvers/idaklu_source/Options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct SolverOptions {
int max_order_bdf;
int max_num_steps;
double dt_init;
double dt_min;
double dt_max;
int max_error_test_failures;
int max_nonlinear_iterations;
Expand Down
2 changes: 1 addition & 1 deletion src/pybammsolvers/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.4"
__version__ = "0.0.5"

0 comments on commit cf288c3

Please sign in to comment.