-
Notifications
You must be signed in to change notification settings - Fork 4
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
Valid VOUnits fail check_units #125
Comments
We currently process units generically in validation like this:
Though the field in the YAML is In order to enable the IVOA unit parsing, I need to identify and test an astropy release which has a fix for this issue. If you have any suggestions on interim solutions, please let me know. |
After a little investigation, I found that the fix for raising errors with VO units seems to have made it into the astropy This command results in an exception being thrown, which is the desired behavior:
So we should be able to switch over to using the VO unit parser. There is an existing ticket in the Jira on which the work will be done. |
The plot thickens because Rubin is waiting on a fix for astropy/astropy#17528 before updating to But I'm thinking of implementing this with a check on astropy version which would use the old behavior as a fallback. Then you could use astropy |
@jwfraustro It seems like astropy's VO Unit parse doesn't like your unit string:
So I guess my suggested remedy is not going to fix this... |
Sorry for having to open this issue, because I don't see a super-quick way to remedy it. :(
There are certain units that are valid VOUnits, but are not correctly supported by astropy, which means they will fail the
@model_validator
for a Column.An example:
Failing here:
felis/python/felis/datamodel.py
Lines 264 to 272 in 71dbc85
The syntax of
log(solMass)
is valid according to the VOUnit standard, however, astropy'sunits.Unit
(or evenunits.format.VOUnit
) doesn't support it. There are a large number of astropy issues (and more) about this.I'm open to suggestions on how to tackle this. I usually hate options that let you bypass validation, but maybe it's possible?
The text was updated successfully, but these errors were encountered: