-
Notifications
You must be signed in to change notification settings - Fork 29
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
support angstrom #64
base: master
Are you sure you want to change the base?
support angstrom #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how to include Angstrom, but it definitely does not belong to the _PREFIXES_FACTORS
. Maybe you need a new _Dimension
class with Angstrom supported inside. Maybe something like LengthDimension
@@ -25,6 +25,7 @@ | |||
"\u00b5": 1e-6, | |||
"u": 1e-6, | |||
"n": 1e-9, | |||
"A": 1e-10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Angstroms is not a prefix. It should not appear in this list.
latexrepr = "Å" # Directly add "Å" without appending "m" | ||
self.add_units(prefix, factor, latexrepr) | ||
else: | ||
self.add_units(prefix + "m", factor, latexrepr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think Angstroms should be part of the default SILengthDimension
. Angstrom is not an SI unit. Most users will not want to see Angstrom as a unit when drawing a scale bar.
@@ -111,7 +112,11 @@ def __init__(self): | |||
latexrepr = None | |||
if prefix == "\u00b5" or prefix == "u": | |||
latexrepr = _LATEX_MU + "m" | |||
self.add_units(prefix + "m", factor, latexrepr) | |||
if prefix == "Å" or prefix == "A" or prefix == "angstrom": | |||
latexrepr = "Å" # Directly add "Å" without appending "m" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The correct LaTeX expression would be \AA
A minor PR as Å is commonly used in microscopy, would be useful to support it.