0.33.0
0.33.0 (2024-01-31)
Added
- Added the
FormattedNumber
class. This class is a subclass ofstr
and is now returned by theFormatter
instead ofstr
. TheFormattedNumber
class allows post-conversion to ASCII, HTML, and LaTeX formats. [#114 <https://github.com/jagerber48/sciform/issues/114>
_] - Added separate flags for code coverage reports for each python version.
Changed
-
In addition to removing the
latex
option from theFormatter
in favor of the introduction of theFormattedNumber
class, the LaTeX conversion algorithm has been slightly modified.- Left and right parentheses are no longer converted to
"\left("
and"\right)"
due to introducing strange spacing issues. SeeSpacing around \\left and \\right <https://tex.stackexchange.com/questions/2607/spacing-around-left-and-right>
_. - Previously spaces within the
sciform
output were handled inconsistently and occasionally required confusing extra handling. Now any spaces in the input string are directly and explicitly converted into math mode medium spaces:"\:"
. "μ"
is now included in the math mode\text{}
environment and converted to"\textmu"
.
- Left and right parentheses are no longer converted to
-
[BREAKING] Renamed
fill_char
toleft_pad_char
. [#126 <https://github.com/jagerber48/sciform/issues/126>
_] -
Slimmed down
[dev]
optional dependencies and created[examples]
optional dependencies. The former includes development tools, while the latter includes the heavy-weight requirements needed to run all the examples, including, e.g.jupyter
,scipy
, etc. -
Cleaned up and improved github actions for testing and linting/formatting. [
#136 <https://github.com/jagerber48/sciform/issues/136>
_]- Use
unittest
andcoverage
instead ofpytest
. - The requirements to run the automation match the
[dev]
optional dependencies. - Cache
pip
requirements to avoid unnecessarily downloading dependencies. - Remove a defunct
blackdoc
test. Hopefully this can be replaced whenruff
provides functionality for formatting.rst
files.
- Use
Fixed
- Fixed a bug where value/uncertainty pairs formatted in the
"parts_per"
format with zero exponent would appear with redundant parentheses, e.g."(1.2 ± 0.1)"
. [#130 <https://github.com/jagerber48/sciform/issues/130>
_]
Removed
- [BREAKING] Removed the
latex
option in favor of the introduction of theFormattedNumber.as_latex()
method. This removal simplifies the formatting algorithm by separating LaTeX formatting from other tasks like exponent string resolution. Thelatex
option also introduced a potential confusion with thesuperscript
option, which had no effect whenlatex=True
.