Metadata-Version: 2.4
Name: grid-process
Version: 1.0.0
Summary: Weather forecast oriented Python library to process xarray Datasets
License-Expression: BSD-3-Clause
License-File: AUTHORS
License-File: LICENSE
Author: Mathieu Schaer
Author-email: mathieu.schaer@meteoswiss.ch
Requires-Python: >=3.11,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: bottleneck (>=1.4.0)
Requires-Dist: dask (>=2023.6.1)
Requires-Dist: geopandas (>=1.0.0)
Requires-Dist: numpy (>=1.26.0)
Requires-Dist: pandas (>=2.1.2)
Requires-Dist: pint (>=0.24.4)
Requires-Dist: pydantic (>=2.7.0)
Requires-Dist: pydantic-settings (>=2.2.0)
Requires-Dist: pyproj (>=3.6.0)
Requires-Dist: pyyaml (>=6.0)
Requires-Dist: scipy (>=1.10.1)
Requires-Dist: xarray (>=2024.6.0)
Project-URL: Changelog, https://github.com/MeteoSwiss/grid-process/blob/main/CHANGELOG.rst
Project-URL: Documentation, https://meteoswiss.github.io/grid-process/
Project-URL: Homepage, https://github.com/MeteoSwiss/grid-process
Project-URL: Repository, https://github.com/MeteoSwiss/grid-process
Description-Content-Type: text/x-rst

.. image:: https://img.shields.io/pypi/v/grid-process.svg
    :target: https://pypi.org/project/grid-process/

.. image:: https://img.shields.io/pypi/pyversions/grid-process.svg
    :target: https://pypi.org/project/grid-process/

.. image:: https://img.shields.io/pypi/l/grid-process.svg
    :target: https://pypi.org/project/grid-process/

.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml/badge.svg
    :target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml

.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml/badge.svg
    :target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml

===============
Getting Started
===============

Weather forecast oriented Python library to process xarray Datasets.

.. warning::

    **Project status and deprecation outlook.** ``grid-process`` mainly serves the needs of MeteoSwiss operational
    processing. As equivalent functionality becomes available in the
    `ECMWF earthkit ecosystem <https://earthkit.ecmwf.int/>`_, parts of this library, potentially all of it, will be
    gradually deprecated in favour of earthkit. Any deprecation will be announced in the changelog. If you start a new
    project, please consider earthkit first.

Features
--------

* Grid to points interpolations routines
* Temporal interpolation routines
* Spatial and temporal aggregation routines
* Ensemble and spatial statistics
* Configurable data model (dimension, coordinate and variable names) to support many data conventions
* And much more

.. note::

    ``grid-process`` was originally developed internally at MeteoSwiss as ``gridefix-process`` (versions 1 to 6),
    to process grids from an internal grid database. The first open-source release is ``1.0.0``.
    See `Migrating from gridefix-process`_ if you are upgrading from the internal package.

Development Setup with Poetry
-----------------------------

Building the Project
''''''''''''''''''''
.. code-block:: console

    $ cd grid-process
    $ poetry install

Run Tests
'''''''''

.. code-block:: console

    $ poetry run pytest

Run Quality Tools
'''''''''''''''''

.. code-block:: console

    $ poetry run pylint grid_process
    $ poetry run mypy grid_process
    $ poetry run ruff format

Generate Documentation
''''''''''''''''''''''

.. code-block:: console

    $ poetry run sphinx-build doc doc/_build

Then open the index.html file generated in *grid-process/doc/_build/*.

Build wheels
''''''''''''

.. code-block:: console

    $ poetry build

Using the Library
-----------------

To install grid-process in your project, run this command in your terminal:

.. code-block:: console

    $ poetry add grid-process

You can then use the library in your project through

.. code-block:: python

    import grid_process

Migrating from gridefix-process
-------------------------------

* Package and import name: ``gridefix-process`` / ``gridefix_process`` became ``grid-process`` / ``grid_process``.
* Environment variable prefix: ``GRIDEFIX_PROCESS__`` became ``GRID_PROCESS__``
  (e.g. ``GRID_PROCESS__data_model__validtime``).
* Versioning restarts at ``1.0.0``; the last internal release was ``gridefix-process`` 6.0.1.

Release the Project
-------------------

The project follows the **GitOps concept**: releases are triggered whenever a Git TAG is created.

The TAG must follow the `semantic version <https://semver.org/>`__ format and `PEP 440 <https://peps.python.org/pep-0440/>`__ , otherwise the release task will fail.

Follow these steps to create a new release:

* Adapt CHANGELOG.rst with release information
* Adapt ``doc/_static/switcher_config.json`` adding the new documentation URL for the release
* Create a new Release in the Github project

