Skip to content

Commit 3d1da23

Browse files
feat(tidy3d): Mutable attrs bypass _json_string cache, causing stale hashes and exports
- change hashing to md5 Jira: FXC-3374
1 parent bb076d1 commit 3d1da23

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
### Changed
1212
- Improved performance of antenna metrics calculation by utilizing cached wave amplitude calculations instead of recomputing wave amplitudes for each port excitation in the `TerminalComponentModelerData`.
1313
- Fixed: In `Tidy3dBaseModel` the hash (and cached `.json_string`) are now sensitive to changes in `.attrs`.
14+
- Changed hashing method in `Tidy3dBaseModel` from sha256 to md5.
1415

1516
### Fixed
1617
- More robust `Sellmeier` and `Debye` material model, and prevent very large pole parameters in `PoleResidue` material model.

tidy3d/components/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _hash_self(self) -> str:
174174
"""Hash this component with ``hashlib`` in a way that is the same every session."""
175175
bf = io.BytesIO()
176176
self.to_hdf5(bf)
177-
return hashlib.sha256(bf.getvalue()).hexdigest()
177+
return hashlib.md5(bf.getvalue()).hexdigest()
178178

179179
def __init__(self, **kwargs):
180180
"""Init method, includes post-init validators."""

0 commit comments

Comments
 (0)