Skip to content

[Mnt] Runtime dependency #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
31 changes: 23 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,46 @@ description = "Python bindings for the SPM software."
readme = "README.md"
license = {file = "LICENSE"}
authors = [
{name = "Johan Medrano", email = "[email protected]"},
{name = "Yael Balbastre", email = "[email protected].yk"}]
requires-python = ">=3.9,<3.13"
{name = "Johan Medrano", email = "[email protected]"},
{name = "Yael Balbastre", email = "[email protected].uk"}]
requires-python = ">=3.6,<3.13"
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
"numpy",
"mpython-core"
"mpython-core",
"spm-runtime-R2024b; python_version>='3.9' and python_version<'3.13'",
"spm-runtime-R2023a; python_version=='3.8'",
"spm-runtime-R2021b; python_version=='3.7'",
"spm-runtime-R2020b; python_version=='3.6'",
]

[project.optional-dependencies]
latest = ["spm-runtime"]
R2024b = ["spm-runtime-R2024b"]
R2024a = ["spm-runtime-R2024a"]
R2023b = ["spm-runtime-R2023b"]
R2023a = ["spm-runtime-R2023a"]
R2022b = ["spm-runtime-R2022b"]
R2022a = ["spm-runtime-R2022a"]
R2021b = ["spm-runtime-R2021b"]
R2021a = ["spm-runtime-R2021a"]
R2020b = ["spm-runtime-R2020b"]

[project.urls]
Repository = "https://github.com/spm/spm-python"

[tool.setuptools.packages]
find = {}

[tool.setuptools.package-data]
spm = ["_spm/_spm.ctf"]

[tool.setuptools.dynamic]
version = {attr = "spm._version.__version__"}

Expand Down
2 changes: 1 addition & 1 deletion spm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from mpython import (
Runtime,
MatlabClass,
MatlabFunction,
Cell,
Struct,
Array,
SparseArray,
)
from ._runtime import Runtime
from ._version import __version__
from .file_array import file_array
from .gifti import gifti
Expand Down
23 changes: 23 additions & 0 deletions spm/_runtime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from mpython.runtime import Runtime as RuntimeBase


class Runtime(RuntimeBase):
"""
Runtime specialization that imports the correct CTF.
"""

@classmethod
def _import_runtime(cls):
import spm_runtime
return spm_runtime


class RuntimeMixin:
"""
Mixin that SPM classes must inherit so that they can call the
correct runtime.
"""

@classmethod
def _runtime(cls):
return Runtime
12 changes: 0 additions & 12 deletions spm/spm_pca_get_transforms.py

This file was deleted.

18 changes: 0 additions & 18 deletions spm/spm_pca_project_velocity.py

This file was deleted.

24 changes: 0 additions & 24 deletions spm/spm_pca_sample_brains.py

This file was deleted.

17 changes: 0 additions & 17 deletions spm/spm_pca_sample_deformation.py

This file was deleted.

23 changes: 0 additions & 23 deletions spm/spm_pca_transform_mesh.py

This file was deleted.

20 changes: 0 additions & 20 deletions spm/spm_pca_transform_volume.py

This file was deleted.

26 changes: 0 additions & 26 deletions spm/spm_pca_warps.py

This file was deleted.

Loading