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-38246: SourceDetectionTask will not detect on pixels flagged as NO_DATA or EDGE #261
Conversation
tests/test_detectAndMeasure.py
Outdated
"xSize": xSize, "ySize": ySize} | ||
dipoleFlag = "ip_diffim_DipoleFit_flag_classification" | ||
# kwargs = {"seed": staticSeed, "psfSize": 2.4, "fluxLevel": fluxLevel, "fluxRange": fluxRange, | ||
# "nSrc": nSources} |
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.
Commented lines here look like relics.
else: | ||
self.assertEqual(np.sum(~goodSrcFlags), 0) | ||
for diaSource, goodSrcFlag in zip(output.diaSources, goodSrcFlags): | ||
if ~goodSrcFlag: |
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.
What type is goodSrcFlag
here, and why ~
instead of not
? I'm used to seeing that elementwise inversion of numpy arrays, but you also can't test for the truthiness of an entire array like this, so I wonder if you really mean if not goodSrcFlag.any()
here.
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.
This test is a little simpler than that: it's iterating through all of the sources, so goodSrcFlag
is a single boolean. I could certainly change that to not goodSrcFalg
for readability.
else: | ||
self.assertEqual(np.sum(~goodSrcFlags), 0) | ||
for diaSource, goodSrcFlag in zip(output.diaSources, goodSrcFlags): | ||
if ~goodSrcFlag: |
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.
Same comment as in the other test method.
382ad3a
to
35e975a
Compare
35e975a
to
bfdd4cc
Compare
bfdd4cc
to
530f9ae
Compare
No description provided.