bta-lib icon indicating copy to clipboard operation
bta-lib copied to clipboard

Initialize thread local value on each thread

Open jonson opened this issue 4 years ago • 3 comments

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.

jonson avatar May 02 '20 19:05 jonson

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

Haakam21 avatar Apr 01 '21 04:04 Haakam21

I test it just now and for me worked like charm too! THX

luke82 avatar Apr 13 '21 14:04 luke82

Thanks man! U are awesome.

luizgomesdev avatar May 23 '22 13:05 luizgomesdev