Trivial indentation reformat.
This does not affect semantic of the code block.
This commit is contained in:
parent
c89c51cf6b
commit
0002e948c4
|
@ -74,17 +74,17 @@ class _Measurement(object):
|
||||||
def __format__(self, spec):
|
def __format__(self, spec):
|
||||||
# special cases
|
# special cases
|
||||||
if 'Lx' in spec: # the LaTeX siunitx code
|
if 'Lx' in spec: # the LaTeX siunitx code
|
||||||
# the uncertainties module supports formatting
|
# the uncertainties module supports formatting
|
||||||
# numbers in value(unc) notation (i.e. 1.23(45) instead of 1.23 +/- 0.45),
|
# numbers in value(unc) notation (i.e. 1.23(45) instead of 1.23 +/- 0.45),
|
||||||
# which siunitx actually accepts as input. we just need to give the 'S'
|
# which siunitx actually accepts as input. we just need to give the 'S'
|
||||||
# formatting option for the uncertainties module.
|
# formatting option for the uncertainties module.
|
||||||
spec = spec.replace('Lx','S')
|
spec = spec.replace('Lx','S')
|
||||||
# todo: add support for extracting options
|
# todo: add support for extracting options
|
||||||
opts = 'separate-uncertainty=true'
|
opts = 'separate-uncertainty=true'
|
||||||
mstr = format( self.magnitude, spec )
|
mstr = format( self.magnitude, spec )
|
||||||
ustr = siunitx_format_unit(self.units)
|
ustr = siunitx_format_unit(self.units)
|
||||||
ret = r'\SI[%s]{%s}{%s}'%( opts, mstr, ustr )
|
ret = r'\SI[%s]{%s}{%s}'%( opts, mstr, ustr )
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
# standard cases
|
# standard cases
|
||||||
|
|
Loading…
Reference in New Issue