amuse icon indicating copy to clipboard operation
amuse copied to clipboard

split off astronomical constants from units

Open rieder opened this issue 1 year ago • 5 comments

Astronomical constants have changed, this is part of an effort to make these easier updateable. units.py should not contain changeable values anymore.

rieder avatar Jun 14 '24 13:06 rieder

There is no constant for metallicity. The closest would be 'solar metallicity', but even for that there isn't a generally accepted constant value. Splitting up the units might be a good idea.

rieder avatar Jun 20 '24 17:06 rieder

Yeah, and it's a fraction anyway, right? It just occurred to me that metallicity was at the bottom of the file, amidst degrees and grams and centimeters which are not discipline-specific. Anyway, something for later. Will you merge this?

LourensVeen avatar Jun 21 '24 07:06 LourensVeen

There's a remaining issue: names are used both for the constants and for the unit based on the constant. So we need to rethink this or be very careful with namespaces. Something that does from amuse.units.constants import * will now cause problems - as is the case in one of the tests (test_pickle.py). Then again of course, this is /exactly/ the reason why you should never import *...

rieder avatar Jul 08 '24 10:07 rieder

(Of course I'm violating that "rule" myself in a commit only minutes after posting this...)

rieder avatar Jul 08 '24 11:07 rieder

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 28 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 06 '24 16:09 stale[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 365 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 18 '25 21:11 stale[bot]