Skip to content

Latest commit

 

History

History
384 lines (239 loc) · 20.1 KB

CHANGELOG.md

File metadata and controls

384 lines (239 loc) · 20.1 KB

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.


Added

Changed

Fixed

Removed


0.13.1 - 2024-11-12

Added

  • Upload coverage / JUnit results / core dumps in CI workflows by @XuehaiPan in #170 and #172.
  • Add more info to tree_flatten_one_level by @XuehaiPan in #168.
  • Improve typing support for generic PyTree[T] and registry lookup / register functions by @XuehaiPan in #160 and #166.

Changed

  • Move include directory include/{ => optree}/*.h by @XuehaiPan in #167.

Fixed

  • Improve typing support for optree.dataclasses.dataclass and optree.dataclasses.field by @manulari in #165.

0.13.0 - 2024-10-03

Added

Changed

  • Split implementation files and add more inline / constexpr / noexcept qualifiers by @XuehaiPan in #159.
  • Use cmake's FindPython module by @XuehaiPan in #151.

Fixed

  • Fix potential segmentation fault for structseq_fields cache support by @XuehaiPan in #150.

0.12.1 - 2024-07-06

Fixed

  • Fix warning regression during import when launch with strict warning filters by @XuehaiPan in #149.

0.12.0 - 2024-07-05

Added

Changed

  • Use stable tag instead of 2.12.0 for pybind11 version by @XuehaiPan in #146.
  • Refactor the raw import statement in setup.py with importlib utilities by @XuehaiPan in #135.
  • Update minimal version of typing-extensions to 4.5.0 for typing_extensions.deprecated by @XuehaiPan in #134.
  • Update string representation for OrderedDict by @XuehaiPan in #133.

Fixed

  • Fix gc for self-referential case by implementing tp_traverse by @XuehaiPan in #144.
  • Fix potential segmentation fault for pickling support by @XuehaiPan in #143.
  • Update CI runner image for Python 3.7 on macOS by @XuehaiPan in #135.

Removed


0.11.0 - 2024-03-26

Added

  • Add function is_namedtuple_instance and is_structseq_instance and result caches by @XuehaiPan in #121.
  • Add tree_iter function by @XuehaiPan in #130.
  • Add API to unregister node type in the registry by @XuehaiPan in #124.
  • Add tree map functions with transposed outputs tree_transpose_map and tree_transpose_map_with_path by @XuehaiPan in #127.
  • Add static constructors to create PyTreeSpec instances by @XuehaiPan in #120.
  • Cache intermediate str objects in PyObject_GetAttr calls by @XuehaiPan in #106 and #109.
  • Install clang-format and clang-tidy from PyPI by @XuehaiPan in #107.
  • Also check _make and _asdict in function is_namedtuple_class by @XuehaiPan in #105.

Changed

  • Set recursion limit to 1000 for all platforms by @XuehaiPan in #121.
  • Allow types to be registered in both the global namespace and custom namespaces by @XuehaiPan in #124.
  • Set treespec_is_leaf as strict by default by @XuehaiPan in #120.
  • Reorder functions for better code correspondence between C++ and Python by @XuehaiPan in #117.
  • Standardize py::handle and py::object usage in function signature by @XuehaiPan in #115.
  • Reorder cases for namedtuple and PyStructSequence types by @XuehaiPan in #111.
  • Use __bases__ rather than __base__ in function is_structseq_class by @XuehaiPan in #104.

Fixed

  • Fix potential segmentation fault when modifying treespec.entries() by @XuehaiPan in #116.

0.10.0 - 2023-11-07

Added

  • Add tree_ravel function for JAX/NumPy/PyTorch array/tensor tree manipulation by @XuehaiPan in #100.
  • Expose node kind enum for PyTreeSpec by @XuehaiPan in #98.
  • Expose function tree_flatten_one_level by @XuehaiPan in #101.
  • Add tree broadcast functions broadcast_common, tree_broadcast_common, tree_broadcast_map, and tree_broadcast_map_with_path by @XuehaiPan in #87.
  • Add function tree_is_leaf and add is_leaf argument to function all_leaves by @XuehaiPan in #93.
  • Add methods PyTreeSpec.entry and PyTreeSpec.child by @XuehaiPan in #88.
  • Add Python 3.12 support by @XuehaiPan in #90.
  • Allow passing third-party dependency version from environment variable by @XuehaiPan in #80.

Changed

  • Set recursion limit to 2000 for all platforms by @XuehaiPan in #97.
  • Make PyTreeSpec.is_prefix to be consistent with PyTreeSpec.flatten_up_to by @XuehaiPan in #94.
  • Decrease the MAX_RECURSION_DEPTH to 2000 on Windows by @XuehaiPan in #85.
  • Bump abseil-cpp version to 20230802.1 by @XuehaiPan in #80.

Fixed

  • Memorize ongoing repr / hash calls to resolve infinite recursion under self-referential case by @XuehaiPan and @JieRen98 in #82.

Removed


0.9.2 - 2023-09-18

Changed

  • Bump pybind11 version to 2.11.1 and add initial Python 3.12 support by @XuehaiPan in #78.
  • Bump abseil-cpp version to 20230802.0 by @XuehaiPan in #79.

Fixed

  • Fix empty paths when flatten with custom is_leaf function by @XuehaiPan in #76.

0.9.1 - 2023-05-23

Changed

  • Use py::type::handle_of(obj) rather than deprecated obj.get_type() by @XuehaiPan in #49.
  • Bump abseil-cpp version to 20230125.3 by @XuehaiPan in #57.

Fixed

  • Add @runtime_checkable decorator for CustomTreeNode protocol class by @XuehaiPan in #56.

0.9.0 - 2023-03-23

Added

  • Preserve dict key order in the output of tree_unflatten, tree_map, and tree_map_with_path by @XuehaiPan in #46.

Changed

  • Change keyword argument initializer back to initial for tree_reduce to align with functools.reduce C implementation by @XuehaiPan in #47.

0.8.0 - 2023-03-14

Added

  • Add methods PyTreeSpec.paths and PyTreeSpec.entries by @XuehaiPan in #43.
  • Allow tree-map with mixed inputs of ordered and unordered dictionaries by @XuehaiPan in #42.
  • Add more utility functions for namedtuple and PyStructSequence type by @XuehaiPan in #41.
  • Add methods PyTreeSpec.is_prefix and PyTreeSpec.is_suffix and function tree_broadcast_prefix by @XuehaiPan in #40.
  • Add tree reduce functions tree_sum, tree_max, and tree_min by @XuehaiPan in #39.
  • Test dict key equality with PyDict_Contains ($O (n)$) rather than sorting ($O (n \log n)$) by @XuehaiPan in #37.
  • Make error message more clear when value mismatch by @XuehaiPan in #36.
  • Add ruff and flake8 plugins integration by @XuehaiPan in #33 and #34.

Changed

  • Allow tree-map with mixed inputs of ordered and unordered dictionaries by @XuehaiPan in #42.
  • Use more appropriate exception handling (e.g., change ValueError to TypeError in structseq_fields) by @XuehaiPan in #41.
  • Inherit optree._C.InternalError from SystemError rather than RuntimeError by @XuehaiPan in #41.
  • Change keyword argument initial to initializer for tree_reduce to align with functools.reduce by @XuehaiPan in #39.

0.7.0 - 2023-02-07

Added

  • Add PyStructSequence types as internal node types by @XuehaiPan in #30.

Changed

  • Add PyStructSequence types as internal node types by @XuehaiPan in #30.
  • Use postponed evaluation of annotations by @XuehaiPan in #28.

0.6.0 - 2023-02-02

Added

  • Add Linux AArch64 and Windows ARM64 wheels by @XuehaiPan in #25.
  • Add property PyTreeSpec.type and method PyTreeSpec.is_leaf by @XuehaiPan in #26.
  • Raise a warning when registering subclasses of namedtuple by @XuehaiPan in #24.
  • Add clang-tidy integration and update code style by @XuehaiPan in #20.

Fixed

  • Add doctest integration and fix docstring by @XuehaiPan in #23.

0.5.1 - 2023-01-21

Added

  • Add property PyTreeSpec.num_children by @XuehaiPan.
  • Update docstring and documentation by @XuehaiPan.

0.5.0 - 2022-11-30

Added

  • Add custom exceptions for internal error handling by @XuehaiPan.

Fixed

  • Fix PyTreeSpec equality test and hash by @XuehaiPan.

0.4.2 - 2022-11-27

Changed


0.4.1 - 2022-11-25

Fixed

  • Fix segmentation fault error for global imports @XuehaiPan in #14.

0.4.0 - 2022-11-25

Added

  • Add namespace support for custom node type registry by @XuehaiPan in #12.
  • Add tree flatten and tree map functions with extra paths by @XuehaiPan in #11.
  • Add in-place version of tree-map function tree_map_ by @XuehaiPan.
  • Add macOS ARM64 wheels by @XuehaiPan in #9.
  • Add Python 3.11 support by @XuehaiPan.

Changed

  • Use shallow clone for third-party Git repos by @XuehaiPan.
  • Use cmake FetchContent rather than Git submodules by @XuehaiPan.

Removed


0.3.0 - 2022-10-26

Added

  • Add Read the Docs integration by @XuehaiPan.
  • Add benchmark script and results by @XuehaiPan.
  • Support both "None is Node" and "None is Leaf" by @XuehaiPan.
  • Add OrderedDict and defaultdict and deque as builtin support by @XuehaiPan.

Changed

  • Reorganize code structure and rename PyTreeDef to PyTreeSpec by @XuehaiPan.

Fixed

  • Fix Python 3.6 support by @XuehaiPan.
  • Fix generic NamedTuple for Python 3.8-3.10 by @XuehaiPan.
  • Fix builds for Python 3.8-3.10 on Windows by @XuehaiPan.

0.2.0 - 2022-09-24

Added

  • Add cibuildwheel integration for building wheels by @XuehaiPan.
  • Add full type annotations by @XuehaiPan.

Changed

  • Improve custom tree node representation by @XuehaiPan.

Fixed


0.1.0 - 2022-09-16

Added

  • The first beta release of OpTree by @XuehaiPan.
  • OpTree with Linux / Windows / macOS x64 support by @XuehaiPan.