Unicode support for astropy units
See original GitHub issueDealing with unit strings received from somewhere, it would be nice if astropy supported common unicode symbols.
E.g.
import astropy.units as u
u.Unit('µg') # MICRO SIGN (U+00B5)
u.Unit('μm') # GREEK SMALL LETTER MU (U+03BC)
u.Unit('m²') # SUPERSCRIPT TWO (U+00B2)
u.Unit('m³') # SUPERSCRIPT THREE (U+00B3)
u.Unit('s⁻¹') # SUPERSCRIPT MINUS (U+207B) + SUPERSCRIPT 1 (U+00B9)
Probably there is more…
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (16 by maintainers)
Top Results From Across the Web
Unicode — Astropy v5.2
Bases: astropy.units.format.console.Console. Output-only format to display pretty formatting at the console using Unicode characters. For example:.
Read more >Unicode — Astropy v1.0.4
Bases: astropy.units.format.Console. Output-only format to display pretty formatting at the console using Unicode characters. For example:.
Read more >Units and Quantities (astropy.units) — Astropy v1.2.dev14793
Support the units in Office of Guest Investigator Programs (OGIP) FITS files. Unicode, Output-only format to display pretty formatting at the console using ......
Read more >Units and Quantities (astropy.units) — Astropy v3.0.dev19489
LatexInline, Output LaTeX to display the unit based on IAU style guidelines with negative powers. ; OGIP, Support the units in Office of...
Read more >Unit formats — Astropy v0.3.dev3797
astropy.units includes support for parsing and writing the following formats: ... "unicode": Same as "console", except uses Unicode characters: >>> print u.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok, the micro part was quite easy, see https://github.com/astropy/astropy/pull/9348
#9348 has implemented this