amusecode / amuse

Astrophysical Multipurpose Software Environment. This is the main repository for AMUSE
http://www.amusecode.org
Apache License 2.0
152 stars 98 forks source link

split off astronomical constants from units #1059

Open rieder opened 1 month ago

rieder commented 1 month ago

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

rieder commented 1 month ago

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.

LourensVeen commented 1 month ago

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?

rieder commented 2 weeks ago

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 commented 2 weeks ago

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