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-48137: Remove units from metric when writing to metric table #331

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jrmullaney
Copy link
Contributor

No description provided.

@jrmullaney jrmullaney force-pushed the tickets/DM-48137 branch 3 times, most recently from 57825c1 to da3ee4f Compare December 13, 2024 18:54
And add the units to the column headings of the astropy Table
metricsDict[fullName] = [metric.quantity.value]
# "Dimensionless" and percent units not allowed in Tables:
if metric.quantity.unit is not u.dimensionless_unscaled and metric.quantity.unit is not u.pct:
metricUnits[fullName] = metric.quantity.unit
Copy link

Choose a reason for hiding this comment

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

Would it make sense to raise some error here if the unit were not of an allowed type? At the moment, it's just as no-op.

Copy link
Contributor Author

@jrmullaney jrmullaney Dec 21, 2024

Choose a reason for hiding this comment

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

Thanks for querying this. dimensionless_unscaled just means the metric doesn't have a unit associated with it, so there's nothing to put in the table anyway. In that case an error or warning isn't appropriate - it would effectively be raising an error to say that a metric doesn't have a unit (which is fine).

In the case of percent, I think a warning would be more appropriate; I don't think we want to stop the use of percent units in metrics, we'd just want to warn people that this unit is not being propagated to the table.

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.

2 participants