Repository navigation
Allow unit parser to deal with more unicode representations - #11827
Conversation
971b7c2 to
b8c2f07
Compare
olebole
left a comment
There was a problem hiding this comment.
This looks fine for me; thank you very much.
|
@mhvk , do you also want to address #11829 (comment) here? |
| '\N{PRIME}': 'arcmin', | ||
| '\N{DOUBLE PRIME}': 'arcsec', | ||
| '\N{MODIFIER LETTER SMALL H}': 'hourangle', | ||
| 'e\N{SUPERSCRIPT MINUS}': 'electron', |
There was a problem hiding this comment.
Predates me, but I think meant to be CCD counts or so,
astropy/astropy/units/astrophys.py
Lines 121 to 122 in d33db76
There was a problem hiding this comment.
Yes, I used it at some point to go from photons --> electrons --> adu in an ETC.
|
|
||
| _prefixable_unit_symbols = { | ||
| '\N{GREEK CAPITAL LETTER OMEGA}': 'Ohm', | ||
| '\N{LATIN CAPITAL LETTER A WITH RING ABOVE}': 'Angstrom', |
There was a problem hiding this comment.
Does this mean things like mÅ are now allowed?
There was a problem hiding this comment.
Only the prefixes that are allowed with 'Angstrom' generally - which indeed includes mÅ (#11788) but nothing else. Of course, we already had kOhm, etc.
|
I'll wait for @maxnoe 's discussion to wrap up before approving. |
These were more FYI questions, so please just go ahead |
Specifically, ensures that for non-composite units,
u.Unit(unit.to_string('unicode'))now correctly round-trips.Fixes #11826
Note that to me it is a cross between a bugfix and feature request. I think it is fine to just have it in 5.0, and not backport.