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

astropy units #149

Open
jrob93 opened this issue Jun 6, 2024 · 1 comment
Open

astropy units #149

jrob93 opened this issue Jun 6, 2024 · 1 comment

Comments

@jrob93
Copy link
Collaborator

jrob93 commented Jun 6, 2024

How do we want to handle parameters that are of type "Quantity". I.e. objects that have a value and unit property https://docs.astropy.org/en/stable/units/

So far I have tried to write the PhaseCurve class such that it can handle model parameters with/without units. This is becasue sbpy expects units by default. As long as it doesn't make things tricky I would lean towards trying to use code in adler that is agnostic to variables with/without units. That being said, we will have to strip units from variables at some point anyway, in order to write values to a database.

@astronomerritt
Copy link
Collaborator

astronomerritt commented Oct 29, 2024

So the datacalasses I wrote don't care whether they're getting a Quantity or a float. It's just write-out that's problematic. I think the easiest way to handle this is to strip units before writing to a database - can also add a check to validate that the units are correct before they're removed.

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

No branches or pull requests

2 participants