Releases: jagerber48/sciform
0.32.3
0.32.3 (2024-01-11)
Added
- Added more PyPi classifiers.
0.32.2
0.32.2 (2024-01-11)
Added
- Expanded the "Under Construction" section of the readme and the "How to Contribute" section of the project page. Changes included adding links to the
sciform
feedback survey. - Added examples in the documentation demonstrating how
sciform
formatting can be mapped over collections of numbers. [#120 <https://github.com/jagerber48/sciform/issues/120>
_]
Changed
- Refactor backend mode literal (used for typing) and enum (used internally for tracking options) object names so that e.g.
SignMode
->SignModeEnum
andUserSignMode
->SignMode
. [#111 <https://github.com/jagerber48/sciform/issues/111>
_]
0.32.0
0.32.0 (2024-01-10)
Added
- Previously it was impossible to configure
pdg_sig_figs=True
together withndigits!=AutoDigits
. This combinations resulted in an exception. Now behavior has been defined and implemented for this combination. For single value formatting the value ofpdg_sig_figs
is always ignored. For value/uncertainty formattingndigits
is ignored ifpdg_sig_figs=True
. The behavior forpdg_sig_figs=False
is unchanged. [#73]
Removed
- [BREAKING] Removed
global_add_c_prefix
,global_add_small_si_prefixes
,global_add_ppth_form
,global_reset_si_prefixes
,global_reset_iec_prefixes
, andglobal_reset_parts_per_forms
. These options are redundant withset_global_defaults
andGlobalDefaultsContext
and make the extra translations dictionaries more confusing to understand. [#97]
Changed
- [BREAKING] Previously
12.3
would format as"12.3e+00"
when using parts per formatting mode. Now, when using parts per formatting mode, thee+00
exponent is translated to be an empty string so that12.3
would format as"12.3"
. [#99]
0.31.1
0.31.1 (2024-01-06)
Removed
-
[BREAKING] Removed the
SciNumUnc
class. Now theSciNum
class can be used with an optional second positional argument to specify the uncertainty associated with a number. -
[BREAKING] Remove separator configuration from the FSML. These options made the FSML to cumbersome and led to confusing (if not incorrect) conflicts with the round mode symbol. Now all separator configuration needs to be done by setting the global format options or using the global format options context manager. [#29]
Added
- Added annotated examples demonstrating the FSML.
- Added more documentation for contributing developers.
- Added `pre-commit (https://pre-commit.com/) configuration.
Changed
-
[BREAKING] Renamed multiple options.
top_dig_place
renamed toleft_pad_dec_place
.superscript_exp
renamed tosuperscript
.bracket_unc
renamed toparen_uncertainty
.bracket_unc_remove_seps
renamed to
paren_uncertainty_separators
. This change is associated with a
a reversal of the Boolean logic on the option.val_unc_match_widths
renamed toleft_pad_matching
.unc_pm_whitespace
renamed topm_whitespace
.
-
[BREAKING] Previously specifying any left pad decimal place using the
sciform
FSML resulted in settingleft_pad_matching=True
so thatprint(f"{SciNum(123.456, 0.789):0}")
resulted in"123.456 ± 000.789"
. Now the FSML has no impact onleft_pad_matching
. Now, similar to many other options, the global setting forleft_pad_matching
will always be used when formatting using the FSML. Under the default global options (left_pad_matching=False
)print(f"{SciNum(123.456, 0.789):0}")
results in"123.456 ± 0.789"
. -
Implemented ruff linting and formatting in codebase and integration automation.
-
Refactored code for adding separators.
-
Refactored formatting and formatting utilities to simplify functions and make the algorithm easier to follow.
-
More aggressively filter JetBrains
.idea/
folder from version control.
Fixed
- Fixed a bug involving removing separators in parentheses uncertainty mode when at least one of the value and uncertainty were non-finite.
- Fixed a typo that prevented pushing
0.31.0
readme to pypi.
0.30.1
0.30.1 (2023-11-24)
Fixed
- Fixed Changelog.
0.30.0
0.30.0 (2023-11-24)
Changed
- [BREAKING] Remove the
FormatOptions
class from the user interface. Now users configureFormatter
instances by passing the formatting keyword arguments into theFormatter
constructor directly. Global configuration viaset_global_defaults()
or theGlobalDefaultsContext
is also done by passing formatting keywords directly. This change reduces the amount of boilerplate code and keystrokes needed to usesciform
. - [BREAKING] Options such as
exp_mode
andexp_format
were previously configured usingEnum
objects such asExpMode
orExpFormat
. Now these options are configured using string literals. This change also reduces the amount of boilerplate code and keystrokes needed to usesciform
. - Clean up
print_global_defaults
output. This is the start of an effort to improve interface for getting and printing current format options.
Added
- Added code of conduct.
- Added contributing guidelines.
- Added Python 3.12 to automated testing.
Fixed
- Cleaned up API documentation.
- Fixed a bug where the
repr
forFormatOptions
would return a string containing information about the global format options rather than about the specificFormatOptions
instance. [#75] - Fixed an issue that was causing Github actions code coverage report to not actually check code coverage. [#84]
Removed
- [BREAKING] Removed the
unicode_pm
feature which allowed toggling between using'+/-'
or'±'
in value/uncertainty strings. Previouslyunicode_pm
defaulted toFalse
so that'+/-'
was the default behavior. Now the default behavior is to use'±'
and there is no way to change to the old'+/-'
behavior. [#10]
0.29.1
0.29.1 (2023-10-22)
Fixed
- Fixed a bug where bracket uncertainties erroneously appeared as empty parentheses for zero or non-finite uncertainties. [#66 ]
- Fixed a bug where the exponent value was erroneously calculated from the uncertainty rather than the value when the value was negative (but larger in magnitude than the uncertainty). [#68 ]
- Fixed a bug where certain leading digits were erroneously not stripped from the uncertainty when using bracket uncertainty with negative values. [#68]
- Fixed a bug where the value was erroneously being rounded according to the PDG rounding rules when
pdg_sig_figs=True
, the uncertainty was zero or non-finite, and the value was positive. [#71] - Fixed a bug where a spurious error was raised when
pdg_sig_figs=True
, the uncertainty was zero or non-finite, and the value was zero or negative. [#65 ]
Changed
- Replace
-e .
with.
inrequirements.txt
. There is no need to installsciform
in editable mode for code automation routines.
0.29.0
0.29.0 (2023-09-05)
Changed
- Previously, when using
bracket_unc=True
with any exponent string (such ase-06
,μ
orppm
), the value and uncertainty were always wrapped in parentheses, e.g.(1.03(25))e-06
,(1.03(25)) μ
or(1.03(25)) ppm
. Now, when usingbracket_unc=True
with prefix or parts-per exponent format modes, if the exponent is replaced with an alphabetic replacement, then the value and uncertainty are no longer wrapped in parentheses, e.g.1.03(25) μ
and1.03(25) ppm
. This is consistent withBIPM Guide Section 7.2.2 <https://www.bipm.org/documents/20126/2071204/JCGM_100_2008_E.pdf/cb0ef43f-baa5-11cf-3f85-4dcd86f77bd6#page=37>
_. Specifically, any timebracket_unc=False
the value and uncertainty are always wrapped in parentheses, and any time notation likee+02
orb+02
is used to indicate the exponent then the value and uncertainty are always wrapped in parentheses.
Fixed
- Correct
fit_plot_with_sciform.py
example script to use newexp_format=ExpFormat.PREFIX
instead of oldprefix_exp=True
.
Improved
- Documentation improvements including typos and neatening up changelog.
0.28.2
0.28.2 (2023-08-31)
Improved
- General wording and grammar improvements throughout documentation.
- Include more usage examples in the examples documentation in addition to referring the reader to the test suite.
Fixed
- Fixed a bug when using
pdg_sig_figs
with uncertainties larger than about 1000 by cleaning upDecimal
math. - Previously, when formatting using the format specification mini-language, if the prefix exponent format flag was omitted then the exponent format was forced to
ExpFormat.STANDARD
rather thanNone
. This meant that it was impossible, using the format specification mini-language combined with global configuration options, to setExpFormat.PARTS_PER
. Now when the prefix flag is omittedexp_format
is set toNone
so that it will be populated by the global default option. In the future a flag may be added to select "parts-per" formatting using the format specification mini-language.
0.28.1
- Make
FormatOptions
inputsOptional
so thatNone
inputs
pass type checks. - Write format-specification mini-language documentation to refer to
existing format options documentation to avoid documentation
duplication. - Setup test coverage analysis automation and upload report to
codecov <https://codecov.io/gh/jagerber48/sciform>
_. - Add package status badges to readme.
- Test against Python 3.11.
- List supported Python versions in
pyproject.toml
classifiers.