-
Notifications
You must be signed in to change notification settings - Fork 49
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
BUGFIX fix issue with with_units
causing a loss of array entries
#563
base: master
Are you sure you want to change the base?
BUGFIX fix issue with with_units
causing a loss of array entries
#563
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #563 +/- ##
==========================================
- Coverage 86.04% 86.02% -0.02%
==========================================
Files 27 27
Lines 4048 4050 +2
==========================================
+ Hits 3483 3484 +1
- Misses 565 566 +1 ☔ View full report in Codecov by Sentry. |
Would it be possible to fix LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JWST unit tests are failing with this PR.
Just fixed this. |
be43dfe
to
cb852c0
Compare
cb852c0
to
13cc195
Compare
This was largely an issue of the zip(strict=False) causing missed entries. I made this strict=True
…trip to directly on the bounding box
13cc195
to
fce7ed1
Compare
This fixes #559
The issue is that
with_units
was accidentally loosing elements of an array for "vector" values. That is if your in the 1D case and your shape is(n,)
instead of(1, n)
the only the first entry of the vector was returned in the "high-level" object.The issue was due to a
zip(arrays, units, strict=False)
loosing things because there were morearrays
entries thanunits
entries. The issue is that for the "vector" the zip will iterate over each of the entries in the vector, where as a 1D array would just iterate once yielding the entire "vector" entry.The solution is twofold:
gwcs
.naxes==1
before the zip and wrapping the "vector" into a tuple.