GithubHelp home page GithubHelp logo

athkouloumvakos / pythea Goto Github PK

View Code? Open in Web Editor NEW
22.0 4.0 7.0 5.67 MB

PyThea is an open-source software package to perform coronal mass ejection (CME) and shock wave 3D reconstruction using multi-viewpoint remote-sensing observations.

Home Page: https://www.pythea.org/

License: GNU General Public License v3.0

Python 100.00%
solar-physics python heliophysics

pythea's Introduction

PyThea: A software package to reconstruct the 3D structure of CMEs and shock waves

made-with-python Version Release Date License: GPL v3 flake8 pytest pypi

Logo

PyThea is an open-source software package that can be used to reconstruct the 3D structure of Coronal Mass Ejections (CMEs) and shock waves and determine their kinematics using remote-sensing observations. The tool implements the Graduated Cylindrical Shell (GCS) model that can be used to reconstruct CMEs and two geometrical models, namely a spheroid and ellipsoid model to reconstruct shock waves. It also implements remote-sensing observations from multiple viewpoints such as the Solar and Heliospheric Observatory (SoHO) and Solar Terrestrial Relations Observatory (STEREO).

Note

The lead author of PyThea (A. Kouloumvakos) has been awarded a NASA Grant (80NSSC24K0071) for further developing and improving PyThea, during fiscal year 2024. The awarded proposal is part of the NASA Headquarters Heliophysics Tools and Methods Program in response to NASA ROSES–2022 (NNH22ZDA001N). The proposed software enhancements and new features encompass a range of improvements, including but not limited to: improved code documentation, expanded and improved code testing, improved image processing and visualization, and the incorporation of new solar mission imaging data.

πŸ’Ύ Installation

We recommend, creating a virtual environment for PyThea and installing the package from PyPI using pip.

If you use Anaconda or Miniconda (which we also recommend) you can create a virtual environment using conda and then install PyThea using from PyPI using pip. In the terminal do the following:

# Create a virtual environment. Use python>3.9
conda create --name PyThea python=3.10

# Activate the environment
conda activate PyThea

# install the required packages using pip3
pip3 install PyThea

# Run locally the application with streamlit (see also the section "Run locally the PyThea application" )
PyThea streamlit

# When you are done you can deactivate the virtual environment
conda deactivate

If conda is not your favorite way of creating a virtual environment in python, then you can manually create it and install PyThea with pip as previously shown. For example, you can do the following:

# Create a virtual environment.
python3 -m venv PyThea

# Activate the environment
source PyThea/bin/activate

# install the required packages using pip3
pip3 install PyThea

# Run locally the application with streamlit (see also the section "Run locally the PyThea application" )
PyThea streamlit

# When you are done you can deactivate the virtual environment
deactivate

At the directory where the terminal is open, this method will create a folder named /PyThea and install PyThea and all the required packages inside.

⬆️ Update

To update the package to the latest version activate the environment first and then:

# Update _PyThea_ using pip3
pip3 install PyThea -U

One way to see witch version is installed in your environment is to open a python session and do:

import PyThea
PyThea.__version__

You can also see the verion used and the latest version on the main page of the application.

🐾 Run locally the PyThea application

After installing PyThea software package you can run the application using the terminal.

If the environment is not active then use conda activate PyThea or source PyThea/bin/activate to activate this and then run PyThea with

PyThea streamlit

The application should now open in the default browser!

Deactivate the environment when you finish.

If there is an error when running PyThea streamlit then you can manually run PyThea following these steps:

  1. Locate where PyThea_app.py have been instaled. This is usually inside the anaconda3 enviroment folder. For example here ~/opt/anaconda3/envs/PyThea/lib/python3.9/site-packages/PyThea

  2. Then run the PyThea_app.py using: streamlit run <PyTheaRootDir>/PyThea_app.py replacing <PyTheaRootDir> with your path first.

πŸ“™ Usage

Complete documentation of the PyThea can be found in https://www.pythea.org/.

πŸ“¦ Useful Python packages

  • SunPy: The community-developed, free and open-source solar data analysis environment for Python.
  • AstroPy: The Astropy Project is a community effort to develop a single core package for Astronomy in Python.
  • gcs_python: An implementation of the Graduated Cylindrical Shell model in python.

πŸ“œ Acknowledging or Citing PyThea https://www.frontiersin.org/articles/10.3389/fspas.2022.974137/ https://doi.org/10.5281/zenodo.5713659

If you use PyThea for scientific work or research presented in a publication, please mention it in the main text and cite PyThea paper (see Paper or ADS). Additionally, add in the methods or acknowledgements section the following: "This research has made use of PyThea v?.?.?, an open-source and free Python package to reconstruct the 3D structure of CMEs and shock waves (Zenodo: https://doi.org/10.5281/zenodo.5713659)." and changing the v?.?.? to the version you have used. To acknowledge PyThea in posters or talks include the project logo or icon. PyThea has a strong dependency on SunPy and AstroPy Python packages, consider citing these packages as well.

β“˜ The mythology of Thea:

In Greek mythology, Thea, also called Euryphaessa "wide-shining", is the Titaness of sight and the shining light of the clear blue sky. Her brother/consort is Hyperion, a Titan and god of the sun, and together they are the parents of Helios (the Sun), Selene (the Moon), and Eos (the Dawn).

pythea's People

Contributors

athkouloumvakos avatar jgieseler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pythea's Issues

STEREO COR2 data are sometimes missing in the app

Sometimes the STEREO COR2 data are missing so the imager is not loaded in the app.

The issue is that the VSO search for STEREO COR2 data does not always return all the availiable Total Brigtnessc (TB) COR2 fits files that are provided by the STEREO site (https://stereo-ssc.nascom.nasa.gov/data/ins_data/secchi/L0/) so the app cannot load this imager because in most of the cases the search returns no TB images for the full date. This issue has been reported to SunPy and it is under ivestigation. More details here: sunpy/sunpy#7439

Make posible to work with PyThea in "offline" mode

Every time that PyThea loads an event or a fitting file, it searches VSO for data. If there are no newer data, it skips the downloading part and continues with the image loading. This makes the process completely dependent on a network connection.

It could be a useful feature to make an "offline" mode. In this case, if the data for an event have been downloaded, the app will automatically skip the Fido search and it will load directly the available images.

This step to complete, might need some sophisticated handling on the downloaded files, e.g. to database the fits files.

Problem during working on multiple fittings in one session

I am running the GUI on Windows OS and the GUI opens in my browser. After I finish working on a CME event and I refresh the webpage to reset it and start working on another CME event, it doesn't download the data files. I have to close the entire session and re-launch PyThea again.
Is there a way to work on many CMEs during the same session without closing it and relaunching the GUI?

pip installation fails on Windows because of non-existing HOME

On Windows, the pip installation fails because Windows doesn't have a HOME environment variable (at least not always); it uses USERPROFILE instead (as far as I understand):

(base) PS C:\Users\user> pip install PyThea==0.7.1
Collecting PyThea==0.7.1
  Using cached PyThea-0.7.1.tar.gz (48 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  Γ— Getting requirements to build wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "C:\Users\user\miniconda3\envs\base\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\user\miniconda3\envs\base\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\user\miniconda3\envs\base\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-pfvfasnq\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-pfvfasnq\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-pfvfasnq\overlay\Lib\site-packages\setuptools\build_meta.py", line 484, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:\Users\user\AppData\Local\Temp\pip-build-env-pfvfasnq\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 10, in <module>
        File "C:\Users\user\miniconda3\envs\base\lib\os.py", line 679, in __getitem__
          raise KeyError(key) from None
      KeyError: 'HOME'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

This can be fixed, for example, by replacing os.environ['HOME'] with Path.home() (requires from pathlib import Path).

Pip install fails with windows

Users experience propblems to pip install with windows. The installation results to the following error:

Collecting PyThea==0.6.6
  Downloading PyThea-0.6.6.tar.gz (52 kB)
     ---------------------------------------- 52.8/52.8 kB 686.2 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  Γ— Getting requirements to build wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "C:\Users\_\Anaconda3\envs\serpentine\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
          main()
        File "C:\Users\_\Anaconda3\envs\serpentine\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\_\Anaconda3\envs\serpentine\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-g6r15qer\overlay\Lib\site-packages\setuptools\build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-g6r15qer\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-g6r15qer\overlay\Lib\site-packages\setuptools\build_meta.py", line 482, in run_setup
          super(_BuildMetaLegacyBackend,
        File "C:\Users\_\AppData\Local\Temp\pip-build-env-g6r15qer\overlay\Lib\site-packages\setuptools\build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 14, in <module>
        File "C:\Users\_\Anaconda3\envs\serpentine\lib\encodings\cp1252.py", line 23, in decode
          return codecs.charmap_decode(input,self.errors,decoding_table)[0]
      UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2825: character maps to <undefined>
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

It seems that the following error:

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2825: character maps to <undefined>

is caused during the setup process when reading README.txt.

In Windows, the default encoding is cp1252, but that readme is encoded in UTF8 and some characters map incorectlly.

Solution I will implement soon:

In setup.py

with open('README_pypi.md', 'r') as f: change to with open('README_pypi.md', 'r', encoding="utf8") as f:

AttributeError: module 'astropy.units' has no attribute 'si_prefixes' when running PyThea

Description:
I encountered an error when using the PyThea tool. The error occurs during the second phase of the program after selecting an event and model to use. Here are the steps to reproduce the issue and the relevant details of my setup.


Steps to Reproduce:

  1. Install PyThea in a clean/new Python 3.10 Anaconda environment using pip3 install PyThea.
  2. Start the app with PyThea streamlit.
  3. Select a timestamp/event (e.g., CME 2010/04/03 11:45) and GCS reconstruction method.
  4. Proceed to the second program phase.

Expected Behavior:
The program should start downloading (e.g. COR2A) files.


Actual Behavior:
The program throws an AttributeError:

AttributeError: module 'astropy.units' has no attribute 'si_prefixes'

and fails to proceed. The full traceback is as follows:

Traceback:
File "C:\Users\user\anaconda3\envs\PyThea\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script
    exec(code, module.__dict__)
File "C:\Users\user\anaconda3\envs\PyThea\Lib\site-packages\PyThea\PyThea_app.py", line 504, in <module>
    run()
File "C:\Users\user\anaconda3\envs\PyThea\Lib\site-packages\PyThea\PyThea_app.py", line 270, in run
    downloaded_files = download_fits(timerange, imager)
File "C:\Users\user\anaconda3\envs\PyThea\lib\site-packages\PyThea\utils.py", line 179, in download_fits
    print(result)
File "C:\Users\user\anaconda3\envs\PyThea\lib\site-packages\sunpy\net\fido_factory.py", line 190, in __str__
    size = block.total_size()
File "C:\Users\user\anaconda3\envs\PyThea\lib\site-packages\sunpy\net\base_client.py", line 308, in total_size
    prefix_dict = {p[2]: p[0][0] for p in u.si_prefixes}

System Information:

  • OS: Windows 11 23H2
  • Anaconda Navigator: 2.6.1
  • Python Version: 3.10.14

Better handling errors when ``download_fits`` fails and PyThea app interrupts

There are two situations when curently the download_fits results to error and the use of the app is interrupted.

The first is when a .fits file is corrupted and it cannot be imported by sunpy.Map. Sometimes this happens when the net connection is bad and the fido fetches the data incomplete from VSO.

This results to the following error for example: OSError: Failed to read /sunpy/data/20120712_170800_d4c2b.fts
If the the user removes the file manually and rerun the download process, then the file is downloaded again and loads correct.
However, the resulted error has the effect to reset the application status, so it needs a fix.

The second error appear when the ssl certificate verification sometimes errors as follows:
Cannot connect to host seal.nascom.nasa.gov:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)')]

In this case the data are not downloaded or loaded at all. So the application returs an error in any case.
Untill the remote server issue is resolved the app cannot be used and this is a problem

Finding where the data are downloaded

I am running the GUI from my local computer and I was wondering where the data are downloaded. I could not find the fts files at the virtual env folder of PyThea.

pip installation not working with clean python 3.10 conda environment

Trying to install pythea-0.6.2.dev4 via pip in a clean python 3.10 conda environment runs into problems (python 3.9 works, though):

$ conda create --name pythea python=3.10
$ conda activate pythea
$ pip install PyThea
Collecting PyThea
  Using cached PyThea-0.6.2.dev4.tar.gz (52 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done

...

INFO: pip is looking at multiple versions of toolz to determine which version is compatible with other requirements. This could take a while.
Collecting toolz
  Using cached toolz-0.11.1-py3-none-any.whl (55 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. If you want to abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what happened here: https://pip.pypa.io/surveys/backtracking
  Using cached toolz-0.11.0-py3-none-any.whl (55 kB)
  Using cached toolz-0.10.0.tar.gz (49 kB)
  Using cached toolz-0.9.0.tar.gz (45 kB)
  Using cached toolz-0.8.2.tar.gz (45 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/gieseler/anaconda3/envs/pythea/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/setup.py'"'"'; __file__='"'"'/tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-h1c41d14
         cwd: /tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/setup.py", line 5, in <module>
        import toolz
      File "/tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/toolz/__init__.py", line 3, in <module>
        from .functoolz import *
      File "/tmp/pip-install-itg43j3k/toolz_eeb33d28100f4183b7e09eafa641ffd1/toolz/functoolz.py", line 501
        f.__name__ for f in reversed((self.first,) + self.funcs),
        ^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/75/9c/a26de5efd56009e15af607bff6d2a395631e3c20e7c64b861c9bc4b34288/toolz-0.8.2.tar.gz#sha256=4a13c90c426001d6299c5568cf5b98e095df9c985df194008a67f84ef4fc6c50 (from https://pypi.org/simple/toolz/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached toolz-0.8.1.tar.gz (44 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/gieseler/anaconda3/envs/pythea/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-1lbiti9u
         cwd: /tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/setup.py", line 5, in <module>
        import toolz
      File "/tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/toolz/__init__.py", line 3, in <module>
        from .functoolz import *
      File "/tmp/pip-install-itg43j3k/toolz_789baededa2a4706ad7142ec8c5919b5/toolz/functoolz.py", line 483
        f.__name__ for f in reversed((self.first,) + self.funcs),
        ^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/38/70/cf3187c8735d4d091990315faf4af2edb0a7271727cf92e10657e1bb3db9/toolz-0.8.1.tar.gz#sha256=b3922e3545e892b4aeac5c20ea19fef75b3dfe366f1f2fcea941b3c836b3c160 (from https://pypi.org/simple/toolz/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached toolz-0.8.0.tar.gz (40 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/gieseler/anaconda3/envs/pythea/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-kwdgv71o
         cwd: /tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/setup.py", line 5, in <module>
        import toolz
      File "/tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/toolz/__init__.py", line 3, in <module>
        from .functoolz import *
      File "/tmp/pip-install-itg43j3k/toolz_cc5f9236922c4511b6787093e9b0c85f/toolz/functoolz.py", line 467
        f.__name__ for f in reversed((self.first,) + self.funcs),
        ^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/9e/b0/47e994b3b370087d388d2bb9dfc97c7e901b801265ccd1e8e9fd16eda1b8/toolz-0.8.0.tar.gz#sha256=e8451af61face57b7c5d09e71c0d27b8005f001ead56e9fdf470417e5cc6d479 (from https://pypi.org/simple/toolz/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached toolz-0.7.4.tar.gz (29 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/gieseler/anaconda3/envs/pythea/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/setup.py'"'"'; __file__='"'"'/tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5zyji6ts
         cwd: /tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/setup.py", line 5, in <module>
        import toolz
      File "/tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/toolz/__init__.py", line 3, in <module>
        from .functoolz import *
      File "/tmp/pip-install-itg43j3k/toolz_033baf108c2844079ff2060363cd0c22/toolz/functoolz.py", line 414
        f.__name__ for f in reversed((self.first,) + self.funcs),
        ^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/ad/2d/61cc2053bfb830ccf43bb63ee4f6ec01be34b578ea9a2d20a8971f969fa7/toolz-0.7.4.tar.gz#sha256=43c2c9e5e7a16b6c88ba3088a9bfc82f7db8e13378be7c78d6c14a5f8ed05afd (from https://pypi.org/simple/toolz/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached toolz-0.7.3.tar.gz (29 kB)
    ERROR: Command errored out with exit status 1:
     command: /home/gieseler/anaconda3/envs/pythea/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-gj_emaus
         cwd: /tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/
    Complete output (10 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/setup.py", line 5, in <module>
        import toolz
      File "/tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/toolz/__init__.py", line 3, in <module>
        from .functoolz import *
      File "/tmp/pip-install-itg43j3k/toolz_b0e69da7ee5647ea8ea96dd34590bbc0/toolz/functoolz.py", line 414
        f.__name__ for f in reversed((self.first,) + self.funcs),
        ^^^^^^^^^^^^^^^^
    SyntaxError: Generator expression must be parenthesized
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/e7/bb/109bd58499e8eb980c476400bf27acb4f3db87833e4f874b857e66fad49e/toolz-0.7.3.tar.gz#sha256=6de9f0cd7888b12fe1603c56473c2392f33880cb356760e085b8c17afedce0f9 (from https://pypi.org/simple/toolz/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Using cached toolz-0.7.2.tar.gz (27 kB)
  Using cached toolz-0.7.1.tar.gz (19 kB)
  Using cached toolz-0.7.0.tar.gz (18 kB)
INFO: pip is looking at multiple versions of toolz to determine which version is compatible with other requirements. This could take a while.
  Using cached toolz-0.6.0.tar.gz (15 kB)
  Using cached toolz-0.5.3.tar.gz (14 kB)
  Using cached toolz-0.5.2.tar.gz (15 kB)

pip also struggled determing the correct version for vedo, validators, tzdata, pytz-deprecation-shim and tzlocal before, but managed to do it after some time.

Don't know if one could catch the problem by manually defining the corresponding package versions in setup.cfg. And I'm curious why this problem only affects python 3.10; probably this upgrades one single package that is incompatible with all the others.

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

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))

PyThea reuses code from gcs_python without following the license terms

It seems that PyThea contains portions of the code that have been copied or adapted from my original GCS-Python implementation, but fails to acknowledge this properly according to the terms of the MIT License:

[...] subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

As far as I see, the PyThea paper also does not acknowledge that an open-source GCS implementation in Python already existed before and that parts of it have been reused.

Upgrading to PyThea version 0.8.0 results to a running error

It seems that upgrading to the new version of PyThea and running it in the command line with PyThea streamlit results to the following error: Tried to use SessionInfo before it was initialized.

This is caused from streamlit upgrade to 1.30.0 whereas everything works as expected for streamlit==1.29.0.

PyThea seems to run withought issues with streamlit run PyThea/PyThea_app.py but not with 'PyThea stramlit' so the problem is propably caussed by streamlit cli.

The issue will be investigated further and will be corrected in a new release.

Tip

To resolve this issue either downgrade streamlit with pip3 install streamlit==1.29.0 and run PyThea as normal or run PyThea with streamlit run PyThea/PyThea_app.py

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.