lina-usc / pylossless

🧠 EEG Processing pipeline that annotates continuous data
https://pylossless.readthedocs.io/en/latest/
MIT License
15 stars 8 forks source link

`EEGAnnotationList` not JSON serializable #119

Open scott-huberty opened 1 year ago

scott-huberty commented 1 year ago

There is a silent failure when serving the QC dashboard:

  File "/usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type EEGAnnotationList is not JSON serializable

I think EEGAnnotationList.annotations is a pandas series where it should be a dictionary (see this thread). This is necessary because EEGAnnotationsList is wrapped in a dcc.Store component.

I spent the weekend in a battle to deploy the dashboard to a PAAS service (Heroku/Google Cloud/Azure) to no avail. After exhausting all other avenues, I have a hunch this is the underlying issue.

I expect that deploying to a PAAS service won't be possible until this is corrected.

christian-oreilly commented 1 year ago

A full stack error would be more useful than just the last lines. Note that, in the end, we don't need the dcc.Store... this could just be replaced by a plain old dictionary I think.