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 GIFTI object __repr__ methods #1092

Merged
merged 1 commit into from
Feb 25, 2022

Conversation

effigies
Copy link
Member

Helps with working on BIAP9, but long overdue.

Being able to quickly view data array intent and shape was the motivator here.

Helps with working on BIAP9, but long overdue
@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #1092 (e1db333) into master (1e93bd5) will decrease coverage by 0.10%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1092      +/-   ##
==========================================
- Coverage   92.33%   92.23%   -0.11%     
==========================================
  Files          99       99              
  Lines       12219    12231      +12     
  Branches     2392     2392              
==========================================
- Hits        11283    11281       -2     
- Misses        612      624      +12     
- Partials      324      326       +2     
Impacted Files Coverage Δ
nibabel/gifti/gifti.py 93.27% <33.33%> (-2.18%) ⬇️
nibabel/nifti1.py 92.13% <0.00%> (-0.61%) ⬇️
nibabel/volumeutils.py 93.73% <0.00%> (-0.44%) ⬇️

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 1e93bd5...e1db333. Read the comment docs.

@effigies
Copy link
Member Author

@htwangtw @jbteves Could I bug one of you for a review of this and #1091? As the most recent to play with GIFTI that I know of...

@jbteves
Copy link

jbteves commented Feb 25, 2022

Ping me if you haven't heard by 3 EST tomorrow

@@ -375,6 +390,9 @@ def __init__(self,
self.ext_offset = ext_offset
self.dims = [] if self.data is None else list(self.data.shape)

def __repr__(self):
return f"<GiftiDataArray {intent_codes.label[self.intent]}{self.dims}>"
Copy link

Choose a reason for hiding this comment

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

Not knowing how this would work precisely, do you maybe need a space?

Suggested change
return f"<GiftiDataArray {intent_codes.label[self.intent]}{self.dims}>"
return f"<GiftiDataArray {intent_codes.label[self.intent]} {self.dims}>"

Copy link
Member Author

Choose a reason for hiding this comment

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

This currently shows as: <GiftiDataArray pointset[32492, 3]>. Your change would make it <GiftiDataArray pointset [32492, 3]>. I don't have a strong opinion on the aesthetics here.

Copy link

Choose a reason for hiding this comment

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

This is just me being nitpicky, I think. I also have no strong opinion but I know spaces are easy to miss in the f-strings when they get crowded like that.

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!

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!

@effigies
Copy link
Member Author

Thanks for the reviews!

@effigies effigies merged commit e7e1d46 into nipy:master Feb 25, 2022
@effigies effigies deleted the enh/gifti_reprs branch February 25, 2022 15:01
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