PyBaMM
PyBaMM copied to clipboard
How to change the code implementation in pybammsolvers applied in PyBaMM
I would like to realize some changes to the IDAKLUSolver, and have successfully build it by
pip install .
as the introduction of pybammsolver introduction said.
But when I copied the generated idaklu.cpython-39-x86_64-linux-gnu.so file and covered the original one in the environment,
solver = pybamm.IDAKLUSolver()
raises
ImportError("KLU is not installed")
ImportError: KLU is not installed
I would like to ask what I should do to change the process of solver implementation.
A process like this should work:
# Setup environment
virtualenv .venv
source .venv/bin/activate
git clone [email protected]:pybamm-team/pybammsolvers.git
git clone [email protected]:pybamm-team/PyBaMM.git
# Install PyBaMM
cd PyBaMM
pip install -e ".[all,dev,jax]"
# Replace PyBaMM solvers
cd ../pybammsolvers
pip uninstall pybammsolvers --yes
python install_KLU_Sundials.py
pip install .
# Run pybamm tests
cd ../PyBaMM