You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There should be at least information in get_application_registry doc string about this problem or initialization of register should be protected using proper objects from threading library, for example Lock.
I may try to implement such a thing if you wish.
The text was updated successfully, but these errors were encountered:
Workaround for hgrecco/pint#2039
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Integrated `pint` library for unit management, improving flexibility
and precision in handling measurements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
For performance of init, the default registry is created using
LazyRegistry
https://github.com/hgrecco/pint/blob/5f2a76a42c44f0077908be212c5445a657da639a/pint/__init__.py#L50C1-L50C18
However, the code for load and initialize register
pint/pint/registry.py
Lines 187 to 192 in 5f2a76a
is not thread safe, so if two threads try to access to registry it may end with exception like:
There should be at least information in
get_application_registry
doc string about this problem or initialization of register should be protected using proper objects from threading library, for exampleLock
.I may try to implement such a thing if you wish.
The text was updated successfully, but these errors were encountered: