Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
24f1e7c
building source distribution works
annawendler Feb 23, 2026
4677483
try building wheels with ci
annawendler Feb 23, 2026
fe6706c
[ci skip] try only ubuntu
annawendler Feb 23, 2026
6b35ba7
test
annawendler Feb 23, 2026
369342f
require higher pybind version
annawendler Feb 25, 2026
c13105f
add comma
annawendler Feb 25, 2026
e25c218
skip some pypy versions
annawendler Feb 25, 2026
69a5b96
skip all pypy versions
annawendler Feb 25, 2026
73a7fbc
skip musllinux
annawendler Feb 25, 2026
6ca71df
fix
annawendler Feb 25, 2026
265a58c
test windows
annawendler Feb 25, 2026
22c73cb
skip win32
annawendler Feb 25, 2026
02edbf2
test macos
annawendler Feb 27, 2026
a1d4085
skip macosx_arm64
annawendler Feb 27, 2026
59e454a
test
annawendler Feb 27, 2026
b4febe3
test
annawendler Feb 27, 2026
6f2ac0a
build sdist in ci
annawendler Feb 27, 2026
4b9ce8d
add names for artifacts
annawendler Feb 27, 2026
9747c8c
also include other python packages
annawendler Feb 27, 2026
77bab93
update
annawendler Mar 2, 2026
d5b9b27
only windows
annawendler Mar 5, 2026
6951691
fix typo
annawendler Mar 6, 2026
c8253b1
test upload
annawendler Mar 11, 2026
682490b
typo
annawendler Mar 11, 2026
47cd7d3
use token
annawendler Mar 11, 2026
2dd392f
adapt names, no token
annawendler Mar 11, 2026
55911ce
try only downloading artifacts
annawendler Mar 11, 2026
0700ae8
try again
annawendler Mar 11, 2026
881d5e6
try with new version
annawendler Mar 11, 2026
f7e54c8
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Mar 16, 2026
58979cd
update after merge of main
annawendler Mar 16, 2026
5376644
only ubuntu
annawendler Mar 16, 2026
8c03007
more cpp versions
annawendler Mar 16, 2026
b1d43b1
update path
annawendler Mar 31, 2026
9f2e52b
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Mar 31, 2026
80b08ce
update version
annawendler Mar 31, 2026
ed25c02
include windows
annawendler Mar 31, 2026
c3af9ce
update actions for newer node.js version
annawendler Mar 31, 2026
21f9983
again
annawendler Mar 31, 2026
eacb371
try dynamic versioning
annawendler Apr 1, 2026
c2df595
try again
annawendler Apr 1, 2026
bd64248
no local version
annawendler Apr 1, 2026
2a982eb
general clean up
annawendler Apr 1, 2026
a3e2557
update main ci, fix version for now
annawendler Apr 1, 2026
5b19727
fix typo in if statement
annawendler Apr 1, 2026
9f37563
update ci and link to logo
annawendler Apr 10, 2026
ed9f054
update paths
annawendler Apr 10, 2026
15ed20f
again
annawendler Apr 10, 2026
40108ff
update
annawendler Apr 10, 2026
7131d9e
again
annawendler Apr 10, 2026
701aa3d
adapt else
annawendler Apr 10, 2026
3a79e46
again
annawendler Apr 10, 2026
fd247a1
adapt path for storing wheels
annawendler Apr 10, 2026
969ec6c
try new version to test image
annawendler Apr 10, 2026
c92fbf6
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Apr 10, 2026
13a1ea2
prepare for upload to real pypi
annawendler Apr 10, 2026
b12999b
add static version for pr
annawendler Apr 10, 2026
d60e0b5
fix mpl backend
annawendler Apr 13, 2026
b0fa0b8
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Apr 13, 2026
39c7dbe
debug pip env
annawendler Apr 13, 2026
e8f51a8
remove qt bindings
annawendler Apr 13, 2026
0eb295f
update
annawendler Apr 13, 2026
4b6c310
again
annawendler Apr 13, 2026
7568f83
try again
annawendler Apr 13, 2026
b4dd576
other version
annawendler Apr 13, 2026
a37e771
reset epidata_main and action to previous state
annawendler Apr 13, 2026
1acecee
reintroduce if statements
annawendler Apr 13, 2026
a91d67c
install setuptools again
annawendler Apr 13, 2026
cf93027
install setuptools only for memilio-simulation
annawendler Apr 13, 2026
7dd3357
forgot if statement
annawendler Apr 13, 2026
27bb822
fix order
annawendler Apr 13, 2026
37b0233
review suggestions, test changes on test pypi
annawendler Apr 14, 2026
27e4ba7
update workflow according to review
annawendler Apr 14, 2026
9ab4c4f
update classifiers and readthedocs
annawendler Apr 15, 2026
414b679
extend documentation
HenrZu Apr 21, 2026
1b652a1
docu and dont build wheels for python 3.14
annawendler Apr 21, 2026
c689baa
Merge branch 'main' into memilio-simulations-pypi-package
annawendler Apr 21, 2026
70ba18b
upload to pypi as version 2.3.0
annawendler Apr 21, 2026
eaf9b94
prepare for merge
annawendler Apr 21, 2026
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
30 changes: 24 additions & 6 deletions .github/actions/build-py/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,38 @@ inputs:
required: true
runs:
using: "composite"
steps:
steps:
- name: Configure Git safe directory
shell: bash
run: git config --global --add safe.directory /__w/memilio/memilio
- name: Install dependencies
shell: bash
run: yum install ninja-build cmake git -qy
- name: Make artifact dir
shell: bash
run: |
cd pycode/memilio-${{ inputs.package }}/
if [ "${{ inputs.package }}" != "simulation" ]; then
cd pycode/memilio-${{ inputs.package }}/
# else stay in root directory
fi
mkdir wheelhouse
- name: Build Python Wheels
shell: bash
run: |
cd pycode/memilio-${{ inputs.package }}/
if [ "${{ inputs.package }}" != "simulation" ]; then
cd pycode/memilio-${{ inputs.package }}/
# else stay in root directory
fi
/opt/python/cp38-cp38/bin/python -m pip install --upgrade pip setuptools wheel
/opt/python/cp38-cp38/bin/python -m pip install scikit-build scikit-build-core
/opt/python/cp38-cp38/bin/python -m build --no-isolation --wheel
/opt/python/cp312-cp312/bin/python -m pip install --upgrade pip setuptools wheel
/opt/python/cp38-cp38/bin/python -m pip install scikit-build scikit-build-core
/opt/python/cp312-cp312/bin/python -m pip install scikit-build scikit-build-core
# Install setuptools-scm only for memilio-simulation
if [ "${{ inputs.package }}" == "simulation" ]; then
/opt/python/cp38-cp38/bin/python -m pip install setuptools-scm
/opt/python/cp312-cp312/bin/python -m pip install setuptools-scm
fi
/opt/python/cp38-cp38/bin/python -m build --no-isolation --wheel
/opt/python/cp312-cp312/bin/python -m build --no-isolation --wheel
# Exclude memilio-generation, because its a pure python package, cmake is only used in the build process to retrieve data from cpp
if [[ -f "CMakeLists.txt" ]] && [ "${{ inputs.package }}" != "generation" ]; then
Expand All @@ -33,7 +47,11 @@ runs:
# no auditwheel necessary for pure python packages, so only copy the wheels to the same output directory
cp dist/*.whl wheelhouse
fi
cp -r wheelhouse ..
if [ "${{ inputs.package }}" != "simulation" ]; then
cp -r wheelhouse ..
else
cp -r wheelhouse pycode
fi
- name: Upload Python Wheels
uses: actions/upload-artifact@v4
with:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: PyPI

on:
release:
types:
- published

jobs:

build_wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Comment thread
annawendler marked this conversation as resolved.

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pypa/cibuildwheel@v3.4.1

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl

build_sdist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
# To test uploads to TestPyPI, uncomment the following:
# repository-url: https://test.pypi.org/legacy/
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.14)
project(memilio-simulation)

set(CMAKE_CXX_STANDARD "20")
set(CMAKE_CXX_STANDARD_REQUIRED "20")

# add in C++ library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL)

add_subdirectory(pycode/memilio-simulation)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MEmilio - a high performance Modular EpideMIcs simuLatIOn software #

![memilio_logo](docs/memilio-small.png)
![memilio_logo](https://github.com/SciCompMod/memilio/blob/main/docs/memilio-small.png?raw=true)

[![CI](https://github.com/SciCompMod/memilio/actions/workflows/main.yml/badge.svg)](https://github.com/SciCompMod/memilio/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/SciCompMod/memilio/branch/main/graph/badge.svg?token=DVQXIQJHBM)](https://codecov.io/gh/SciCompMod/memilio)
Expand Down
47 changes: 39 additions & 8 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -300,39 +300,70 @@ Option A: Installing the Python packages (Recommended for nonexperienced users o

You can run simulations, download data, or create plots, by only installing our Python packages.

Installing ``memilio-simulation``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The simulation package ``memilio-simulation`` provides two installation options depending on your use case:

**Option A.1: Install from PyPI (Recommended - no C++ compiler required)**

If you just want to run simulations with the latest released version, install the pre-built wheel directly from PyPI:

.. code-block:: console

pip install memilio-simulation

This requires no C++ compiler or CMake. Pre-built wheels are provided for Linux and Windows on Python 3.8 to 3.13.

**Option A.2: Install from source (for the latest development version)**

If you need the latest (unreleased) code, or want to contribute to the package, you need to build from source.
This requires a **C++20 compiler** (e.g. GCC or Clang), **CMake** (>= 3.18), and **Ninja**.

.. code-block:: console

pip install -e .[dev]

This command must be run from the **root of the MEmilio repository** (the directory containing the top-level ``pyproject.toml``).
This is necessary because the C++ build requires access to the ``cpp/`` directory.
Note that this only installs ``memilio-simulation`` and not any other Python packages. The root-level ``pyproject.toml`` belongs exclusively to ``memilio-simulation``.

.. warning::
C++ code changes always require re-running ``pip install -e .[dev]`` to recompile.

Installing other Python packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Navigate to the directory containing our Python code:

.. code-block:: console

cd pycode

2. To install the simulation package ``memilio-simulation``, from here you can do:
2. To install the ``memilio-epidata`` package for data downloading and handling:

.. code-block:: console

cd memilio-simulation
cd memilio-epidata
pip install -e .

3. For afterwards installing the ``memilio-epidata`` package for data downloading and handling, run:
3. To install the ``memilio-surrogatemodel`` package for surrogate models:

.. code-block:: console

cd .. # Go back to the pycode directory
cd memilio-epidata
cd memilio-surrogatemodel
pip install -e .

.. tip:: For Contributors: Installing development packages

The ``-e`` flag installs the package in a mode, which links the installation to your local source code folder.

If you plan to contribute to MEmilio, you can also install all the necessary development dependencies by adding ``[dev]`` to the command:
If you plan to contribute to any package, install all development dependencies by adding ``[dev]``:

.. code-block:: console

pip install -e .[dev]

For regular use, the simple ``pip install -e .`` is sufficient.

To install other packages, see the items below *Python Interface* in the menu on the left hand side.

Option B: Building the C++ core (Advanced)
Expand Down
41 changes: 39 additions & 2 deletions docs/source/python/m-simulation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,49 @@ MEmilio Simulation is a Python interface to the MEmilio C++ library. Using pytho

The package is contained inside the folder `pycode/memilio-simulation <https://github.com/SciCompMod/memilio/blob/main/pycode/memilio-simulation>`_.

Installation
------------

The ``memilio-simulation`` package can be installed in two ways depending on your use case.

**Option 1: Install from PyPI (Recommended - no C++ compiler required)**

Pre-built wheels are provided for Linux and Windows on Python 3.8 to 3.13.

.. code-block:: console

pip install memilio-simulation

This is the easiest way to get started. No C++ compiler or CMake is needed.

**Option 2: Install from source (latest development version, or contributing)**

If you need the latest unreleased code, or want to modify the bindings, build from source.

Requirements:

* A **C++20 compiler**
* **CMake** >= 3.18
* **Ninja** build tool
* All :doc:`C++ library dependencies <../getting_started>`

Install from the **root of the MEmilio repository** (the directory containing the top-level ``pyproject.toml``):

.. code-block:: console

pip install -e .[dev]

This is necessary because the C++ build requires access to the ``cpp/`` directory.
Note that this only installs ``memilio-simulation`` and not any other Python packages.The ``-e`` flag links the installation to your local source code so Python changes are reflected immediately.
C++ changes require re-running this command to recompile.

Dependencies
------------

Required Python packages:
Required Python packages (installed automatically):

* scikit-build
* numpy >= 1.22 (not 1.25.*)
* pandas >= 2.0.0

For a successful build, the development libraries for Python need to be installed, i.e. python3.x-dev.
Additionally, as this package builds upon the MEmilio C++ library,
Expand Down
9 changes: 0 additions & 9 deletions pycode/memilio-simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
cmake_minimum_required(VERSION 3.14)
project(memilio-python)

set(CMAKE_CXX_STANDARD "20")
set(CMAKE_CXX_STANDARD_REQUIRED "20")

option(MEMILIO_USE_BUNDLED_PYBIND11 "Use pybind11 bundled with this library." ON)
mark_as_advanced(MEMILIO_USE_BUNDLED_PYBIND11)

Expand Down Expand Up @@ -48,9 +42,6 @@ else()
find_package(pybind11 REQUIRED)
endif()

# add in C++ library
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../cpp ${CMAKE_CURRENT_BINARY_DIR}/cpp EXCLUDE_FROM_ALL)

# a list of all "LINKED_LIBRARIES" that are given to add_pymio_module. will contain duplicates
# used for wheel installation
set(PYMIO_MEMILIO_LIBS_LIST)
Expand Down
29 changes: 23 additions & 6 deletions pycode/memilio-simulation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ This package contains Python bindings for the MEmilio C++ library. It enables se

## Installation

This project is configured via ``pyproject.toml`` and is built with [scikit-build-core](https://scikit-build-core.readthedocs.io). CMake and Ninja must be available on the system. The package uses the [Pybind11 C++ library](https://pybind11.readthedocs.io) to create the bindings.
### Option 1: Install from PyPI (Recommended)

To install the package, use the command (from the directory containing ``pyproject.toml``)
Pre-built wheels are provided for Linux and Windows on Python 3.8 to 3.13.

```bash
pip install .
pip install memilio-simulation
```

This builds the C++ library and C++ Python extension module and copies everything required to your site-packages.
### Option 2: Install from source (latest code or development)

All the requirements of the [C++ library](../../cpp/README.md) must be met in order to build and use the python bindings. A virtual environment is recommended.
Use this option if you need the latest unreleased code, or want to modify the C++ bindings.

This project is configured via `pyproject.toml`. The following tools must be available on the system:

- A **C++20 compiler**
- **CMake** >= 3.18
- **Ninja**
- All [C++ library dependencies](../../cpp/README.md)

A virtual environment is recommended. Install from the **root of the MEmilio repository** (the directory containing the top-level `pyproject.toml`):

```bash
pip install -e .[dev]
```

This is necessary because the C++ build requires access to the `cpp/` directory. Note that this only installs `memilio-simulation` and not any other Python packages.

**Note:** The `-e` flag links the installation to your local source code. Python changes take effect immediately, but C++ changes require re-running this command to recompile.

CMake is executed internally by scikit-build-core. All the options provided by the CMake configuration of the C++ library are available when building the Python extension as well. Additionally, the CMake configuration for the bindings provide the following CMake options:

Expand All @@ -30,7 +47,7 @@ Alternatively, edit the `CMakeCache.txt` in the directory created by scikit-buil

## Development

For developement of the cpp bindings use
For developement of the cpp bindings use the following command from the root of this repository (i.e. the directory containing ``pyproject.toml``)

```bash
pip install -e .[dev]
Expand Down
39 changes: 0 additions & 39 deletions pycode/memilio-simulation/pyproject.toml

This file was deleted.

Loading
Loading