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

Types of solar units are confusing #87

Open
ngoldbaum opened this issue May 18, 2019 · 3 comments
Open

Types of solar units are confusing #87

ngoldbaum opened this issue May 18, 2019 · 3 comments

Comments

@ngoldbaum
Copy link
Member

ngoldbaum commented May 18, 2019

This is weird:

In [1]: import unyt                                                             
In [2]: type(unyt.msun)                                                         
Out[2]: unyt.array.unyt_quantity

In [3]: type(unyt.Msun)                                                         
Out[3]: unyt.array.unyt_quantity

In [4]: type(unyt.unit_symbols.Msun)                                            
Out[4]: unyt.unit_object.Unit

In [5]: unyt.unit_symbols.msun                                                  
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-52dd1f84adcb> in <module>
----> 1 unyt.unit_symbols.msun

AttributeError: module 'unyt.unit_symbols' has no attribute 'msun'

In [6]: unyt.physical_constants.msun                                            
Out[6]: unyt_quantity(1.98841586e+30, 'kg')

In [7]: unyt.physical_constants.Msun                                            
Out[7]: unyt_quantity(1.98841586e+30, 'kg')

In [8]: unyt.unit_symbols.Msun                                                  
Out[8]: Msun

It was also confusing in the real world.

I'd like to get rid of unyt.physical_constants.Msun and unyt.physical_constants.msun and add a unyt.unit_symbols.msun but I think that might break code...

@ngoldbaum
Copy link
Member Author

ping @JBorrow

@jzuhone
Copy link
Contributor

jzuhone commented Jun 3, 2019

I'd prefer unyt.unit_symbols.Msun.

Maybe we need a separate module within unit for solar system masses / properties as unyt_quantity objects?

e.g.

from unyt.solar_system import Msun, Earth

@JBorrow
Copy link
Contributor

JBorrow commented Nov 27, 2019

There's also Solar_Mass which in some ways addresses this issue. It would be nice to define unyt.msun as 1 * unyt.Solar_Mass (or as an alias for it, actually).

P.S. There is also solar_mass which is inconsistent with Solar_Mass:

In [1]: unyt.solar_mass                                                                                                                                                             
Out[1]: unyt_quantity(1.98841586e+30, 'kg')

In [2]: unyt.Solar_Mass                                                                                                                                                             
Out[2]: Msun

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

3 participants