diff --git a/Makefile b/Makefile index db046484..60026f43 100644 --- a/Makefile +++ b/Makefile @@ -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 . diff --git a/Untitled.ipynb b/Untitled.ipynb deleted file mode 100644 index 8c538c3f..00000000 --- a/Untitled.ipynb +++ /dev/null @@ -1,33 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "a922d141-d705-453e-9816-0899283d9cbb", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "dev_ecc", - "language": "python", - "name": "dev_ecc" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.13" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/docs/development.rst b/docs/development.rst index 38ab61d0..eaca6ecf 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -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 diff --git a/docs/install.rst b/docs/install.rst index f8d6ae48..248a704c 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -1,8 +1,11 @@ Installation ============ -Installing earthkit-data ----------------------------- +Installing from PyPI +------------------------------------ + +Minimal installation ++++++++++++++++++++++++++ Install **earthkit-data** with python3 (>= 3.8) and ``pip`` as follows: @@ -10,7 +13,58 @@ Install **earthkit-data** with python3 (>= 3.8) and ``pip`` as follows: 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 + - eccovjson: provides access to coverage json data served by the :ref:`data-sources-polytope` source + +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 diff --git a/setup.cfg b/setup.cfg index 1bbb626a..e9d6268b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,37 +21,53 @@ 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 xarray>=0.19.0 earthkit-meteo>=0.0.1 - aws-requests-auth - eccovjson>=0.0.5 include_package_data = True [options.packages.find] 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 = + pdbufr>=0.11.0 +projection = cartopy +geopandas = geopandas +eccovjson = eccovjson>=0.0.5 +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] + earthkit-data[eccovjson] test = + earthkit-data[all] pytest pytest-cov pytest-forked