bta-lib
bta-lib copied to clipboard
Initialize thread local value on each thread
Attributes on the thread local metadata
variable were being initialized at import time by the calling thread. All access from other threads were result in errors like AttributeError: '_thread._local' object has no attribute 'minperiods''
.
This change make the initialization lazy via a property and binds to the calling thread.
I am getting the following error when calling indicators from a thread:
Unhandled Error Traceback (most recent call last): ... File "/Users/haakamaujla/Library/Python/3.8/lib/python/site-packages/pandas/core/indexers.py", line 171, in check_setitem_lengths raise ValueError( builtins.ValueError: cannot set using a slice indexer with a different length than the value
I test it just now and for me worked like charm too! THX
Thanks man! U are awesome.