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

DM-22803: Only make a plot if there are data to plot #112

Merged
merged 1 commit into from Jan 8, 2020

Conversation

timj
Copy link
Member

@timj timj commented Jan 7, 2020

There is a bug in matplotlib3.1/astropy4 that now leads to
the second plot raising an exception if there are no
data. For now workaround by not even trying to do the plot.

See Astropy issue: astropy/astropy#9841

There is a bug in matplotlib3.1/astropy4 that now leads to
the second plot raising an exception if there are no
data. For now workaround by not even trying to do the plot.

See Astropy issue: astropy/astropy#9841
Copy link
Contributor

@SimonKrughoff SimonKrughoff left a comment

Choose a reason for hiding this comment

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

Minor comment. Otherwise looks good.

@@ -118,8 +118,9 @@ def plotAstrometryErrorModel(dataset, astromModel, outputPrefix=''):

ax[0].hist(dist, bins=100, color=color['all'],
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we confident that dist will always be non-zero length, or is the statement that if dist is zero length we better except because we have bigger problems?

Copy link
Member Author

Choose a reason for hiding this comment

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

I hadn't really thought about the general case of someone passing in an empty dataset for plotting. Maybe it should raise a ValueError as soon as numMatched is calculated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or maybe you expect an empty plot? I'll merge this as is and worry about the other problem later.

@timj timj merged commit 24e56ef into master Jan 8, 2020
@timj timj deleted the tickets/DM-22803 branch January 8, 2020 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants