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

Fix to IterativelySubtractedPSFPhotometry failing when Finder does not return None if no sources are detected #986

Merged
merged 2 commits into from
Nov 15, 2019

Conversation

Onoddil
Copy link
Contributor

@Onoddil Onoddil commented Nov 14, 2019

Currently the _do_photometry loop of IterativelySubtractedPSFPhotometry assumes that if no sources are detected then the returned variable will be None. If a user provides a custom finder which instead returns an empty Table object, this won't be caught by the while loop and will error. This PR makes a simple fix to this, adding a check for a zero-length variable returned by self.finder in addition to a None variable.

This PR blocks #740, which needs this PR merged before one of its tests will pass.

@astropy-bot astropy-bot bot added the psf label Nov 14, 2019
@eteq eteq added this to the 0.7.2 milestone Nov 15, 2019
Copy link
Member

@eteq eteq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm milestoning this for 0.7.2 since it's a bug fix, which then means the changelog needs to be moved. But perhaps @larrybradley can chime in to confirm he agrees it can go in 0.7.2 ?

Copy link
Member

@larrybradley larrybradley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I agree it's a bug fix that can go in 0.7.2.

…hich does not return None when no sources are detected would throw an error, failing to be caught by the while loop
@Onoddil Onoddil force-pushed the psf_photometry_finder_none_fix branch from 1631aa9 to 74e27d6 Compare November 15, 2019 16:23
@Onoddil
Copy link
Contributor Author

Onoddil commented Nov 15, 2019

Fair enough -- moved the changelog to 0.7.2 :)

@eteq eteq merged commit e15b3a1 into astropy:master Nov 15, 2019
@Onoddil Onoddil deleted the psf_photometry_finder_none_fix branch November 15, 2019 19:47
larrybradley pushed a commit that referenced this pull request Dec 7, 2019
Fix to IterativelySubtractedPSFPhotometry failing when Finder does not return None if no sources are detected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants