Skip to content

Commit e9c0436

Browse files
committed
Update to v0.12.2
- Fixed cache key generation in `_create_cache_key()` to use `id()`
1 parent 4beabe8 commit e9c0436

5 files changed

Lines changed: 14 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.12.2] - 2025-12-08
9+
10+
### Fixed
11+
12+
- **Cache key generation**: Use `id()` instead of `str()` for non-hashable kwargs in `_create_cache_key()` to avoid expensive `__repr__` traversals on large objects
13+
814
## [0.12.1] - 2025-12-07
915

1016
### Added

docs/reference/api-full.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Quick links:
1212
- [CLI Reference](cli.md)
1313
- [DSL Reference](dsl.md)
1414

15-
Generated from source code on: December 06, 2025 at 18:54 UTC
15+
Generated from source code on: December 07, 2025 at 00:13 UTC
1616

1717
Modules auto-discovered: 44
1818

@@ -262,7 +262,7 @@ Typical usage example:
262262
- `workflow` (List[WorkflowStep])
263263
- `failure_policy_set` (FailurePolicySet) = FailurePolicySet(policies={})
264264
- `traffic_matrix_set` (TrafficMatrixSet) = TrafficMatrixSet(matrices={})
265-
- `results` (Results) = Results(\_store={}, \_metadata={}, \_active_step=None, \_scenario={})
265+
- `results` (Results) = Results(_store={}, _metadata={}, _active_step=None, _scenario={})
266266
- `components_library` (ComponentsLibrary) = ComponentsLibrary(components={})
267267
- `seed` (Optional[int])
268268

ngraph/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__all__ = ["__version__"]
44

5-
__version__ = "0.12.1"
5+
__version__ = "0.12.2"

ngraph/exec/failure/manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ def _create_cache_key(
8585
if _is_hashable((key, value)):
8686
hashable_kwargs.append((key, value))
8787
else:
88-
# For non-hashable values, use type name and a digest of a stable string
89-
value_hash = hashlib.md5(str(value).encode()).hexdigest()[:8]
90-
hashable_kwargs.append((key, f"{type(value).__name__}_{value_hash}"))
88+
# Use object id for non-hashable values. Avoid str() which triggers
89+
# deep __repr__ traversals on large objects (e.g., graphs with thousands
90+
# of edges). id() works here because these objects persist across calls.
91+
hashable_kwargs.append((key, f"{type(value).__name__}_{id(value)}"))
9192

9293
return base_key + (tuple(hashable_kwargs),)
9394

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
55
# ---------------------------------------------------------------------
66
[project]
77
name = "ngraph"
8-
version = "0.12.1"
8+
version = "0.12.2"
99
description = "A tool and a library for network modeling and analysis."
1010
readme = "README.md"
1111
authors = [{ name = "Andrey Golovanov" }]

0 commit comments

Comments
 (0)