sciform 0.28.2__py3-none-any.whl → 0.29.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sciform/format_options.py CHANGED
@@ -262,7 +262,7 @@ class FormatOptions:
262
262
  **_merge_dicts(asdict(defaults), asdict(self))
263
263
  )
264
264
  except ValueError as e:
265
- raise ValueError('Invalid format options resuling from merging '
265
+ raise ValueError('Invalid format options resulting from merging '
266
266
  'with default options.') from e
267
267
 
268
268
  return rendered_format_options
@@ -275,7 +275,7 @@ def validate_options(options: Union[FormatOptions, RenderedFormatOptions]):
275
275
  if options.round_mode is RoundMode.SIG_FIG:
276
276
  if isinstance(options.ndigits, int):
277
277
  if options.ndigits < 1:
278
- raise ValueError(f'Precision must be >= 1 for sig fig '
278
+ raise ValueError(f'ndigits must be >= 1 for sig fig '
279
279
  f'rounding, not {options.ndigits}.')
280
280
 
281
281
  if (options.pdg_sig_figs and options.ndigits is not None
sciform/formatting.py CHANGED
@@ -318,7 +318,10 @@ def format_val_unc(val: Decimal, unc: Decimal,
318
318
  extra_iec_prefixes=options.extra_iec_prefixes,
319
319
  extra_parts_per_forms=options.extra_parts_per_forms
320
320
  )
321
- val_unc_exp_str = f'({val_unc_str}){exp_str}'
321
+ if options.bracket_unc and not re.match(r'^[eEbB][+-]\d+$', exp_str):
322
+ val_unc_exp_str = f'{val_unc_str}{exp_str}'
323
+ else:
324
+ val_unc_exp_str = f'({val_unc_str}){exp_str}'
322
325
  else:
323
326
  val_unc_exp_str = val_unc_str
324
327
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciform
3
- Version: 0.28.2
3
+ Version: 0.29.0
4
4
  Summary: A package for formatting numbers into scientific formatted strings.
5
5
  Author-email: Justin Gerber <justin.gerber48@gmail.com>
6
6
  Project-URL: homepage, https://github.com/jagerber48/sciform
@@ -77,7 +77,7 @@ continue to change until version ``1.0.0`` is released.
77
77
  API changes will be announced after new releases in the
78
78
  `changelog <https://sciform.readthedocs.io/en/stable/project.html#changelog>`_.
79
79
  If you have an idea or opinion about how ``sciform`` should be designed,
80
- now is a great to
80
+ now is a great time to
81
81
  `post a discussion topic <https://github.com/jagerber48/sciform/discussions>`_
82
82
  about it!
83
83
 
@@ -1,15 +1,15 @@
1
1
  sciform/__init__.py,sha256=kAgKCR6uDXlmzpUIrHwMG607sTvPc5UEOZGE5zKDJ8s,1104
2
- sciform/format_options.py,sha256=A_Kw15VOXPWmQ8hx0fpQpxuTsDQIRqYUxkAiH3EdfTo,19220
2
+ sciform/format_options.py,sha256=Yk0Xo-wkremjo0Lw_VoZ_8Fwj31gBIwQxnYm6jif19c,19219
3
3
  sciform/format_utils.py,sha256=MGJ0Tsoa6iYHn8PJqa6XDr-cT3bRQwLd0u0sqhQomHE,11599
4
4
  sciform/formatter.py,sha256=qLK94AqZQ4vv7fLEYIXEJzL0abfE7vfB62npwmzHveE,2091
5
- sciform/formatting.py,sha256=3PHf6lbSHXNMBmo30DOmu8rvvsurWfQOaNKdGVeGp6A,11552
5
+ sciform/formatting.py,sha256=82K38NFsgDuO7P5L2hGuVHY44hPm9vfzVLCZPkN-EFY,11704
6
6
  sciform/fsml.py,sha256=8IbONNU1pSGRmF6_3t-8go_nLOe0yISAkEEUS2bPWdw,4697
7
7
  sciform/grouping.py,sha256=t_M33mUIa0e7y8YuYe395dpOrX0QJiwPHC76NRPMcWs,2324
8
8
  sciform/modes.py,sha256=xLeffIzlbNSApoBvl0u0GAQrk92XveLKeP0kjyeiz_c,4105
9
9
  sciform/prefix.py,sha256=5JpmaqGpoZ7uApq6YkaGb0txjL-VT1AkEsRO6gihX7Q,1186
10
10
  sciform/scinum.py,sha256=bTprldmCgLYPSyM9j8qLt--DqnTfBVfMGoneqby8oFI,2068
11
- sciform-0.28.2.dist-info/LICENSE,sha256=-oyCEZu-6HLrRSfRg44uuNDE0c59GVEdqYIgidqSP70,1056
12
- sciform-0.28.2.dist-info/METADATA,sha256=-Xt7KDqCAz5RrOfOgJRp50Swffy1UgFd141aAuSGpXA,5761
13
- sciform-0.28.2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
14
- sciform-0.28.2.dist-info/top_level.txt,sha256=mC01YOQ-1u5pDk9BJia-pQKLUMvkreMsldDpFcp7NV8,8
15
- sciform-0.28.2.dist-info/RECORD,,
11
+ sciform-0.29.0.dist-info/LICENSE,sha256=-oyCEZu-6HLrRSfRg44uuNDE0c59GVEdqYIgidqSP70,1056
12
+ sciform-0.29.0.dist-info/METADATA,sha256=ELJLYio4-4qGbqggyPh-54wG5Ie24BtOl2W-jbvaFXI,5766
13
+ sciform-0.29.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
14
+ sciform-0.29.0.dist-info/top_level.txt,sha256=mC01YOQ-1u5pDk9BJia-pQKLUMvkreMsldDpFcp7NV8,8
15
+ sciform-0.29.0.dist-info/RECORD,,