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-40180: Remove 'all' histograms from scatter plot with two hists #137

Merged
merged 2 commits into from Feb 12, 2024

Conversation

sr525
Copy link
Collaborator

@sr525 sr525 commented Jul 25, 2023

No description provided.

@sr525 sr525 force-pushed the tickets/DM-40180 branch 4 times, most recently from 75879bd to a8af0e8 Compare July 25, 2023 14:44
@sr525 sr525 force-pushed the tickets/DM-40180 branch 2 times, most recently from 411a041 to b363d11 Compare January 20, 2024 00:13
x_all = data[f"x{self._datatypes['any'].suffix_xy}"]
keys_notall = [x for x in self.plotTypes if x != "any"]
if "all" in self.plotTypes:
x_all = f"x{self._datatypes['all'].suffix_xy}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Mix of " vs '.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It needs both to have the string key inside the string.

if "all" in self.plotTypes:
x_all = f"x{self._datatypes['all'].suffix_xy}"
keys_notall = [x for x in self.plotTypes if x != "all"]
topHist.hist(x_all, bins=bins, color="grey", alpha=0.3, log=True, label=f"All ({len(x_all)})")
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are you still defining an x_all below the else? Ditto for y_all below. Actually, you can probably move this setting of keys_notall above the if and just get rid of the else? Same below, again.

Copy link
Collaborator Author

@sr525 sr525 Feb 6, 2024

Choose a reason for hiding this comment

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

The all should probably be any which brings it in line with the key used in the datatype option. It is for if people don't care if it is a star or a galaxy and just want to plot everything. I have changed the alls -> anys in a hope to make this clearer.

@@ -711,17 +711,17 @@ def _makeSideHistogram(
) -> None:
# Side histogram
sideHist = figure.add_subplot(gs[1:, -1], sharey=ax)
Copy link
Contributor

Choose a reason for hiding this comment

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

Pre-existing, but there is a rogue # Side histogram comment at line 701.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This comment is just reminding people that they are in the chunk that defines the side histogram.

if "any" in self.plotTypes:
x_all = data[f"x{self._datatypes['any'].suffix_xy}"]
keys_notall = [x for x in self.plotTypes if x != "any"]
if "all" in self.plotTypes:
Copy link
Contributor

Choose a reason for hiding this comment

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

I don’t know what any actually means in this context, but now the behaviour is that it considered a notall key. Does this still do the “right thing”?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should all be any, not sure what I was doing here.

@sr525 sr525 merged commit cf09fa8 into main Feb 12, 2024
8 checks passed
@sr525 sr525 deleted the tickets/DM-40180 branch February 12, 2024 21:10
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