%global pypi_name mapca Name: python-%{pypi_name} Version: 0.0.8 Release: 1%{?dist} Summary: Moving Average PCA for fMRI dimensionality estimation # mapca/mapca.py (and the GIFT algorithm it ports) carries a "GPL version 2 # or (at your option) any later version" header; the repository LICENSE is the # GPL-2.0 text. The pyproject classifier says LGPL, which is stale. License: GPL-2.0-or-later URL: https://github.com/ME-ICA/mapca Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-pytest %global _description %{expand: MAPCA (Moving Average Principal Components Analysis) estimates the number of independent components in fMRI data using the stationary Gaussian moving-average model of the GIFT toolbox, and performs the PCA with that dimensionality. It is the component-count step in tedana.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l mapca %check # test_integration.py fetches its reference arrays from OSF; the rest run offline. %pytest mapca/tests/test_utils.py mapca/tests/test_mapca.py # Five time courses mixed into noise: every criterion must find exactly five. cd %{_tmppath} %{py3_test_envvars} %{python3} - <<'PY' import numpy as np, nibabel as nib from mapca.mapca import MovingAveragePCA rng = np.random.default_rng(1) nx, ny, nz, nt, k = 12, 12, 8, 120, 5 t = np.arange(nt) src = np.stack([np.sin(2*np.pi*(i+2)*t/nt) + 0.3*rng.standard_normal(nt) for i in range(k)]) maps = rng.standard_normal((nx*ny*nz, k)) data = (maps @ src + 0.5*rng.standard_normal((nx*ny*nz, nt))).reshape(nx, ny, nz, nt) img = nib.Nifti1Image(data.astype('float32'), np.eye(4)) mask = nib.Nifti1Image(np.ones((nx, ny, nz), 'uint8'), np.eye(4)) for crit in ('aic', 'kic', 'mdl'): u = MovingAveragePCA(criterion=crit).fit_transform(img, mask) print(crit, u.shape) assert u.shape == (nx, ny, nz, k), (crit, u.shape) PY %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Fri Oct 16 2026 Morgan Hough - 0.0.8-1 - New package: required by tedana 26