Skip to content

Commit

Permalink
ver: bump version to 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Mar 23, 2023
1 parent 9f341f0 commit b4ed682
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
19 changes: 16 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Preserve dict key order in the output of `tree_unflatten`, `tree_map`, and `tree_map_with_path` by [@XuehaiPan](https://github.com/XuehaiPan) in [#46](https://github.com/metaopt/optree/pull/46).
-

### Changed

- Change keyword argument `initializer` back to `initial` for `tree_reduce` to align with `functools.reduce` C implementation by [@XuehaiPan](https://github.com/XuehaiPan) in [#47](https://github.com/metaopt/optree/pull/47).
-

### Fixed

Expand All @@ -29,6 +29,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

------

## [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](https://github.com/XuehaiPan) in [#46](https://github.com/metaopt/optree/pull/46).

### Changed

- Change keyword argument `initializer` back to `initial` for `tree_reduce` to align with `functools.reduce` C implementation by [@XuehaiPan](https://github.com/XuehaiPan) in [#47](https://github.com/metaopt/optree/pull/47).

------

## [0.8.0] - 2023-03-14

### Added
Expand Down Expand Up @@ -185,7 +197,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

------

[Unreleased]: https://github.com/metaopt/optree/compare/v0.8.0...HEAD
[Unreleased]: https://github.com/metaopt/optree/compare/v0.9.0...HEAD
[0.9.0]: https://github.com/metaopt/optree/compare/v0.8.0...v0.9.0
[0.8.0]: https://github.com/metaopt/optree/compare/v0.7.0...v0.8.0
[0.7.0]: https://github.com/metaopt/optree/compare/v0.6.0...v0.7.0
[0.6.0]: https://github.com/metaopt/optree/compare/v0.5.1...v0.6.0
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ False
([3, 1, 2], PyTreeSpec(OrderedDict([('b', [*]), ('a', [*, *])])))
```

Since OpTree v0.9.0, the key order of the reconstructed output dictionaries from `tree_unflatten` is guaranteed to be consistent with the key order of the input dictionaries in `tree_flatten`.
**Since OpTree v0.9.0, the key order of the reconstructed output dictionaries from `tree_unflatten` is guaranteed to be consistent with the key order of the input dictionaries in `tree_flatten`.**

```python
>>> leaves, treespec = optree.tree_flatten({'b': [3], 'a': [1, 2]})
Expand Down Expand Up @@ -525,7 +525,7 @@ This property is also preserved during serialization/deserialization.

> Note that there are no restrictions on the `dict` to require the keys are comparable (sortable).
> There can be multiple types of keys in the dictionary.
> The keys are sorted in ascending order by `key=lambda k: k` first if capable otherwise fallback to `key=lambda k: (k.__class__.__qualname__, k)`. This handles most cases.
> The keys are sorted in ascending order by `key=lambda k: k` first if capable otherwise fallback to `key=lambda k: (f'{k.__class__.__module__}.{k.__class__.__qualname__}', k)`. This handles most cases.
>
> ```python
> >>> sorted({1: 2, 1.5: 1}.keys())
Expand All @@ -534,7 +534,7 @@ This property is also preserved during serialization/deserialization.
> Traceback (most recent call last):
> ...
> TypeError: '<' not supported between instances of 'int' and 'str'
> >>> sorted({'a': 3, 1: 2, 1.5: 1}.keys(), key=lambda k: (k.__class__.__qualname__, k))
> >>> sorted({'a': 3, 1: 2, 1.5: 1}.keys(), key=lambda k: (f'{k.__class__.__module__}.{k.__class__.__qualname__}', k))
> [1.5, 1, 'a']
> ```
Expand Down
2 changes: 1 addition & 1 deletion optree/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ==============================================================================
"""OpTree: Optimized PyTree Utilities."""

__version__ = '0.8.0'
__version__ = '0.9.0'
__license__ = 'Apache License, Version 2.0'
__author__ = 'OpTree Contributors'
__release__ = False
Expand Down

0 comments on commit b4ed682

Please sign in to comment.