Skip to content

Releases: scikit-hep/formulate

Version 1.0.1

16 Oct 19:05
f89ea1a

Choose a tag to compare

This release provided significant bug fixes and cleanup with respect to the previous overhaul. The switch to Lark as the parsing backend and the internal AST were kept, but the code was significantly simplified and many issues were ironed out.

Breaking changes

  • A numexpr parsing bug was fixed, which had been present since the initial release of formulate. Bitwise operator precedence was changed, so some expressions will be interpreted differently, or fail to be parsed if they are not valid numexpr expressions. (See bug fixes section for more details.)
  • Some constant names were changed. In particular, very generic names are not assumed to be constants and will instead need more specific names. For example c is no longer interpreted as the speed of light, so c_light should be used instead. Constant names were taken from hepunits for consistency within Scikit-HEP.

Features and improvements

  • The CLI interface (which was briefly removed) was reintroduced.
  • Added dependency on hepunits in order to provide a useful set of constants.
  • Added methods to suggest fixes to parsing issues. These will be expanded in the future.

Bug fixes

  • ROOT parsing issues were resolved.
  • Various issues with constant and function conversions were resolved.
  • Bitwise operator precedence for numexpr expressions was fixed. An expression like x > 1 & x < 3 was being parsed as (x > 1) & (x < 3) whereas numexpr would actually parse it as x > (1 & x) < 3.

Maintainability improvements

  • Added lark as a dependency, and moved away from standalone parsers. This simplifies the code and makes future adjustments to the grammar rules much easier.
  • Moved function and constant conversions into a central location instead of having them in each to_* function. Expressions are converted into a unified internal representation when they are parsed. This makes it easier to identify parsing and conversion issues.

Alpha 1.0.0: complete overhaul

13 May 09:52

Choose a tag to compare

Release Notes for Version 1.0.0

This release has been yanked due to too many small bugfixes and a general overhaul, use the 1.0.1 instead

Formulate is now significantly faster and cleaner in handling large expressions thanks to a new backend.

Features and Enhancements

  • Expression Conversion:

    • Improved the API for converting between ROOT and numexpr-style expressions.
    • Introduced a new abstract syntax tree (AST) system (AST.py) for better parsing and manipulation of expressions.
  • Compatibility Updates:

    • Raised the minimum supported Python version to 3.10.
    • Removed Python 2.x and older 3.x versions from compatibility.

Bug Fixes

  • Fixed various issues in parsing and converting mathematical expressions between formats.
  • Enhanced testing coverage and fixed bugs related to edge cases in the API.

All this was contributed by @aryan26roy and @jpivarski

Version 1.0.0rc1

05 Nov 15:02
9a0371c

Choose a tag to compare

Version 1.0.0rc1 Pre-release
Pre-release

Summary

This is the first release after the switch to Lark.

What's Changed

New Contributors

Full Changelog: v0.1.1...v1.0.0rc1

Minor bug fixes

15 Apr 16:29

Choose a tag to compare

This release is the correctly tagged release of 0.1.0 and contains mainly developer side updates of the CI, CD, pre-commits and more.

v0.0.8: Merge pull request #22 from scikit-hep/add-subvariables

15 Oct 22:47
ea7703d

Choose a tag to compare

Preliminary support for nested variables

Add docs and automatic parsing

27 Feb 08:19
588e793

Choose a tag to compare

Merge pull request #16 from chrisburr/add-docs

Add docs and auto expression type detection

v0.0.6

23 Feb 15:28

Choose a tag to compare

  • Set minimum pyparsing version

v0.0.5: Merge pull request #11 from chrisburr/add-more-constants

23 Feb 11:38
9f05613

Choose a tag to compare

  • Add support for all TMath constants except those related to uncertainties
  • Add support for most TMath functions
  • Add variables, named_constants and unnamed_constants properties to Expression objects
  • Generally improve Expression API

v0.0.4

15 Feb 09:54

Choose a tag to compare

  • Add support for constants
  • Improve add ExpressionComponent base class for expressions
  • Add support for combining expressions using various operators
  • Improve logging
  • Add support for setting the log level with the FOMULATE_LOG_LEVEL environment variable

v0.0.3

11 Feb 22:02

Choose a tag to compare

  • Add README to PyPI
  • Ensure parentheses are always present in string output to avoid losing the order of operations
  • Fix Python 2.7 support