CLIMADA-project / climada_petals

See https://github.com/CLIMADA-project/climada_python first
GNU General Public License v3.0
22 stars 13 forks source link

climada-petals package does not contain the `data` directory #86

Closed peanutfun closed 11 months ago

peanutfun commented 12 months ago

Contrary to the climada package, the climada-petals package does not contain the data directory of its repository. Is this on purpose or an error?

Compare:

climada_petals/setup.py https://github.com/CLIMADA-project/climada_petals/blob/main/setup.py#L45

climada/setup.py https://github.com/CLIMADA-project/climada_python/blob/main/setup.py#L43

peanutfun commented 12 months ago

I just found out that this is an issue. If you never installed climada_petals before, you cannot import the version downloaded with pip, because the contents of the data directory cannot be loaded:

>>> import climada_petals
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ldr.riedel/mambaforge/envs/climada_test/lib/python3.9/site-packages/climada_petals/__init__.py", line 57, in copy_repo_data
    copyfile(src, path)
  File "/Users/ldr.riedel/mambaforge/envs/climada_test/lib/python3.9/shutil.py", line 264, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/ldr.riedel/mambaforge/envs/climada_test/lib/python3.9/site-packages/data/system/GDP2Asset_converter_2.5arcmin.nc'
peanutfun commented 11 months ago

@emanuel-schmid This is a plot-stopper with regard to the conda package for climada-petals, see https://github.com/conda-forge/staged-recipes/pull/23463. We need a new pip release with the data included. However, I think we have to resolve https://github.com/CLIMADA-project/climada_python/issues/760 first.

peanutfun commented 11 months ago

From personal discussion: We will resolve this issue first, and try to find a solution that we can also apply to resolve https://github.com/CLIMADA-project/climada_python/issues/760.

jcarvoli commented 11 months ago

Does it mean the until the issue is resolved I am not able to install/use climada_petals latest issue? I am currently trying to run climada petals for the first time. Though installation seems to go through fine, I get a ModuleNotFoundError when trying to import it. Could that be related to this issue?

peanutfun commented 11 months ago

@jcarvoli We do not yet support installing Climada Petals via Pip. For installing Core and Petals, please follow the advanced installation instructions in the documentation. Doing so will not use the (erroneous) PyPI package. If you encounter any issues following these instructions, please raise a separate issue.