8000 TYP: Annotate loadsave and image header classes by effigies · Pull Request #1213 · nipy/nibabel · GitHub
[go: up one dir, main page]

Skip to content

TYP: Annotate loadsave and image header classes #1213

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

Merged
merged 3 commits into from
Apr 3, 2023

Conversation

effigies
Copy link
Member

nb.load() and (to some extent) nb.save() are probably the most used functions. They should have some signatures, though the usefulness is bounded as the type checker can't infer the resulting type from the filename.

While testing this on a code base I'm writing to be type-checked from the start, I found that everything declared itself as having a FileBasedHeader, which is not very useful. I can't come up with something type-variable-ish so that we can deduplicate these and rely on the header_class, but oh well.

@codecov
Copy link
codecov bot commented Mar 26, 2023

Codecov Report

Patch coverage: 94.28% and no project coverage change.

Comparison is base (40e31e8) 92.16% compared to head (9f189c6) 92.16%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1213   +/-   ##
=======================================
  Coverage   92.16%   92.16%           
=======================================
  Files          98       98           
  Lines       12366    12372    +6     
  Branches     2545     2543    -2     
=======================================
+ Hits        11397    11403    +6     
  Misses        646      646           
  Partials      323      323           
Impacted Files Coverage Δ
nibabel/nifti1.py 92.76% <50.00%> (ø)
nibabel/analyze.py 98.59% <100.00%> (ø)
nibabel/brikhead.py 97.51% <100.00%> (+0.01%) ⬆️
nibabel/cifti2/cifti2.py 96.86% <100.00%> (+<0.01%) ⬆️
nibabel/ecat.py 88.21% <100.00%> (ø)
nibabel/filebasedimages.py 97.29% <100.00%> (-0.04%) ⬇️
nibabel/freesurfer/mghformat.py 95.08% <100.00%> (+0.02%) ⬆️
nibabel/imageclasses.py 100.00% <100.00%> (ø)
nibabel/loadsave.py 70.53% <100.00%> (-0.77%) ⬇️
nibabel/minc1.py 90.36% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@effigies effigies requested a review from ZviBaratz March 28, 2023 20:08
@effigies effigies added this to the 5.1.0 milestone Mar 29, 2023
@effigies effigies merged commit ed95d8d into nipy:master Apr 3, 2023
@effigies effigies deleted the typ/loadsave branch August 31, 2023 19:00
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
0