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

Fix division by zero error when a dim is size 1 #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kamesy
Copy link

@kamesy kamesy commented Oct 3, 2023

When one of the sizes in the header is 1, startstoplen divides by 0. An example header:

...
dimension: 4
space: right-anterior-superior
sizes: 64 128 128 1
space directions: none (-0.12,0,0) (0,0,0.12) (0,0.12,0)
kinds: list domain domain domain
...

I ended up replacing startstep/startstop altogether in favour of Base.range.

@codecov
Copy link

codecov bot commented Oct 3, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (9578df7) 86.64% compared to head (d0e837f) 85.85%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
- Coverage   86.64%   85.85%   -0.80%     
==========================================
  Files           1        1              
  Lines         644      608      -36     
==========================================
- Hits          558      522      -36     
  Misses         86       86              
Files Coverage Δ
src/NRRD.jl 85.85% <94.33%> (-0.80%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# also check for a time axis
istime = falses(nd)
isspace = falses(nd)
is_time = falses(nd)
Copy link
Member

Choose a reason for hiding this comment

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

Hi, thank you for the contribution! Can you please separate out the style/formatting changes from functional changes?

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