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

ENH: Add cache to SpatialReferences #453

Merged
merged 3 commits into from
Jan 31, 2020

Conversation

mgxd
Copy link
Contributor

@mgxd mgxd commented Jan 29, 2020

  • adds cached property to allow checkpointing spaces.
    • this can be leveraged to differentiate user requested spaces
  • make SpatialReferences standard spaces class attribute private

@pull-assistant
Copy link

pull-assistant bot commented Jan 29, 2020

Score: 0.82

Best reviewed: commit by commit


Optimal code review plan

     enh: add cache for spaces

     Apply suggestions from code review

     Update niworkflows/utils/spaces.py

Powered by Pull Assistant. Last update 8ea3df6 ... d8c584c. Read the comment docs.

@mgxd
Copy link
Contributor Author

mgxd commented Jan 29, 2020

I'll leave this here @oesteban

@codecov
Copy link

codecov bot commented Jan 29, 2020

Codecov Report

Merging #453 into master will increase coverage by 11.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #453      +/-   ##
==========================================
+ Coverage   45.98%   57.38%   +11.4%     
==========================================
  Files          61       61              
  Lines        6048     6113      +65     
  Branches        0      710     +710     
==========================================
+ Hits         2781     3508     +727     
+ Misses       3267     2547     -720     
- Partials        0       58      +58
Flag Coverage Δ
#reportlettests 100% <ø> (?)
#unittests 46.06% <100%> (+0.08%) ⬆️
Impacted Files Coverage Δ
niworkflows/utils/spaces.py 94.3% <100%> (+0.34%) ⬆️
niworkflows/utils/misc.py 80% <0%> (+0.2%) ⬆️
niworkflows/interfaces/registration.py 52.15% <0%> (+3.44%) ⬆️
niworkflows/func/util.py 28% <0%> (+4%) ⬆️
niworkflows/interfaces/plotting.py 84.74% <0%> (+10.16%) ⬆️
niworkflows/interfaces/mni.py 42.28% <0%> (+16.57%) ⬆️
niworkflows/interfaces/masks.py 62.87% <0%> (+18.56%) ⬆️
niworkflows/interfaces/report_base.py 68.85% <0%> (+21.31%) ⬆️
niworkflows/viz/plots.py 46.31% <0%> (+39.69%) ⬆️
niworkflows/viz/utils.py 74.09% <0%> (+64.5%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0421e6f...d8c584c. Read the comment docs.

Copy link
Member

@oesteban oesteban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether we should accept several checkpoints, instead of raising error. (and provide access to earlier timepoints).

niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
niworkflows/utils/spaces.py Outdated Show resolved Hide resolved
mgxd and others added 2 commits January 31, 2020 15:40
Co-Authored-By: Oscar Esteban <code@oscaresteban.es>
Co-Authored-By: Oscar Esteban <code@oscaresteban.es>
@mgxd mgxd merged commit 8e42c6c into nipreps:master Jan 31, 2020
@mgxd mgxd deleted the enh/spatial-ref-outputs branch January 31, 2020 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants