Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
38 changes: 28 additions & 10 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,38 @@ on:

env:
MLM_LICENSE_TOKEN: ${{ secrets.MATLAB_BATCH_TOKEN }}
PIP_NO_CACHE_DIR: "1"

jobs:
run-unit-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: False
matrix:
matlab: ["R2025b"]
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- os: ubuntu-latest
os_name: Linux
platform: Linux
- os: macos-13
os_name: macOS_Intel
platform: Mac
- os: macos-latest
os_name: macOS_Apple_Silicon
platform: Mac
matlab: R2026b
- os: windows-latest
os_name: Windows
platform: Windows
matlab: R2026b
- os: macos-latest
os_name: macOS_Apple_Silicon
platform: Mac
matlab: R2026b
- os: macos-15-intel
os_name: macOS_Intel
platform: Mac
matlab: R2025b
exclude:
- os: macos-15-intel
python-version: "3.14"
- os: macos-15-intel
python-version: "3.13"

steps:
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -46,10 +55,19 @@ jobs:
uses: actions/checkout@v4

- name: Install SPM Python
if: ${{ matrix.os_name != 'macOS_Intel' }}
run: |
python -m pip install mpython-core
python -m pip install --upgrade pip
python -m pip install -e .

- name: Install SPM Python (macos intel)
if: ${{ matrix.os_name == 'macOS_Intel' }}
env:
MATLAB_VERSION: ${{ matrix.matlab }}
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[${MATLAB_VERSION}]"

# Setup MATLAB and Runtime
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-setup-matlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
strategy:
fail-fast: False
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
include:
- os: ubuntu-latest
os_name: Linux
platform: Linux
- os: macos-13
- os: macos-15-intel
os_name: macOS_Intel
platform: Mac
- os: macos-latest
Expand Down
9 changes: 6 additions & 3 deletions .mpython/templates/docstring.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""
r"""
<matlabhelp>

[Matlab code]( https://github.com/spm/spm/blob/main/<rfilepath> )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/<rfilepath> )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ By default, spm-python uses:
- Python 3.6: R2020b
- Python 3.7: R2021b
- Python 3.8: R2023a
- Python 3.9-3.12: R2025a
- Python 3.13: Unsupported
- Python 3.9: R2025a
- Python 3.10 - 3.14: R2026b

### Option 1 - Install the MATLAB runtime on first use

Expand Down Expand Up @@ -78,7 +78,7 @@ By default, spm-python uses:
```
2. Run the installer
```shell
install_matlab_runtime --version R2025a --yes
install_matlab_runtime --version R2026b --yes
```

- **Advantages**
Expand Down
41 changes: 22 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ authors = [
{name = "Peter Zeidman"},
{name = "Olivia Kowalczyk"},
]
requires-python = ">=3.6,<3.14"
requires-python = ">=3.6,<3.15"
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
Expand All @@ -32,29 +32,32 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"mpython-core>=25.4rc1",
"spm-runtime-r2025b >= 25.1.2 ; python_version >= '3.10'",
"spm-runtime-r2025a == 25.1.2 ; python_version == '3.9'",
"spm-runtime-r2023a == 25.1.2 ; python_version == '3.8'",
"spm-runtime-r2021b == 25.1.2 ; python_version == '3.7'",
"spm-runtime-r2020b == 25.1.2 ; python_version == '3.6'",
"mpython-core>=26.11.1",
"spm-runtime-r2026b ~= 26.10.1.post1 ; python_version >= '3.10'",
"spm-runtime-r2025a ~= 26.10.1.post1 ; python_version == '3.9'",
"spm-runtime-r2023a ~= 26.10.1.post1 ; python_version == '3.8'",
"spm-runtime-r2021b ~= 26.10.1.post1 ; python_version == '3.7'",
"spm-runtime-r2020b ~= 26.10.1.post1 ; python_version == '3.6'",
]

[project.optional-dependencies]
latest = ["spm-runtime == 25.1.2"]
R2025b = ["spm-runtime-R2025b == 25.1.2"]
R2025a = ["spm-runtime-R2025a == 25.1.2"]
R2024b = ["spm-runtime-R2024b == 25.1.2"]
R2024a = ["spm-runtime-R2024a == 25.1.2"]
R2023b = ["spm-runtime-R2023b == 25.1.2"]
R2023a = ["spm-runtime-R2023a == 25.1.2"]
R2022b = ["spm-runtime-R2022b == 25.1.2"]
R2022a = ["spm-runtime-R2022a == 25.1.2"]
R2021b = ["spm-runtime-R2021b == 25.1.2"]
R2021a = ["spm-runtime-R2021a == 25.1.2"]
R2020b = ["spm-runtime-R2020b == 25.1.2"]
latest = ["spm-runtime ~= 26.10.1.post1"]
R2026b = ["spm-runtime-R2026b ~= 26.10.1.post1"]
R2026a = ["spm-runtime-R2026a ~= 26.10.1.post1"]
R2025b = ["spm-runtime-R2025b ~= 26.10.1.post1"]
R2025a = ["spm-runtime-R2025a ~= 26.10.1.post1"]
R2024b = ["spm-runtime-R2024b ~= 26.10.1.post1"]
R2024a = ["spm-runtime-R2024a ~= 26.10.1.post1"]
R2023b = ["spm-runtime-R2023b ~= 26.10.1.post1"]
R2023a = ["spm-runtime-R2023a ~= 26.10.1.post1"]
R2022b = ["spm-runtime-R2022b ~= 26.10.1.post1"]
R2022a = ["spm-runtime-R2022a ~= 26.10.1.post1"]
R2021b = ["spm-runtime-R2021b ~= 26.10.1.post1"]
R2021a = ["spm-runtime-R2021a ~= 26.10.1.post1"]
R2020b = ["spm-runtime-R2020b ~= 26.10.1.post1"]

[project.urls]
Repository = "https://github.com/spm/spm-python"
Expand Down
9 changes: 6 additions & 3 deletions spm/__compat/loadxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def loadxml(*args, **kwargs):
"""
r"""
LOADXML Load workspace variables from disk (XML file).
LOADXML FILENAME retrieves all variables from a file given a full
pathname or a MATLABPATH relative partial pathname (see PARTIALPATH).
Expand All @@ -27,9 +27,12 @@ def loadxml(*args, **kwargs):
See also LOAD, XML2MAT, XMLTREE.


[Matlab code]( https://github.com/spm/spm/blob/main/compat/loadxml.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/loadxml.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("loadxml", *args, **kwargs)
9 changes: 6 additions & 3 deletions spm/__compat/savexml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def savexml(*args, **kwargs):
"""
r"""
SAVEXML Save workspace variables to disk in XML.
SAVEXML FILENAME saves all workspace variables to the XML-file
named FILENAME.xml. The data may be retrieved with LOADXML. if
Expand All @@ -23,9 +23,12 @@ def savexml(*args, **kwargs):
See also SAVE, MAT2XML, XMLTREE.


[Matlab code]( https://github.com/spm/spm/blob/main/compat/savexml.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/savexml.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("savexml", *args, **kwargs, nargout=0)
9 changes: 6 additions & 3 deletions spm/__compat/spm_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_add(*args, **kwargs):
"""
r"""
Add a series of images - a compiled routine
FORMAT s = spm_add(VI,VO)
VI - Vector of mapped volumes (from spm_map or spm_vol).
Expand All @@ -23,9 +23,12 @@ def spm_add(*args, **kwargs):
__________________________________________________________________________


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_add.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_add.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_add", *args, **kwargs)
9 changes: 6 additions & 3 deletions spm/__compat/spm_adjmean_fmri_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_adjmean_fmri_ui(*args, **kwargs):
"""
r"""
Adjusted means of fMRI via box-car General Linear Model with confounds
FORMAT spm_adjmean_fmri_ui
_______________________________________________________________________
Expand Down Expand Up @@ -196,9 +196,12 @@ def spm_adjmean_fmri_ui(*args, **kwargs):
Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_adjmean_fmri_ui.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_adjmean_fmri_ui.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_adjmean_fmri_ui", *args, **kwargs, nargout=0)
9 changes: 6 additions & 3 deletions spm/__compat/spm_adjmean_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_adjmean_ui(*args, **kwargs):
"""
r"""
Scaled (for grand mean) & adjusted (for global) means via General Linear Model
FORMAT spm_adjmean_ui
_______________________________________________________________________
Expand Down Expand Up @@ -182,9 +182,12 @@ def spm_adjmean_ui(*args, **kwargs):
Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_adjmean_ui.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_adjmean_ui.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_adjmean_ui", *args, **kwargs, nargout=0)
9 changes: 6 additions & 3 deletions spm/__compat/spm_atranspa.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_atranspa(*args, **kwargs):
"""
r"""
Multiplies the transpose of a matrix by itself
FORMAT C = spm_atranspa(A)
A - real matrix
Expand All @@ -15,9 +15,12 @@ def spm_atranspa(*args, **kwargs):
Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_atranspa.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_atranspa.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_atranspa", *args, **kwargs)
9 changes: 6 additions & 3 deletions spm/__compat/spm_chi2_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_chi2_plot(*args, **kwargs):
"""
r"""
Display a plot showing convergence of an optimisation routine.
FORMAT spm_chi2_plot('Init',title,ylabel,xlabel)
Initialise the plot in the 'Interactive' window.
Expand All @@ -19,9 +19,12 @@ def spm_chi2_plot(*args, **kwargs):
Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_chi2_plot.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_chi2_plot.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_chi2_plot", *args, **kwargs, nargout=0)
9 changes: 6 additions & 3 deletions spm/__compat/spm_digamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_digamma(*args, **kwargs):
"""
r"""
Digamma function (logarithmic derivative of the gamma function)
FORMAT [y] = spm_digamma(x)

Expand All @@ -14,9 +14,12 @@ def spm_digamma(*args, **kwargs):
Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_digamma.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_digamma.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_digamma", *args, **kwargs)
9 changes: 6 additions & 3 deletions spm/__compat/spm_dirichlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def spm_dirichlet(*args, **kwargs):
"""
r"""
Dirichlet distribution - deprecated

FORMAT [p] = dirichlet(x,alpha)
Expand All @@ -16,9 +16,12 @@ def spm_dirichlet(*args, **kwargs):
$Id: spm_dirichlet.m 4418 2011-08-03 12:00:13Z guillaume $


[Matlab code]( https://github.com/spm/spm/blob/main/compat/spm_dirichlet.m )
Generated from SPM26.10.01.

[Source Matlab code]( https://github.com/spm/spm/blob/26.10.01/compat/spm_dirichlet.m )

Copyright (C) 1995-2025 Functional Imaging Laboratory, Department of Imaging Neuroscience, UCL
Copyright (C) 1995-2026 Functional Imaging Laboratory,
Department of Imaging Neuroscience, UCL
"""

return Runtime.call("spm_dirichlet", *args, **kwargs)
Loading
Loading