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

Feature/optional dependencies #269

Merged
merged 21 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d2a093c
Add install config for optional dependencies
sandorkertesz Dec 4, 2023
950572c
Add install config for optional dependencies
sandorkertesz Dec 4, 2023
918ad71
Add install config for optional dependencies
sandorkertesz Dec 4, 2023
13e1986
Add install config for optional dependencies
sandorkertesz Dec 4, 2023
7bfb42e
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Dec 4, 2023
75b0cdf
Merge from develop
sandorkertesz Dec 13, 2023
022a39a
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Jan 2, 2024
33dd47e
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Jan 16, 2024
bae1528
Merge from develop
sandorkertesz Jan 18, 2024
9afb85c
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Jan 22, 2024
99be990
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Jan 23, 2024
446eeba
Merge from develop
sandorkertesz Jan 26, 2024
32d741e
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Feb 6, 2024
2540fde
Merge from develop
sandorkertesz Feb 22, 2024
a6216ce
Merge branch 'develop' into feature/optional-dependencies
sandorkertesz Feb 22, 2024
101e841
Merge from develop
sandorkertesz Mar 14, 2024
dc5e407
Make dependencies optional
sandorkertesz Mar 14, 2024
eb1c231
Make dependencies optional
sandorkertesz Mar 14, 2024
a0e1f28
Make dependencies optional
sandorkertesz Mar 14, 2024
a1666e4
Make eccovjson an optional dependency
sandorkertesz Mar 15, 2024
3e3dbe6
Update docs
sandorkertesz Mar 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ qa:
pre-commit run --all-files

unit-tests:
python -m pytest -vv -m 'not notebook and not no_cache_init and not plugin' --cov=. --cov-report=$(COV_REPORT)
python -m pytest -vv -m 'not notebook and not no_cache_init' --cov=. --cov-report=$(COV_REPORT)
python -m pytest -v -m "notebook"
python -m pytest --forked -vv -m 'no_cache_init'
python -m pytest -v -m "plugin"

# type-check:
# python -m mypy .
Expand Down
33 changes: 0 additions & 33 deletions Untitled.ipynb

This file was deleted.

14 changes: 13 additions & 1 deletion docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ To run the test suite, you can use the following command:

.. code-block:: shell

pytest
make unit-tests

Please note this will not run any of the tests based on remote services e.g. :ref:`data-sources-mars`. These are disabled by default because they can take a very long time to complete or just hang. To enable all these tests you need to run:

.. code-block:: shell

pytest -E long -v

If just want to run e.g. the :ref:`data-sources-cds` tests you can use:

.. code-block:: shell

pytest -E long -v -k cds


Build documentation
Expand Down
59 changes: 56 additions & 3 deletions docs/install.rst
Original file line number Diff line number Diff line change
@@ -1,16 +1,69 @@
Installation
============

Installing earthkit-data
----------------------------
Installing from PyPI
------------------------------------

Minimal installation
+++++++++++++++++++++++++

Install **earthkit-data** with python3 (>= 3.8) and ``pip`` as follows:

.. code-block:: bash

python3 -m pip install earthkit-data

Alternatively, install via ``conda`` with:
The package installed like this is **minimal** supporting only GRIB and NetCDF data and cannot access remote services other than URLs. If you want to use more data types or remote services you need to install the optional Python packages.

Installing all the optional packages
++++++++++++++++++++++++++++++++++++++++

You can install **earthkit-data** with all the optional packages in one go by using:

.. code-block:: bash

python3 -m pip install earthkit-data[all]

Please note in **zsh** you need to use quotes around the square brackets:

.. code-block:: bash

python3 -m pip install "earthkit-data[all]"


Installing individual optional packages
+++++++++++++++++++++++++++++++++++++++++

Alternatively, you can install the following components:

- mars: provides access to the :ref:`data-sources-mars` source
- cds: provides access to the :ref:`data-sources-cds` and :ref:`data-sources-ads` sources
- ecmwf-opendata: provides access to the :ref:`data-sources-eod`
- wekeo: provides access to the :ref:`data-sources-wekeo` and :ref:`data-sources-wekeocds` sources
- fdb: provides access to the :ref:`data-sources-fdb` source
- polytope: provides access to the :ref:`data-sources-polytope` source
- bufr: provides full support for the :ref:`bufr` data type
- odb: provides full support for the :ref:`odb` data type
- geopandas: adds geojson/geopandas support
- projection: adds projection support

E.g. to add :ref:`data-sources-mars` support you can use:

.. code-block:: bash

python3 -m pip install earthkit-data[mars]

List of optional dependencies can also be specified :

.. code-block:: bash

python3 -m pip install earthkit-data[cds,mars]


Installing with conda
---------------------------------------

Install **earthkit-data** via ``conda`` with:

.. code-block:: bash

Expand Down
33 changes: 25 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@ test_suite = tests
[options]
packages = find_namespace:
install_requires =
cdsapi
cfgrib>=0.9.10.1
eccodes>=1.5.0
ecmwf-api-client>=1.6.1
ecmwf-opendata>=0.3.3
polytope-client>=0.7.2
dask
entrypoints
filelock
hda
jinja2
markdown
multiurl
netcdf4
pdbufr>=0.11.0
pyfdb
pyodc
pandas
pyyaml
scipy
tqdm
Expand All @@ -51,7 +44,31 @@ include_package_data = True
include = earthkit.*

[options.extras_require]
mars = ecmwf-api-client>=1.6.1
cds = cdsapi
fdb = pyfdb
polytope = polytope-client>=0.7.2
wekeo = hda
ecmwf-opendata = ecmwf-opendata>=0.3.3
odb = pyodc
bufr =
eccodes>=1.5.0
pdbufr>=0.11.0
projection = cartopy
geopandas = geopandas
all =
earthkit-data[mars]
earthkit-data[cds]
earthkit-data[ecmwf-opendata]
earthkit-data[fdb]
earthkit-data[polytope]
earthkit-data[wekeo]
earthkit-data[odb]
earthkit-data[bufr]
earthkit-data[projection]
earthkit-data[geopandas]
test =
earthkit-data[all]
pytest
pytest-cov
pytest-forked
Expand Down
Loading