Catch a (0,) dimensionality issue on spectral axis in beamcon_3D#88
Merged
Conversation
AlecThomson
reviewed
Apr 20, 2026
Owner
AlecThomson
left a comment
There was a problem hiding this comment.
All looks pretty reasonable to me! I'm going to make a slight change from a type check to a scalar check. Any idea which version of astropy+numpy caused this issue?
AlecThomson
added a commit
that referenced
this pull request
Apr 20, 2026
* additional check around (0,) dim spectral axis (#88) Co-authored-by: Tim Galvin <gal16b@petrichor-i3.cm.cluster> * Use scalar test * Lint --------- Co-authored-by: tjgalvin <tjgalvin@users.noreply.github.com> Co-authored-by: Tim Galvin <gal16b@petrichor-i3.cm.cluster> Co-authored-by: Alec Thomson <alec.thomson@skao.int>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently installed a new environment for some racs-all testing and started to run into a strange issue.
Digging into this is appears as though a numpy array of length 1 is being returned in the
spec_axis.wcs.crpixWCS instance. The attempt tointtherefore fails, even though the array was of length 1. I am not sure if this was a change in numpy or astropy, as it honestly could be either. I am relatively certain it is not afitscubeissue as the cube there has gone through theastropy.io.fitsinfrastructure, and read in as such correctly as well.This PR has a type check, and if a numpy array is found it is first squeezed before passing through the int typecast. I believe it is a backwards compatible change, i.e. whatever changed in whatever dependency will contrinue to work.