Skip to content

0.33.0

Compare
Choose a tag to compare
@jagerber48 jagerber48 released this 31 Jan 21:19
· 328 commits to main since this release
a52f125

0.33.0 (2024-01-31)

Added

  • Added the FormattedNumber class. This class is a subclass of str and is now returned by the Formatter instead of str. The FormattedNumber 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 the Formatter in favor of the introduction of the FormattedNumber 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. See Spacing 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".
  • [BREAKING] Renamed fill_char to left_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 and coverage instead of pytest.
    • 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 when ruff provides functionality for formatting .rst files.

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 the FormattedNumber.as_latex() method. This removal simplifies the formatting algorithm by separating LaTeX formatting from other tasks like exponent string resolution. The latex option also introduced a potential confusion with the superscript option, which had no effect when latex=True.