-
Notifications
You must be signed in to change notification settings - Fork 1
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
Units with spaces #866
Units with spaces #866
Conversation
data_validator.data_dict["type"] = "int64" | ||
data_validator._prepare_model_parameter() | ||
assert isinstance(data_validator.data_dict["value"][0], int) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test for space separated units? I.e.
data_validator.data_dict["unit"] = "c t"
assert data_validator.data_dict["unit"] == "ct"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point - added a test for this.
But I don't think your assumption is right: in astropy units c t
would not resolve to ct
but to c*t
. So we should to the same thing. But note that this function is just separating the unit string; no other changes are applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okey true, thanks for adding the further tests. Looks all good now.
Thank you @tobiaskleiner |
#865 introduces an issue for combined units including spaces: e.g.,
m s
is resolved to['m','s']
.This is solved by applying this only when
value
is also of list type. Note that this is still not perfect, but works for the current model parameters.Solves also the missing correct treatment of
int
type for the string-to-list step (where thetype
field is now used to identify float entries).