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

RF: Unify Caret-XML-style metadata structure as dict-like #1091

Merged
merged 7 commits into from
Feb 25, 2022

Conversation

effigies
Copy link
Member

We have two implementations of the same structure in GIFTI and CIFTI-2. The Cifti one is much nicer to deal with, but also a little short of a straight drop-in replacement for dict().

Spurred by writing a parser for CaretSpecFiles in #1090. Mostly used the Cifti implementation, but dropped the difference_update() (not sure why this exists, so don't want to copy it without a use case). Used a private _data object to allow the GiftiMetaData.data to be a deprecated list view.

Scheduled dropping most of the custom bits of each subclass for 6.0 to give a good long warning period.

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #1091 (6bc86df) into master (e7e1d46) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1091      +/-   ##
==========================================
+ Coverage   92.27%   92.29%   +0.02%     
==========================================
  Files          99      100       +1     
  Lines       12228    12247      +19     
  Branches     2392     2393       +1     
==========================================
+ Hits        11283    11303      +20     
  Misses        621      621              
+ Partials      324      323       -1     
Impacted Files Coverage Δ
nibabel/cifti2/cifti2_axes.py 98.52% <ø> (+0.17%) ⬆️
nibabel/caret.py 100.00% <100.00%> (ø)
nibabel/cifti2/cifti2.py 96.65% <100.00%> (-0.04%) ⬇️
nibabel/gifti/gifti.py 93.23% <100.00%> (-0.04%) ⬇️
nibabel/gifti/parse_gifti_fast.py 86.12% <100.00%> (+0.05%) ⬆️

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 e7e1d46...6bc86df. Read the comment docs.

Copy link

@jbteves jbteves left a comment

Choose a reason for hiding this comment

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

LGTM with the caveat that I'm not sure what the approval checklist for nibabel looks like 😉

Copy link
Contributor

@htwangtw htwangtw left a comment

Choose a reason for hiding this comment

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

LGTM! A more parsable gifti metadata makes me really happy.

@effigies
Copy link
Member Author

@effigies effigies force-pushed the enh/unify_xml_metadata branch from a95ff51 to 6bc86df Compare February 25, 2022 15:11
@effigies effigies merged commit 75c2b85 into nipy:master Feb 25, 2022
@effigies effigies deleted the enh/unify_xml_metadata branch February 25, 2022 15:44
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.

3 participants