Skip to content

Installation

sdepack can be installed from PyPI, conda-forge, or directly from git.

PyPI

For using the PyPI package in your project, you can update your configuration file by adding the following snippet.

[project.dependencies]
sdepack = "*" # (1)!
  1. Specifying a version is recommended
sdepack>=0.1.0

pip

pip install --upgrade --user sdepack # (1)!
  1. You may need to use pip3 instead of pip depending on your Python installation.
python -m venv .venv
source .venv/bin/activate
pip install --require-virtualenv --upgrade sdepack # (1)!
  1. You may need to use pip3 instead of pip depending on your Python installation.

Note

Command to activate the virtual env depends on your platform and shell. More info

pipenv

pipenv install sdepack

uv

uv add sdepack
uv sync
uv venv
uv pip install sdepack

poetry

poetry add sdepack

pdm

pdm add sdepack

hatch

hatch add sdepack

conda-forge

You can update your environment spec file by adding the following snippet.

environment.yml
    channels:
    - conda-forge
    dependencies:
    - pip
    - pip:
        - sdepack # (1)!
  1. Specifying a version is recommended

Installation can be done using the updated environment spec file.

conda env update --file environment.yml
micromamba env update --file environment.yml

Note

Replace environment.yml with your actual environment spec file name if it's different.

git

Install the latest development version directly from the repository:

pip install --upgrade "git+https://github.com/eggzec/sdepack.git#egg=sdepack"

Building from source

Clone and build from source if you want to modify the Fortran code or test local changes:

git clone https://github.com/eggzec/sdepack.git
cd sdepack
pip install -e .

Fortran compiler required

Source builds require a working Fortran compiler. On most Linux distributions, install gfortran:

sudo apt install gfortran
sudo dnf install gcc-gfortran
brew install gcc

Install MinGW-w64 with gfortran or use MSYS2.

Verifying the installation

After installation, verify that the package loads correctly:

import sdepack
import numpy as np

x = np.zeros(11, dtype=np.float64)
sdepack.rk1_ti_solve(lambda x: 0.0, lambda x: 1.0, x, 0.0, 1.0, 0.0, 10, 1.0, 42)
print("sdepack is working! Trajectory:", x)

Dependencies