-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
Angle units hstr() and dstr() format unnecessary not fitting #513
Comments
That looks to my eyes like “12 days, 7 minutes, 30 seconds” when I read it, and double-checking against https://en.wikipedia.org/wiki/International_System_of_Units confirms that I wish the string could have included the official symbol “°” for degree, but that would have caused problems under Python 2, and also for anyone without a Unicode display. Also, we can't change that default without changing the behavior of all the programs that already use that method. What if |
That would be even a better idea. I also would think about using this fmt parameter for hstr() as well. So the user could decide about the interpretation. |
Another chance might be: |
By the hyphens, I assume you mean the quote and double-quote. The quote and double-quote stand in for the prime and double-prime that are really the official way those units are written. I will be avoiding "m" and "s" because (a) that looks too much like minutes and seconds of time, since "s" is the official SI unit of time abbreviation, and (b) because existing programs already count on exactly that string being returned — if existing users, for example, use But adding a |
Let's go your proposed path. It makes a lot of sense. Many thanks and Merry Christmas ! |
I just made a new release, and format strings are now offered by both methods: https://rhodesmill.org/skyfield/api-units.html#formatting-angles Enjoy! |
@brandon-rhodes
It is not an big issue but from user side it hurts me. If you have an angle defined and use
angle.hstr(), you get a format like 12h 07m 30.00s
if you use
angle.dstr(), you get a format like 181deg 52' 30.0"
So in one you have hyphens in the other m and s. So my proposal would be to change dstr() to:
12d 07m 30.00s
Does this makes sense for you ?
Michel
The text was updated successfully, but these errors were encountered: