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

Fixed a bug for dst_center parameter of select_region_view function #14

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

hzarei4
Copy link
Contributor

@hzarei4 hzarei4 commented Feb 29, 2024

There was a bug in line 163 of file selection_tools.jl which does not accept element-wise subtraction of two tuples with different numbers of dimensions for dst_center and center.

The error was for example:

ERROR: DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 3 and 4
Stacktrace:
  [1] _bcs1
    @ Base.Broadcast .\broadcast.jl:555 [inlined]
  [2] _bcs
    @ Base.Broadcast .\broadcast.jl:549 [inlined]
  [3] broadcast_shape(::Tuple{Base.OneTo{Int64}}, ::Tuple{Base.OneTo{Int64}})
    @ Base.Broadcast .\broadcast.jl:543
  [4] combine_axes
    @ .\broadcast.jl:524 [inlined]
  [5] _axes
    @ .\broadcast.jl:236 [inlined]
  [6] axes
    @ .\broadcast.jl:234 [inlined]
  [7] combine_axes
    @ .\broadcast.jl:524 [inlined]
  [8] _axes
    @ .\broadcast.jl:236 [inlined]
  [9] axes
    @ .\broadcast.jl:234 [inlined]
 [10] copy
    @ .\broadcast.jl:1115 [inlined]
 [11] materialize
    @ .\broadcast.jl:903 [inlined]
 [12] select_region_view(src::Array{…}; new_size::Tuple{…}, center::NTuple{…}, dst_center::Tuple{…}, pad_value::Float64)
    @ NDTools D:\Hossein\Programming\Julia\NDTools.jl\src\selection_tools.jl:169
 [13] top-level scope
    @ REPL[85]:1
Some type information was truncated. Use `show(err)` to see complete  #types.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.92%. Comparing base (6aa480c) to head (30426fc).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #14   +/-   ##
=======================================
  Coverage   91.92%   91.92%           
=======================================
  Files          11       11           
  Lines         223      223           
=======================================
  Hits          205      205           
  Misses         18       18           

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

@roflmaostc
Copy link
Member

Thanks, lgtm

@roflmaostc roflmaostc merged commit 950df66 into bionanoimaging:main Feb 29, 2024
4 checks passed
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