diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml
index c877f66..ed8381a 100644
--- a/.github/workflows/pipeline.yml
+++ b/.github/workflows/pipeline.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: ["3.10", "3.11", "3.12"]
+ python-version: ["3.11", "3.14"]
pymc-version: ["without", "'pymc>=5.0.0'"]
defaults:
run:
@@ -36,25 +36,24 @@ jobs:
- name: Test without PyMC
if: matrix.pymc-version == 'without'
run: |
- pytest --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/tests.py
+ pytest -v --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/test_core.py
- name: Install and test with PyMC
if: matrix.pymc-version != 'without'
run: |
pip install ${{ matrix.pymc-version }}
- pytest --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/tests.py
+ pytest -v --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/test_core.py
- name: Install and test with sunode
if: matrix.pymc-version != 'without'
run : |
mamba install "sunode>=0.5.0"
- pytest --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/tests.py
+ pytest -v --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/test_core.py
- name: Upload coverage
uses: codecov/codecov-action@v5
- if: matrix.python-version == 3.11
with:
file: ./coverage.xml
- name: Test Wheel install and import
run: |
- python setup.py bdist_wheel
+ python -m build
cd dist
pip install murefi*.whl
python -c "import murefi; print(murefi.__version__)"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 2047654..f9a4225 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -18,17 +18,17 @@ jobs:
with:
environment-file: environment-dev.yml
create-args: >-
- python=3.11
+ python=3.13
- name: Install dependencies
run: |
conda activate murefi-env
pip install -e .
- name: Test without PyMC
run: |
- pytest --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/tests.py
+ pytest -v --cov=./murefi --cov-append --cov-report xml --cov-report term-missing murefi/test_core.py
- name: Build package
run: |
- python setup.py sdist bdist_wheel
+ python -m build
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
diff --git a/.gitignore b/.gitignore
index 7d6b9a1..3df214f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ murefi/examples/Sandbox.ipynb
*.h5
/docs/build*
/notebooks/*.png
+dist/*
diff --git a/.readthedocs.yml b/.readthedocs.yml
index a527416..4e8177d 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -7,7 +7,7 @@ version: 2
# Set the OS, Python version and other tools you might need
build:
- os: ubuntu-22.04
+ os: ubuntu-24.04
tools:
python: "3.12"
@@ -19,6 +19,5 @@ sphinx:
python:
install:
- requirements: docs/requirements.txt
- - requirements: requirements.txt
- method: pip
path: .
diff --git a/environment-dev.yml b/environment-dev.yml
index 4cbdd5c..f5a72f8 100644
--- a/environment-dev.yml
+++ b/environment-dev.yml
@@ -1,12 +1,12 @@
name: murefi-env
channels:
-- conda-forge
+ - conda-forge
dependencies:
-- codecov
-- flake8
-- pytest
-- pytest-cov
-- twine
-- wheel
-- pip:
- - -r requirements.txt
+ - codecov
+ - flake8
+ - pandas>=3.0.0
+ - pytest
+ - pytest-cov
+ - twine
+ - pip:
+ - build
diff --git a/murefi/__init__.py b/murefi/__init__.py
index 8f8b823..0a18418 100644
--- a/murefi/__init__.py
+++ b/murefi/__init__.py
@@ -1,3 +1,22 @@
+# murefi
+# Copyright (C) 2019 Forschungszentrum Jülich GmbH
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published
+# by the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+# For more information contact the maintainers of https://github.com/JuBiotech.
+
+import importlib.metadata
+
from . import objectives
from .core import ParameterMapping
from .datastructures import (
@@ -11,4 +30,4 @@
)
from .ode import BaseODEModel
-__version__ = "5.3.0"
+__version__ = importlib.metadata.version(__package__ or __name__)
diff --git a/murefi/objectives.py b/murefi/objectives.py
index 2b09267..8731b27 100644
--- a/murefi/objectives.py
+++ b/murefi/objectives.py
@@ -51,7 +51,7 @@ def negative_loglikelihood_dataset(theta):
for (cm, observed_ts) in em_ts_list:
predicted_ts = predicted_replicate[cm.dependent_key]
ll = cm.loglikelihood(
- y=observed_ts.y, x=predicted_ts.y, replicate_id=rid, dependent_key=cm.dependent_key
+ y=observed_ts.y, x=predicted_ts.y, name=f"{rid}.{cm.dependent_key}"
).sum()
L.append(ll)
diff --git a/murefi/tests.py b/murefi/test_core.py
similarity index 100%
rename from murefi/tests.py
rename to murefi/test_core.py
diff --git a/pyproject.toml b/pyproject.toml
index 9046bc1..43efbf1 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,11 +1,56 @@
-# inspired by https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
-
[build-system]
-requires = ["setuptools", "wheel"]
+requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
+[project]
+name = "murefi"
+version = "5.3.0"
+description = "Toolbox for multiple replicate fitting and Bayesian modeling."
+readme = "README.md"
+requires-python = ">=3.11"
+license = "AGPL-3.0-or-later"
+authors = [
+ {name = "Michael Osthege", email = "m.osthege@fz-juelich.de"},
+ {name = "Laura Helleckes", email = "l.helleckes@fz-juelich.de"},
+]
+classifiers = [
+ "Programming Language :: Python",
+ "Operating System :: OS Independent",
+ "Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
+ "Programming Language :: Python :: 3.14",
+ "Intended Audience :: Science/Research",
+ "Topic :: Scientific/Engineering",
+]
+dependencies = [
+ "calibr8>=7.0.0",
+ "h5py",
+ "numpy",
+ "pandas",
+ "scipy",
+ "typing_extensions",
+]
+
+[project.urls]
+Homepage = "https://github.com/jubiotech/murefi"
+Documentation = "https://murefi.readthedocs.io/en/latest/"
+Download = "https://pypi.org/project/murefi/"
+
+[tool.setuptools]
+package-dir = {"murefi" = "murefi"}
+
+[tool.setuptools.package-data]
+"murefi" = ["py.typed"]
+
[tool.black]
line-length = 110
[tool.isort]
profile = "black"
+
+[tool.mypy]
+ignore_missing_imports = true
+exclude = [
+ 'test_.*?\.py$',
+]
diff --git a/requirements.txt b/requirements.txt
deleted file mode 100644
index 2a6a399..0000000
--- a/requirements.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-calibr8>=7.0.0
-h5py
-numpy
-pandas
-scipy
-setuptools
-typing_extensions
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 2acaf5b..0000000
--- a/setup.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2020 Forschungszentrum Jülich GmbH
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as published
-# by the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-
-import pathlib
-
-import setuptools
-
-__packagename__ = "murefi"
-ROOT = pathlib.Path(__file__).parent
-
-
-def get_version():
- import pathlib
- import re
-
- VERSIONFILE = pathlib.Path(pathlib.Path(__file__).parent, __packagename__, "__init__.py")
- initfile_lines = open(VERSIONFILE, "rt").readlines()
- VSRE = r"^__version__ = ['\"]([^'\"]*)['\"]"
- for line in initfile_lines:
- mo = re.search(VSRE, line, re.M)
- if mo:
- return mo.group(1)
- raise RuntimeError("Unable to find version string in %s." % (VERSIONFILE,))
-
-
-__version__ = get_version()
-
-
-setuptools.setup(
- name=__packagename__,
- packages=setuptools.find_packages(), # this must be the same as the name above
- version=__version__,
- description="Package for multiple replicate fitting and Bayesian modeling.",
- url="https://github.com/JuBiotech/murefi",
- author="Laura Marie Helleckes, Michael Osthege",
- author_email="l.helleckes@fz-juelich.de, m.osthege@fz-juelich.de",
- license="GNU Affero General Public License v3",
- classifiers=[
- "Programming Language :: Python",
- "Operating System :: OS Independent",
- "Programming Language :: Python :: 3.10",
- "Programming Language :: Python :: 3.11",
- "Programming Language :: Python :: 3.12",
- "License :: OSI Approved :: GNU Affero General Public License v3",
- "Intended Audience :: Science/Research",
- "Topic :: Scientific/Engineering",
- "Topic :: Scientific/Engineering :: Mathematics",
- ],
- install_requires=[open(pathlib.Path(ROOT, "requirements.txt")).readlines()],
-)