Skip to content

Conversation

@sr525
Copy link
Collaborator

@sr525 sr525 commented Nov 19, 2025

No description provided.

@sr525 sr525 force-pushed the tickets/DM-51162 branch 15 times, most recently from 8694c7b to 33b42d4 Compare November 20, 2025 19:42
yLimits = ListField[float](doc="Plotting limits for the y axis.", default=[-10.0, 60.0])
autoAxesLimits = Field[bool](doc="Find axes limits automatically.", default=True)
dpi = Field[int](doc="DPI size of the figure.", default=500)
figureSize = ListField[float](doc="Size of the figure.", default=[9.0, 3.5])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have removed these because the figures are getting very large and taking a long time to get from the butler. The figure size now also needs to be very specific and if you change it nothing will line up. If this becomes a problem for @erinleighh then I will make a better fix on another ticket in the future.

@jrmullaney jrmullaney self-requested a review November 24, 2025 13:08
Copy link
Contributor

@jrmullaney jrmullaney left a comment

Choose a reason for hiding this comment

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

Generally looks fine.
I wonder whether there should be catches in case both low and high thresholds aren't specified. It could be that one always needs to specify lowThreshold and highThreshold in the yaml file, but I think the code should be able to handle one of them being None or Nan or something similar to indicate that it hasn't got a lower/upper threshold.

default=None,
)
addThreshold = Field[bool](
doc="Read in the predefined threshold and add it to the histogram.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be "threshold(s)"? Aren't there often more than one thresholds per metric?
Also, suggest "indicate it on the histogram" rather than "add".

ax.axvline(meds[i], ls=(0, (5, 3)), lw=1, c=colors[i])
if self.panels[panel].addThreshold and hist in metricDefs:
lowThreshold = metricDefs[hist]["lowThreshold"]
highThreshold = metricDefs[hist]["highThreshold"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this assume that there will always be a "lowThreshold" and a "highThreshold" for each metric in the yaml file.
Will that always be the case?
Will it break meaningfully if someone doesn't include either a "lowThreshold" or a "highThreshold" when they add a new metric to the metricInformation.yaml file, or do we want it to be ok with adding just a single line?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I would prefer if people always added a sensible value for both however I have added catches for infinite values and only one of the thresholds, or neither, being present.

labelTracts = Field[bool](doc="Label the tracts.", default=False)

addThreshold = Field[bool](
doc="Read in the predefined threshold and add it to the histogram.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as for the same config in histPlot.py.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
doc="Read in the predefined threshold and add it to the histogram.",
doc="Read in the predefined thresholds and indicate them on the histogram.",

-------
text : `str`
A string containing the 5 tracts with the largest outlier values.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this say "10 tracts" now?

# Sort values in descending (-) absolute value order discounting
# NaNs.
maxInds = np.argsort(-np.abs(outlierValues))
# Show up to five values on the plot.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this say "up to ten values" now?

dataName = self.zAxisLabel.format_map(kwargs)
colBarVals = np.array(colBarVals)
if self.addThreshold and dataName in metricDefs:
lowThreshold = metricDefs[dataName]["lowThreshold"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, just wondering whether there should be a catch in cases where there isn't both a lower and upper threshold in metricInformation.
Or what happens if one of them is Nan or None.

ax1.yaxis.tick_right()

if self.addThreshold and dataName in metricDefs:
ax1.axvline(lowThreshold, color=accent_color())
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, will we always have upper and lower thresholds?
What if one of these is Nan or None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've caught this but if people go around setting the thresholds to NaN I will be irritated.

@sr525 sr525 force-pushed the tickets/DM-51162 branch 3 times, most recently from f6e24a3 to 08b72d8 Compare November 24, 2025 23:18
Copy link
Contributor

@jrmullaney jrmullaney left a comment

Choose a reason for hiding this comment

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

Just a couple of typos - you can just accept my suggestions on github, if you like.

default=None,
)
addThresholds = Field[bool](
doc="Read in the predefined threshold and indicate it on the histogram.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
doc="Read in the predefined threshold and indicate it on the histogram.",
doc="Read in the predefined thresholds and indicate them on the histogram.",

labelTracts = Field[bool](doc="Label the tracts.", default=False)

addThreshold = Field[bool](
doc="Read in the predefined threshold and add it to the histogram.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
doc="Read in the predefined threshold and add it to the histogram.",
doc="Read in the predefined thresholds and indicate them on the histogram.",

@sr525 sr525 merged commit 20a5142 into main Dec 1, 2025
13 checks passed
@sr525 sr525 deleted the tickets/DM-51162 branch December 1, 2025 17:35
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.

3 participants