Skip to content

Update 1.5.1

Latest

Choose a tag to compare

@molshape molshape released this 01 Nov 14:44
a4fc868

Release Notes for Version 1.5.1

Version 1.5.1 introduces arithmetic operations for the ChemFormula class, enabling addition, subtraction, and multiplication of chemical formulas. These features enhance the library's capabilities for chemical computations and improve usability with updated documentation, examples, and tests.

New Features

Formula Addition

  • + Operator: Combine two ChemFormula instances by summing their element counts and charges. This feature supports operations like adding reaction products or combining formulas.

Formula Subtraction

  • - Operator: Subtract element counts and charges between two ChemFormula instances. Includes validation for negative frequencies and empty results.

Formula Multiplication

  • * Operator: Multiply a ChemFormula by a positive integer, scaling element counts and charges. Supports both left and right multiplication.

Specialized Dictionary Classes

  • ChemFormulaDict: A dictionary for element frequencies, enforcing non-negative integer values.
  • ChemFormulaDictFloat: A dictionary for element fractions, supporting floats and integers.

Documentation and Examples

  • Expanded README.md: Added detailed sections on formula arithmetic, including examples for addition, subtraction, and multiplication.
  • New Example Script: examples/example6.py demonstrates practical use cases for formula arithmetic.

Testing and Type Safety

  • Comprehensive tests for all arithmetic operations, including validation of edge cases and error handling.
  • Updated type stubs (chemformula.pyi) to reflect new features and ensure type safety.

Project Configuration

  • Changed CI matrix to include Python 3.14.
  • Bump version to 1.5.1.

What's Changed

Full Changelog: v1.5.0...v1.5.1 or CHANGELOG.md