TDAmeritrade / stumpy

STUMPY is a powerful and scalable Python library for modern time series analysis

Home Page:https://stumpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stumpy 1.12 is not compatible with 1.11

parfeniukink opened this issue · comments

I found that after update to 1.12 the P_ is not working anymore.

Here is the code snippet:

def foo():
    baseline: aampi = pickle.loads(filename)
    print(baseline.P_)
"foo.py", line 3, in foo
    print(baseline.P_)
             ^^^^^^^^^
  File "/venv_path/lib/python3.11/site-packages/stumpy/aampi.py", line 365, in P_
    if self._k == 1:
       ^^^^^^^
AttributeError: 'aampi' object has no attribute '_k'

@parfeniukink Thank you for your question. It's hard to tell without more information/code but I think this is an issue with pickling and less so an issue with stumpy. It sounds you are trying to unpickle a STUMPY 1.11 object within a STUMPY 1.12 environment. Is that correct? If so, I wonder if you can do something like:

baseline: aampi = pickle.loads(filename)
baseline._k = 1
print(baseline.P_)

If that doesn't work, can you provide a small end-to-end reproducible code example that produces the issue?

Also, are you using the built-in Python pickle module or the cloudpickle package?

@seanlaw Good question! Let me doublecheck it :)

P.S. Thanks for the quick response!

@parfeniukink Any updates on this?

@parfeniukink Any updates on this?

Hey! Yeah, thanks for waiting! Works even without the baseline._k = 1
We can close that one.