On Thu, 7 Apr 2022 at 01:18, Brian McCall <brian.patrick.mcc...@gmail.com> wrote: > >> Please can you explain this to me? I don't know what you mean by "get the >> final answer", nor do I know how astropy.units is relevant. Units seems to >> be a perfectly acceptable library without astropy, is that not the case? > > Am I mistaken, or is the units module no longer maintained? I could not find > any documentation for it. Which is also a con. I honestly thought that > "units" took on a new life as "astropy.units".
I honestly have no idea. I simply did `pip install units` and it worked. If the units module is no longer maintained, then who would write (and maintain) a module that worked with any core python syntax to allow units to be added to quantities? (Note that any core feature would simply allow something like 3_ft to be written to mean the number 3, with some object associated with the name "ft" attached to it - it would be up to a 3rd party module to actually implement the units calculations). It doesn't look like the astropy people want to maintain a generalised units library if they are solely working with numpy arrays. Also, you didn't explain what you meant by "get the final answer" - I'm still not clear with what you want beyond doing the calculation as you showed in your code. > > As has been mentioned, if you don't like "units." then "from astropy import > > units as U" and use "U.ms" of "from astropy.units import ms" and use ms > > directly. > > As an fyi, lots of single-letter variables are commonly used to match > variables in physics and engineering equations. U and u are of particular > importance in my field. > > > Don't use "import *" then, just import the names you need. > > Still rules out a lot of commonly used variables. ¯\_(ツ)_/¯ If your community typically uses short and frequently clashing names, relying on context and intuition to distinguish them, there's nothing a library or language feature can do to help with that... As I said, there have to be some compromises made. Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PZ2RDAO4MGPL46BR6C36BKU4IQUP6WJO/ Code of Conduct: http://python.org/psf/codeofconduct/