Skip to content
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

All the changes contained in this version are listed in the PR specification #85

Draft
wants to merge 93 commits into
base: master
Choose a base branch
from

Conversation

smoia
Copy link
Owner

@smoia smoia commented Mar 9, 2023

Closes #

The main change of this PR is that the loops that could be switched for sliding windows views have been switched to improve performance. This, however, breaks backward compatibility, and forces the adoption of numpy > 1.20, with all that comes from it.

For the rest, this PR makes small improvements to different parts of code.
It's mainly about refactoring different parts of the code that became repetitive or useless, but it also fixes some minor "oversight" of previous PRs.

Proposed Changes

  • Switch loops for sliding window view in cross correlation and lagged regressor computation (major boost in performance).
  • Consequently, force numpy version to be equal or higher than 1.20.0
  • Split stats models from regressors creation and rename get_* functions into create_*.
  • Consequently, stats now contains only statistical models (OLS, Xcorr, and related), while a new module regressors contains all functions to create regressors and related operations (e.g. bulk shift and fine shift estimation).
  • resample_signal now uses the number of interpolated samples to resample the signals, rather than asking for frequencies.
  • the old resample_signal is now resample_signal_freqs.
  • convolve_petco2 is now compute_petco2hrf to better reflect what the code does.
  • skip_conv flag is now skip-petco2hrf, run_conv is now run_petco2hrf.
  • Add the option to choose which response function the signal of interest should be convolved with, if any (default: HRF. Convolution can now be skipped altogether).
  • Refactor cross correlation function.
  • Refactor get_regr in the parts related to cross correlation.
  • Improve export_regressor so that it works with ND arrays.
  • Because of all changes listed above, some matrices are now basically transposed, compared to before.
  • All volumes initialised in the code are initialised as zero matrices (this should remove the "background effect" in visualisation).
  • Skipping cross correlation is now completely coded.
  • brightspin-clinical configuration now skips bulk shift estimation (cross correlation).
  • Improve figure titles and names (mainly).
  • Improve some variable and arguments names.

Change Type

  • bugfix (+0.0.1)
  • minor (+0.1.0)
  • major (+1.0.0)
  • refactoring (no version update)
  • test (no version update)
  • infrastructure (no version update)
  • documentation (no version update)
  • other

Checklist before review

  • I added everything I wanted to add to this PR.
  • [Code or tests only] I wrote/updated the necessary docstrings.
  • [Code or tests only] I ran and passed tests locally.
  • [Documentation only] I built the docs locally.
  • My contribution is harmonious with the rest of the code: I'm not introducing repetitions.
  • My code respects the adopted style, especially linting conventions.
  • The title of this PR is explanatory on its own, enough to be understood as part of a changelog.
  • I added or indicated the right labels.
  • I added information regarding the timeline of completion for this PR.
  • Please, comment on my PR while it's a draft and give me feedback on the development!

@smoia smoia added Minormod-breaking For development only, this PR increments the minor version (0.+1.0) but breaks compatibility Refactoring Improve nonfunctional attributes and bump up a minor version (0.+1.0) labels Mar 9, 2023
@smoia smoia force-pushed the master branch 2 times, most recently from 2f6f43f to 884ba21 Compare August 12, 2023 14:18
@smoia smoia changed the title Swap loops for sliding window views and refactor code to imrpove clarity and performance. All the changes contained in this version are listed in the PR specification Nov 22, 2023
@smoia smoia added the Majormod This PR breaks compatibility, and increments the major version (+1.0.0) label Nov 24, 2023
pre-commit-ci bot and others added 27 commits June 1, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Majormod This PR breaks compatibility, and increments the major version (+1.0.0) Minormod-breaking For development only, this PR increments the minor version (0.+1.0) but breaks compatibility Refactoring Improve nonfunctional attributes and bump up a minor version (0.+1.0)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants