-
Notifications
You must be signed in to change notification settings - Fork 8
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
DM-48256: Fix RunTimeError 'Record data is not contiguous in memory.' when running subtraction #369
base: main
Are you sure you want to change the base?
Conversation
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.
Could we get a unittest that confirms the bug is fixed? Because as coded, this wouldn't fix it (and I'm now not sure what the underlying bug truly is anyway!).
@@ -853,6 +853,10 @@ def _checkMask(mask, sources, excludeMaskPlanes, checkAdjacent=True): | |||
xv = (np.rint(sources.getX() - mask.getX0())).astype(int) | |||
yv = (np.rint(sources.getY() - mask.getY0())).astype(int) | |||
|
|||
# The source catalog may not be contiguous. |
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.
I don't think this comment is necessary: the lines below say the same thing.
@@ -853,6 +853,10 @@ def _checkMask(mask, sources, excludeMaskPlanes, checkAdjacent=True): | |||
xv = (np.rint(sources.getX() - mask.getX0())).astype(int) | |||
yv = (np.rint(sources.getY() - mask.getY0())).astype(int) | |||
|
|||
# The source catalog may not be contiguous. | |||
if not sources.isContiguous(): |
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.
I'm pretty sure this is too late to fix the problem, since the error report has it coming from the xv=...
line above. When I said line 854, it must have been on a different version of the file. What I had meant was just after the call to self.sourceSelector.selectSources
in _sourceSelector()
. Except _checkMask
is called on sources
, not selected
, so I don't see how it could fail in this way, unless the input catalog is broken somehow?
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.
I put the putative fix in _checkMask
because it operates on the source table in question, but you're probably right that this would best be handled earlier.
209be87
to
4dbfa54
Compare
I'd like to add a unit test but I'm not sure how to make a non-contiguous source catalog on purpose. I think the test would best go here; I can work on this tomorrow. |
I think we need to find out how this was triggered in this first place. I posted a followup question on the ticket, because it doesn't seem possible to have failed with a non-contiguous, unmodified catalog. |
No description provided.