Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data download with FIDO breaks inside streamlit with parfive>=2.0.0 #13

Closed
AthKouloumvakos opened this issue Sep 1, 2022 · 2 comments
Closed
Labels
Bug Something isn't working Priority High

Comments

@AthKouloumvakos
Copy link
Owner

AthKouloumvakos commented Sep 1, 2022

It seems that the data download breaks with parfive>=2.0.0 with the error below.

The problem is probably an incompatibility between the parfive(asyncio) and streamlit and needs further investigation.

RuntimeError: set_wakeup_fd only works in main thread of the main interpreter
Traceback:
File "/Users/user/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 556, in _run_script
    exec(code, module.__dict__)
File "/Users/user/Desktop/Koulou_MAC/myPython/myProject/streamlit_apps/PyThea/PyThea/PyThea_app.py", line 427, in <module>
    run()
File "/Users/user/Desktop/Koulou_MAC/myPython/myProject/streamlit_apps/PyThea/PyThea/PyThea_app.py", line 209, in run
    st.session_state.map_[imager] = download_fits(st.session_state.date_process,
File "/Users/user/Desktop/Koulou_MAC/myPython/myProject/streamlit_apps/PyThea/./PyThea/utils.py", line 119, in download_fits
    downloaded_files = Fido.fetch(result)
File "/Users/user/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/sunpy/net/fido_factory.py", line 432, in fetch
    results = downloader.download()
File "/Users/user/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/parfive/downloader.py", line 330, in download
    return self._run_in_loop(self.run_download())
File "/Users/kouloa1/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/parfive/downloader.py", line 249, in _run_in_loop
    self._add_shutdown_signals(loop, task)
File "/Users/user/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/parfive/downloader.py", line 226, in _add_shutdown_signals
    loop.add_signal_handler(sig, task.cancel)
File "/Users/user/opt/anaconda3/envs/PyThea/lib/python3.9/asyncio/unix_events.py", line 97, in add_signal_handler
    raise RuntimeError(str(exc))
@AthKouloumvakos AthKouloumvakos added Bug Something isn't working Priority High Installation Installation related stuff and removed Installation Installation related stuff labels Sep 1, 2022
@AthKouloumvakos AthKouloumvakos changed the title Data download with FIDO breaks inside streamlit and parfive>=2.0.0 Data download with FIDO breaks inside streamlit with parfive>=2.0.0 Sep 1, 2022
@AthKouloumvakos
Copy link
Owner Author

In ba524a1 I pin parfive to == 1.5.1

@AthKouloumvakos
Copy link
Owner Author

AthKouloumvakos commented Dec 8, 2022

It seems that loop.add_signal_handler(sig, task.cancel) from parfive throws the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Priority High
Projects
None yet
Development

No branches or pull requests

1 participant