PyPSA / PyPSA/atlite

eccodes dependency is not correctly installed when using uv for development

Open
#506 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs classification type: bug
Dominant language
Python
Stars
402
Forks
134
PR merge metrics
No merged PRs in 30d

Description

Version Checks (indicate both or one)
  • I have confirmed this bug exists on the lastest release of atlite.

  • I have confirmed this bug exists on the current master branch of atlite.

Issue Description

Since [v 0.4.1] atlite uses grib to download data from CDS by default. This requires the cdfgrib backend for xarray. This in turn requires the EcCodes library to be present on the system.

This is not well documented, and results in failed downloads, and the test suite failing by default, without an explicit error message.

Reproducible Example
git clone https://github.com/PyPSA/atlite
cd atlite
uv sync --extra dev
uv run pytest test/ -v

Fails with:

ValueError: unrecognized engine 'cfgrib' must be one of your download engines: ['netcdf4', 'h5netcdf', 'scipy', 'pydap', 'store'].
Expected Behavior

tests pass

Installed Versions
appdirs==1.4.4 apsw==3.43.0.0 argcomplete==3.1.4 asttokens==2.4.1 async-timeout==4.0.3 attrs==23.2.0 Babel==2.10.3 bcc==0.29.1 bcrypt==3.2.2 beautifulsoup4==4.12.3 blinker==1.7.0 Brlapi==0.8.5 Brotli==1.1.0 certifi==2023.11.17 chardet==5.2.0 click==8.1.6 cloud-init==25.3 colorama==0.4.6 command-not-found==0.3 configobj==5.0.8 contourpy==1.0.7 cryptography==41.0.7 css-parser==1.0.10 cssselect==1.2.0 cupshelpers==1.0 cycler==0.11.0 dbus-python==1.3.2 decorator==5.1.1 defer==1.0.6 distro==1.9.0 distro-info==1.7+build1 dnspython==2.6.1 duplicity==2.1.4 executing==2.0.1 fasteners==0.18 feedparser==6.0.10 fonttools==4.46.0 fs==2.4.16 html2text==2024.2.26 html5-parser==0.4.12 html5lib==1.1 httplib2==0.20.4 idna==3.6 ifaddr==0.2.0 ipython==8.20.0 jedi==0.19.1 jeepney==0.8.0 Jinja2==3.1.2 jsonpatch==1.32 jsonpointer==2.0 jsonschema==4.10.3 kiwisolver==0.0.0 language-selector==0.1 launchpadlib==1.11.0 lazr.restfulclient==0.14.6 lazr.uri==1.0.6 libevdev==0.5 louis==3.29.0 lxml==5.2.1 lz4==4.0.2+dfsg Mako==1.3.2.dev0 Markdown==3.5.2 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.6.3 matplotlib-inline==0.1.6 mdurl==0.1.2 mechanize==0.4.9 meson==1.3.2 monotonic==1.6 mpmath==0.0.0 msgpack==1.0.3 netaddr==0.8.0 netifaces==0.11.0 numpy==1.26.4 oauthlib==3.2.2 olefile==0.46 packaging==24.0 paramiko==2.12.0 parso==0.8.3 pexpect==4.9.0 pillow==10.2.0 pipx==1.4.3 platformdirs==4.2.0 prompt-toolkit==3.0.43 psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.0.0 py7zr==0.11.3+dfsg pycairo==1.25.1 pychm==0.8.6 pycryptodomex==3.20.0 pycups==2.0.1 Pygments==2.17.2 PyGObject==3.48.2 PyJWT==2.7.0 PyNaCl==1.5.0 pyparsing==3.1.1 PyQt6==6.6.1 PyQt6-sip==13.6.0 PyQt6-WebEngine==6.6.0 pyrsistent==0.20.0 pyserial==3.5 python-apt==2.7.7+ubuntu5.2 python-dateutil==2.8.2 python-debian==0.1.49+ubuntu2 pytz==2024.1 pyudev==0.24.0 pyxdg==0.28 PyYAML==6.0.1 regex==2022.10.31 repoze.lru==0.7 requests==2.31.0 rich==13.7.1 rofication==1.2.2 Routes==2.5.1 SciPy==1.11.4 setuptools==68.1.2 sgmllib3k==1.0.0 six==1.16.0 soupsieve==2.5 stack-data==0.6.3 sympy==1.12 systemd-python==235 texttable==1.6.7 traitlets==5.5.0 types-aiofiles==23.2 types-aws-xray-sdk==2.12 types-beautifulsoup4==4.12 types-bleach==6.1 types-boltons==23.0 types-boto==2.49 types-braintree==4.24 types-cachetools==5.3 types-caldav==1.3 types-cffi==1.16 types-chevron==0.14 types-click-default-group==1.2 types-click-spinner==0.1 types-colorama==0.4 types-commonmark==0.9 types-console-menu==0.8 types-croniter==2.0 types-dateparser==1.1 types-decorator==5.1 types-Deprecated==1.2 types-dockerfile-parse==2.0 types-docopt==0.6 types-docutils==0.20 types-editdistance==0.6 types-entrypoints==0.4 types-ExifRead==3.0 types-first==2.0 types-flake8-2020==1.8 types-flake8-bugbear==23.9.16 types-flake8-builtins==2.2 types-flake8-docstrings==1.7 types-flake8-plugin-utils==1.3 types-flake8-rst-docstrings==0.3 types-flake8-simplify==0.21 types-flake8-typing-imports==1.15 types-Flask-Cors==4.0 types-Flask-Migrate==4.0 types-Flask-SocketIO==5.3 types-fpdf2==2.7.4 types-gdb==12.1 types-google-cloud-ndb==2.2 types-greenlet==3.0 types-hdbcli==2.18 types-html5lib==1.1 types-httplib2==0.22 types-humanfriendly==10.0 types-ibm-db==3.2 types-influxdb-client==1.38 types-inifile==0.4 types-JACK-Client==0.5 types-jmespath==1.0 types-jsonschema==4.19 types-keyboard==0.13 types-ldap3==2.9 types-libsass==0.22 types-Markdown==3.5 types-mock==5.1 types-mypy-extensions==1.0 types-mysqlclient==2.2 types-netaddr==0.9 types-oauthlib==3.2 types-openpyxl==3.1 types-opentracing==2.4 types-paho-mqtt==1.6 types-paramiko==3.3 types-parsimonious==0.10 types-passlib==1.7 types-passpy==1.0 types-peewee==3.17 types-pep8-naming==0.13 types-pexpect==4.8 types-pika-ts==1.3 types-Pillow==10.1 types-playsound==1.3 types-pluggy==1.2.0 types-polib==1.2 types-portpicker==1.6 types-protobuf==4.24 types-psutil==5.9 types-psycopg2==2.9 types-pyasn1==0.5 types-pyaudio==0.2 types-PyAutoGUI==0.9 types-pycocotools==2.0 types-pycurl==7.45.2 types-pyfarmhash==0.3 types-pyflakes==3.1 types-Pygments==2.16 types-pyinstaller==6.1 types-pyjks==20.0 types-PyMySQL==1.1 types-pynput==1.7 types-pyOpenSSL==23.3 types-pyRFC3339==1.1 types-PyScreeze==0.1.29 types-pyserial==3.5 types-pysftp==0.2 types-pytest-lazy-fixture==0.6 types-python-crontab==3.0 types-python-datemath==1.5 types-python-dateutil==2.8 types-python-gflags==3.1 types-python-jose==3.3 types-python-nmap==0.7 types-python-slugify==8.0 types-python-xlib==0.33 types-pytz==2023.3.post1 types-pywin32==306 types-pyxdg==0.28 types-PyYAML==6.0 types-qrcode==7.4 types-redis==4.6.0 types-regex==2023.10.3 types-requests==2.31 types-requests-oauthlib==1.3 types-retry==0.9 types-s2clientprotocol==5 types-seaborn==0.13 types-Send2Trash==1.8 types-setuptools==68.2 types-simplejson==3.19 types-singledispatch==4.1 types-six==1.16 types-slumber==0.7 types-stdlib-list==0.8 types-stripe==3.5 types-tabulate==0.9 types-tensorflow==2.12 types-toml==0.10 types-toposort==1.10 types-tqdm==4.66 types-translationstring==1.4 types-tree-sitter==0.20.1 types-tree-sitter-languages==1.8 types-ttkthemes==3.2 types-tzlocal==5.1 types-ujson==5.8 types-untangle==1.2 types-usersettings==1.1 types-uWSGI==2.0 types-vobject==0.9 types-waitress==2.1 types-WebOb==1.8 types-whatthepatch==1.0 types-workalendar==17.0 types-WTForms==3.1 types-xmltodict==0.13 types-zstd==1.5 types-zxcvbn==4.4 typing_extensions==4.10.0 ubuntu-drivers-common==0.0.0 ubuntu-pro-client==8001 ufoLib2==0.16.0 ufw==0.36.2 unattended-upgrades==0.1 unicodedata2==15.1.0 urllib3==2.0.7 usb-creator==0.3.16 userpath==1.9.1 wadllib==1.3.6 wcwidth==0.2.5 webencodings==0.5.1 WebOb==1.8.7 wheel==0.42.0 xdg==5 xkit==0.0.0 xxhash==0.0.0 zeroconf==0.131.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running uv sync --extra dev followed by uv run pytest test/ -v to reproduce the missing cfgrib engine failure. Review the dependency configuration used by the uv development setup and the tests under test/; done means the development install provides the required backend and the test suite passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.