Repository navigation
Conversation
Packaging: - Replace setup.py/setup.cfg/requirements.txt with pyproject.toml. numpy and Cython are build requirements, so users no longer have to install numpy before pyprf. setup.py only declares the cython extensions. - Require Python >= 3.11. Dependencies have lower bounds instead of exact pins (numpy>=1.26, scipy>=1.11, nibabel>=5.0, pillow>=10.0, h5py>=3.10). - Stop committing compiled cython files (*.so, *.c); they are built at install time. Remove cython_setup.py & cython_setup_call.py (replaced by `pip install -e .`). - Remove README.rst; PyPI renders README.md directly. - Version 3.0.0. Code changes for current versions of Python and dependencies: - Cython 3: cdef functions can no longer return tuples of memory views. The helper functions write their results into the memory views that are passed in, so they now return nothing. - scipy.mgrid -> np.mgrid, scipy.ndimage.filters -> scipy.ndimage, np.bool -> bool, Thread.setDaemon() -> Thread.daemon. - Python 3.14: csv.reader() no longer accepts a newline as delimiter; read the config file line by line instead. - pkg_resources -> importlib.metadata for the version number. TensorFlow (GPU) backend removed. A config file with strVersion = 'gpu' now raises an informative error. Tests: - One test per backend (parametrized), output written to a temporary directory instead of the package directory. Test configs are rewritten with absolute paths, so the tests also run against an installed wheel. Removes the `lgcTest` path hack from load_config() and pyprf(). - Coverage of code in parallel processes is measured again. - New tests for the design matrix creation of the stimulus presentation (create_design_matrix.py now imports PsychoPy only when run as script). Documents a known bug as expected failure: in full screen mode, the uppermost horizontal bar position is outside of the screen. The results are identical to the reference results (to 3 decimals, as before), on Python 3.11 (oldest dependencies), 3.12 and 3.14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests.yml: runs the tests on push & pull request (main, devel), on Linux, macOS and Windows, with Python 3.11 to 3.14, and with the oldest supported dependency versions. Coverage is uploaded to Codecov. The stimulus presentation code is tested with the Python versions that PsychoPy supports (3.10 & 3.12), without PsychoPy. - publish.yml: runs on push to main. If the version in pyproject.toml has no git tag yet, builds wheels (cibuildwheel; the test suite is run on each wheel), publishes to PyPI (trusted publishing), and creates a GitHub release (which triggers Zenodo) with a zip of the stimulus presentation folder. - dependabot.yml: monthly updates of the GitHub Actions versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In logging mode, the stimulus frames were stored in an int8 array, which was multiplied by 255. With numpy 1, the result was silently promoted to a larger integer type. numpy 2 raises an OverflowError instead, so the stimulus log (needed for the pRF analysis) could not be created with current versions of PsychoPy. Use uint8 (the result is the same as before with numpy 1). Tested with PsychoPy 2026.2.4 (Python 3.12, numpy 2.5) under Xvfb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New GUI fields 'Scanner trigger key' (default: 5) and 'Response key' (default: 1), instead of hard-coded keys. Both are written to the log file. Key names are PsychoPy key names (e.g. '5', 't', 'num_5'), and are checked (different from each other, and from the exit keys). - The trigger key is compared as a whole (previously, only the first character of the key name was compared, so e.g. 'num_5' would never have been detected). - The experiment can be aborted (e + x) while waiting for the trigger. - The design matrix is selected from a dropdown list of the available design matrices, which shows the TR and number of volumes of each, so that they can be compared with the fMRI sequence. A clear message is shown if there is no design matrix. - GUI fields are shown in a fixed order (design matrix first), not alphabetically. - Fix `-gui False` (crashed with a NameError). Without GUI, the default parameters are used. Tested with PsychoPy 2026.2.4 under Xvfb (dialog, trigger with custom key, responses, abort while waiting for trigger, logging mode). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Previously, if a design matrix with the chosen name already existed
(e.g. one of the example design matrices 'Run_01' to 'Run_03'), nothing
was saved, and there was only a warning in the console, which was easy
to overlook.
- The default name in the GUI is the first unused name ('Run_04' if
'Run_01' to 'Run_03' exist).
- If the chosen name exists, a dialog asks for a different name (a free
name is suggested), or to overwrite the existing design matrix.
- After saving, a dialog shows the path, TR, number of volumes, and
duration of the run (needed for setting up the fMRI sequence).
- crt_design() checks for an existing file before creating the design
matrix, and raises FileExistsError (unless lgcOvwr=True). It returns
the path of the design matrix.
- Fix `-gui False` (did nothing). Without GUI, the default parameters are
used.
- Updated GUI screenshots (for the README).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README: - Explain the two parts of pyprf (stimulus presentation & analysis), and that the stimulus presentation does not need the pyprf package, but is a folder with scripts that are run in PsychoPy. - Step-by-step instructions for the stimulus presentation: installation (release zip file), creating design matrices, presenting the stimuli (including trigger & response keys), and creating the stimulus log for the analysis. - Explain that the example design matrices are for a TR of 2.079 s, and that new design matrices are needed for other TRs. - Updated installation & configuration of the analysis, and notes on upgrading from pyprf 2. - Badges for GitHub Actions & Codecov (instead of Travis). Use the Zenodo concept DOI (always resolves to the latest version), so that the DOI does not need to be updated for each release. - Absolute image URLs, so that images are shown on PyPI. CONTRIBUTING.md: Development setup, tests, workflow, and the (automated) release process. Replaces pypi_instructions.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows, a file cannot be removed while it is open. In hdf5 mode: - pre_pro_func_hdf5() removed the hdf5 file with the functional data (after spatial smoothing) before closing it (PermissionError). - model_creation() opened the hdf5 file with the pRF model time courses (to save a nii version for inspection), and did not close it. (Found with the GitHub Actions tests on Windows. Reproduced on Linux by making os.remove() fail for open hdf5 files.) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In full screen mode, horizontal bars are only presented at the central bar positions (as many as there are positions on the y-axis). Because of an off-by-one error, one position too many was kept (e.g. positions 3 to 11 instead of 3 to 10, with 14 positions on the x-axis and 8 on the y-axis). The uppermost horizontal bar was completely outside of the screen, i.e. no stimulus was visible on these volumes (4 volumes per run with the default settings). This did not affect the pRF analysis (the analysis uses the stimulus log, i.e. what was actually presented). New design matrices with default settings have 223 instead of 227 volumes. The example design matrices are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #51 +/- ##
=======================================
Coverage ? 95.85%
=======================================
Files ? 19
Lines ? 1423
Branches ? 0
=======================================
Hits ? 1364
Misses ? 59
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge devel into main: