Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a47fa45
Improve file-pattern target performance for GRIB (#974)
sandorkertesz Apr 27, 2026
6fd7632
Release notes 0.19.4 (#975)
sandorkertesz Apr 27, 2026
bf993bd
Release 0.20.0 (#993)
sandorkertesz May 13, 2026
715a9fa
Fix release notes 0.20.0 (#994)
sandorkertesz May 13, 2026
bec0369
Release notes (#995)
sandorkertesz May 13, 2026
74bcb9b
Release notes
sandorkertesz Jun 23, 2026
03bd476
Release notes
sandorkertesz Jun 23, 2026
482bad3
Release notes
sandorkertesz Jun 23, 2026
50505d1
Merge branch 'develop' into release/1.0.0
sandorkertesz Jun 23, 2026
c4a8ac7
Release notes
sandorkertesz Jun 23, 2026
4e813ce
Merge branch 'develop' into release/1.0.0
sandorkertesz Jun 24, 2026
da150d0
Geography docs
sandorkertesz Jun 24, 2026
f81bb5d
use ls in script docs
sandorkertesz Jun 24, 2026
7a4e1f9
Merge branch 'develop' into release/1.0.0
sandorkertesz Jun 24, 2026
e238899
Encoders docs
sandorkertesz Jun 24, 2026
e7dc947
Release notes
sandorkertesz Jun 25, 2026
68706a7
Test and docs
sandorkertesz Jun 25, 2026
477551d
Revert conftest
sandorkertesz Jun 25, 2026
5deef20
Docs
sandorkertesz Jun 25, 2026
88810ee
Move how-tos to tutorials
sandorkertesz Jun 25, 2026
ff13039
Merge branch 'develop' into release/1.0.0
sandorkertesz Jun 25, 2026
19b4d4a
Fix tests
sandorkertesz Jun 25, 2026
ea46195
Use new binaries
sandorkertesz Jun 25, 2026
c4a574b
Notebook titles
sandorkertesz Jun 26, 2026
b2cc798
The doc on "Level types" updated to code changes in PR #1039 (#1042)
pawel-wolff Jun 26, 2026
31f536c
docs: deduplicate faq in sidebar
Oisin-M Jun 26, 2026
d6efb11
docs: capitalisation
Oisin-M Jun 26, 2026
af01a37
Enable geo test
sandorkertesz Jun 26, 2026
3adeafa
Docs
sandorkertesz Jun 26, 2026
a118019
Disable unstructred geo test
sandorkertesz Jun 26, 2026
fcb2199
Set gradiated maturity and remove rc from installation
sandorkertesz Jun 28, 2026
a76f8ca
Set status to stable
sandorkertesz Jun 28, 2026
8887cb4
Merge develop 1rc into main
sandorkertesz Jun 28, 2026
d5de40c
Merge pull request #1043 from ecmwf/feature/merge-develop-1rc-into-main
sandorkertesz Jun 28, 2026
9e854e7
Release notes
sandorkertesz Jun 28, 2026
7bf0e9b
Release notes
sandorkertesz Jun 28, 2026
a1d209b
Set earthkit dependencies versions to >=1 and < 2
sandorkertesz Jun 29, 2026
39b53fa
Merge branch 'main' into release/1.0.0
sandorkertesz Jun 29, 2026
9510385
Merge pull request #1034 from ecmwf/release/1.0.0
sandorkertesz Jun 29, 2026
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
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ docs/source/experimental/*.pp*
docs/source/experimental/*.png*
docs/source/experimental/*.nc*
docs/source/experimental/*.geojson*
ocs/_build/
docs/source/tutorials/*.tar
docs/source/tutorials/*.zip
docs/source/tutorials/_*
docs/source/tutorials/earthkit_use_cases/*.grib
docs/source/tutorials/*/_*


autodocs/

Expand Down
Empty file added :ref:
Empty file.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<img src="https://github.com/ecmwf/codex/raw/refs/heads/main/ESEE/foundation_badge.svg" alt="ECMWF Software EnginE">
</a>
<a href="https://github.com/ecmwf/codex/raw/refs/heads/main/Project Maturity">
<img src="https://github.com/ecmwf/codex/raw/refs/heads/main/Project Maturity/incubating_badge.svg" alt="Maturity Level">
<img src="https://github.com/ecmwf/codex/raw/refs/heads/main/Project Maturity/graduated_badge.svg" alt="Maturity Level">
</a>
<!-- <a href="https://codecov.io/gh/ecmwf/earthkit-data">
<img src="https://codecov.io/gh/ecmwf/earthkit-data/branch/main/graph/badge.svg" alt="Code Coverage">
Expand All @@ -35,7 +35,7 @@
</p>

> \[!IMPORTANT\]
> This software is **Incubating** and subject to ECMWF's guidelines on [Software Maturity](https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity).
> This software is **Graduated** and subject to ECMWF's guidelines on [Software Maturity](https://github.com/ecmwf/codex/raw/refs/heads/main/Project%20Maturity).

**earthkit-data** is a format-agnostic interface for geospatial data with a focus on meteorology and
climate science. It is the data handling component of [earthkit](https://github.com/ecmwf/earthkit).
Expand Down
2 changes: 1 addition & 1 deletion docs/source/concepts/caching.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The cache location can be read and modified with Python (see the details below).

.. tip::

See the :ref:`/how-tos/misc/cache.ipynb` notebook for examples.
See the :ref:`/tutorials/misc/cache.ipynb` notebook for examples.

.. note::

Expand Down
6 changes: 3 additions & 3 deletions docs/source/concepts/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The configuration can be accessed and modified from Python. The configuration op

See the following notebooks for examples:

- :ref:`/how-tos/misc/config.ipynb`
- :ref:`/how-tos/misc/config_env_vars.ipynb`
- :ref:`/tutorials/misc/config.ipynb`
- :ref:`/tutorials/misc/config_env_vars.ipynb`


.. _config_get:
Expand Down Expand Up @@ -138,7 +138,7 @@ Finally, unset the environment variable and check the config value again, which

See also the following notebook:

- :ref:`/how-tos/misc/config_env_vars.ipynb`
- :ref:`/tutorials/misc/config_env_vars.ipynb`


.. _config_table:
Expand Down
10 changes: 5 additions & 5 deletions docs/source/concepts/data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ To access the stream we need to convert the data into a stream fieldlist (GRIB)
.. code-block:: python

>>> import earthkit.data as ekd
>>> url = "https://sites.ecmwf.int/repository/earthkit-data/how-tos/test4.grib"
>>> url = "https://sites.ecmwf.int/repository/earthkit-data/tutorials/test4.grib"
>>> ds = ekd.from_source("url", url, stream=True)
>>> fl = ds.to_fieldlist()
>>> for f in fl:
Expand All @@ -102,10 +102,10 @@ To access the stream we need to convert the data into a stream fieldlist (GRIB)
Examples
////////////////

- :ref:`/how-tos/source/data_from_stream.ipynb`
- :ref:`/how-tos/source/file_stream.ipynb`
- :ref:`/how-tos/source/fdb.ipynb`
- :ref:`/how-tos/source/url_stream.ipynb`
- :ref:`/tutorials/source/data_from_stream.ipynb`
- :ref:`/tutorials/source/file_stream.ipynb`
- :ref:`/tutorials/source/fdb.ipynb`
- :ref:`/tutorials/source/url_stream.ipynb`


Special cases
Expand Down
54 changes: 0 additions & 54 deletions docs/source/concepts/encoders.rst

This file was deleted.

158 changes: 158 additions & 0 deletions docs/source/concepts/encoders/encoders.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
.. _encoders:

Encoders
========

An **encoder** converts data into a serialisable format that can be written to a
:ref:`target <targets>`. Encoders are most commonly used implicitly through
:func:`~earthkit.data.to_target`, but can also be created and used directly.

.. note::

The encoders are still under development. The most advanced encoder is the :ref:`grib_encoder`, which can handle a variety of data types. Currently, the other encoders only support trivial encoding of data into a serialisable format. For example, the NetCDF encoder simply calls :py:func:`xarray.to_netcdf` on an xarray Dataset/DataArray.

Creating an encoder
-------------------

Use :func:`~earthkit.data.encoders.create_encoder` to instantiate an encoder by name:

.. code-block:: python

>>> from earthkit.data import create_encoder
>>> enc = create_encoder("grib")
>>> enc = create_encoder("grib", template=my_field, shortName="2t")

.. py:function:: create_encoder(name, *args, **kwargs)

Create an encoder identified by *name*.

:param str name: Name of an encoder (see table below).
:param args: Positional arguments forwarded to the encoder constructor.
:param kwargs: Keyword arguments forwarded to the encoder constructor.
:rtype: Encoder


Common constructor parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

All encoders accept the following keyword arguments in their constructors:

.. list-table::
:header-rows: 1
:widths: 20 80

* - Parameter
- Description
* - ``template``
- A default template object used as the basis for encoding. The exact accepted types depend on the encoder.
* - ``metadata``
- A dictionary of default metadata applied to every encoded item. Metadata supplied
directly to :meth:`Encoder.encode` is merged on top, with the per-call values taking
precedence.
* - ``**kwargs``
- Any additional keyword arguments are interpreted as metadata keys and merged into
``metadata``.


Encoding data
-------------

All encoders expose an :meth:`encode` method:

.. code-block:: python

>>> enc = create_encoder("grib", template=field)
>>> result = enc.encode(values=arr, shortName="2t", step=6)
>>> result.to_file(open("out.grib", "wb"))

.. py:method:: Encoder.encode(data=None, values=None, metadata={}, template=None, check_nans=False, missing_value=9999, target=None, **kwargs)

Encode *data* and return an :class:`EncodedData` object.

:param data: Earthkit data object to encode (Field, FieldList, xarray Dataset/DataArray, …).
:param values: Raw values array to encode.
:param dict metadata: Per-call metadata merged on top of the encoder's default metadata.
:param template: Per-call template overriding the encoder's default template.
:param bool check_nans: Replace ``NaN`` values with *missing_value* before encoding.
:param missing_value: Replacement value used when *check_nans* is ``True``.
:param target: Target object; some encoders use this to optimise the output format.
:rtype: EncodedData


Automatic encoder selection
----------------------------

When writing to a file target without specifying an encoder explicitly, the encoder is
selected automatically from the file extension:

.. list-table::
:header-rows: 1
:widths: 30 70

* - Extension(s)
- Encoder
* - ``.grib``, ``.grb``, ``.grib1``, ``.grib2``, ``.grb1``, ``.grb2``
- ``grib``
* - ``.nc``, ``.nc3``, ``.nc4``, ``.netcdf``
- ``netcdf``
* - ``.tiff``, ``.tif``
- ``geotiff``
* - ``.bufr``
- ``bufr``
* - ``.odb``
- ``odb``


Available encoders
-----------------

.. list-table::
:header-rows: 1
:widths: 16 52 32

* - Name
- Description
- Class
* - ``grib``
- Encode data as GRIB. Supports Fields, FieldLists, and NumPy arrays. Requires a
template or sufficient metadata to construct a valid GRIB message.
- :py:class:`~earthkit.data.encoders.grib.GribEncoder`
* - ``netcdf``
- Encode data as NetCDF via xarray. Accepts Fields, FieldLists, and xarray
Datasets/DataArrays.
- :py:class:`~earthkit.data.encoders.netcdf.NetCDFEncoder`
* - ``geotiff``
- Encode data as GeoTIFF. Requires geo-referenced raster data.
- :py:class:`~earthkit.data.encoders.geotiff.GeoTIFFEncoder`
* - ``csv``
- Encode tabular data as comma-separated values.
- :py:class:`~earthkit.data.encoders.csv.CSVEncoder`
* - ``bufr``
- Encode data as BUFR (Binary Universal Form for the Representation of meteorological
data).
- :py:class:`~earthkit.data.encoders.bufr.BufrEncoder`
* - ``odb``
- Encode data as ODB (Observational DataBase) format.
- :py:class:`~earthkit.data.encoders.odb.ODBEncoder`
* - ``zarr``
- Encode data as a Zarr array store.
- :py:class:`~earthkit.data.encoders.zarr.ZarrEncoder`
* - ``covjson``
- Encode data as CoverageJSON (CovJSON).
- :py:class:`~earthkit.data.encoders.covjson.CovJsonEncoder`
* - ``geojson``
- Encode data as GeoJSON.
- :py:class:`~earthkit.data.encoders.geojson.GeoJsonEncoder`
* - ``pp``
- Encode data as Met Office PP (UM binary) format.
- :py:class:`~earthkit.data.encoders.pp.PPEncoder`
* - ``text``
- Encode data as plain text.
- :py:class:`~earthkit.data.encoders.text.TextEncoder`



Examples
--------

- :ref:`/tutorials/target/grib_encoder.ipynb`
Loading
Loading