grid-process 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- grid_process-1.0.0/AUTHORS +11 -0
- grid_process-1.0.0/CHANGELOG.rst +15 -0
- grid_process-1.0.0/LICENSE +29 -0
- grid_process-1.0.0/PKG-INFO +155 -0
- grid_process-1.0.0/README.rst +122 -0
- grid_process-1.0.0/grid_process/__init__.py +14 -0
- grid_process-1.0.0/grid_process/aggreg.py +447 -0
- grid_process-1.0.0/grid_process/blending.py +206 -0
- grid_process-1.0.0/grid_process/config/__init__.py +5 -0
- grid_process-1.0.0/grid_process/config/grid_process.yaml +20 -0
- grid_process-1.0.0/grid_process/config/library_settings.py +68 -0
- grid_process-1.0.0/grid_process/da_utils.py +104 -0
- grid_process-1.0.0/grid_process/data_model.py +531 -0
- grid_process-1.0.0/grid_process/ds_utils.py +61 -0
- grid_process-1.0.0/grid_process/ens_stats.py +396 -0
- grid_process-1.0.0/grid_process/grid_interp.py +2016 -0
- grid_process-1.0.0/grid_process/grid_interp_utils.py +208 -0
- grid_process-1.0.0/grid_process/helpers.py +174 -0
- grid_process-1.0.0/grid_process/optimization.py +50 -0
- grid_process-1.0.0/grid_process/sun.py +502 -0
- grid_process-1.0.0/grid_process/time_utils.py +110 -0
- grid_process-1.0.0/grid_process/timeseries.py +547 -0
- grid_process-1.0.0/grid_process/units_conv.py +209 -0
- grid_process-1.0.0/pyproject.toml +95 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
=========
|
|
2
|
+
Changelog
|
|
3
|
+
=========
|
|
4
|
+
|
|
5
|
+
1.0.0
|
|
6
|
+
-----
|
|
7
|
+
|
|
8
|
+
First open-source release of ``grid-process``, the continuation of the internal MeteoSwiss library
|
|
9
|
+
``gridefix-process`` (last internal version: 6.0.1).
|
|
10
|
+
|
|
11
|
+
**Breaking Change** (compared to ``gridefix-process`` 6.0.1)
|
|
12
|
+
|
|
13
|
+
* renamed the package from ``gridefix-process`` to ``grid-process`` (import name ``grid_process``)
|
|
14
|
+
* renamed the environment variable prefix from ``GRIDEFIX_PROCESS__`` to ``GRID_PROCESS__``
|
|
15
|
+
* versioning restarts at ``1.0.0``
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, MeteoSwiss
|
|
4
|
+
Authors: Mathieu Schaer <mathieu.schaer@meteoswiss.ch>
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: grid-process
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Weather forecast oriented Python library to process xarray Datasets
|
|
5
|
+
License-Expression: BSD-3-Clause
|
|
6
|
+
License-File: AUTHORS
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Author: Mathieu Schaer
|
|
9
|
+
Author-email: mathieu.schaer@meteoswiss.ch
|
|
10
|
+
Requires-Python: >=3.11,<3.14
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Requires-Dist: bottleneck (>=1.4.0)
|
|
16
|
+
Requires-Dist: dask (>=2023.6.1)
|
|
17
|
+
Requires-Dist: geopandas (>=1.0.0)
|
|
18
|
+
Requires-Dist: numpy (>=1.26.0)
|
|
19
|
+
Requires-Dist: pandas (>=2.1.2)
|
|
20
|
+
Requires-Dist: pint (>=0.24.4)
|
|
21
|
+
Requires-Dist: pydantic (>=2.7.0)
|
|
22
|
+
Requires-Dist: pydantic-settings (>=2.2.0)
|
|
23
|
+
Requires-Dist: pyproj (>=3.6.0)
|
|
24
|
+
Requires-Dist: pyyaml (>=6.0)
|
|
25
|
+
Requires-Dist: scipy (>=1.10.1)
|
|
26
|
+
Requires-Dist: xarray (>=2024.6.0)
|
|
27
|
+
Project-URL: Changelog, https://github.com/MeteoSwiss/grid-process/blob/main/CHANGELOG.rst
|
|
28
|
+
Project-URL: Documentation, https://meteoswiss.github.io/grid-process/
|
|
29
|
+
Project-URL: Homepage, https://github.com/MeteoSwiss/grid-process
|
|
30
|
+
Project-URL: Repository, https://github.com/MeteoSwiss/grid-process
|
|
31
|
+
Description-Content-Type: text/x-rst
|
|
32
|
+
|
|
33
|
+
.. image:: https://img.shields.io/pypi/v/grid-process.svg
|
|
34
|
+
:target: https://pypi.org/project/grid-process/
|
|
35
|
+
|
|
36
|
+
.. image:: https://img.shields.io/pypi/pyversions/grid-process.svg
|
|
37
|
+
:target: https://pypi.org/project/grid-process/
|
|
38
|
+
|
|
39
|
+
.. image:: https://img.shields.io/pypi/l/grid-process.svg
|
|
40
|
+
:target: https://pypi.org/project/grid-process/
|
|
41
|
+
|
|
42
|
+
.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml/badge.svg
|
|
43
|
+
:target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml
|
|
44
|
+
|
|
45
|
+
.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml/badge.svg
|
|
46
|
+
:target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml
|
|
47
|
+
|
|
48
|
+
===============
|
|
49
|
+
Getting Started
|
|
50
|
+
===============
|
|
51
|
+
|
|
52
|
+
Weather forecast oriented Python library to process xarray Datasets.
|
|
53
|
+
|
|
54
|
+
.. warning::
|
|
55
|
+
|
|
56
|
+
**Project status and deprecation outlook.** ``grid-process`` mainly serves the needs of MeteoSwiss operational
|
|
57
|
+
processing. As equivalent functionality becomes available in the
|
|
58
|
+
`ECMWF earthkit ecosystem <https://earthkit.ecmwf.int/>`_, parts of this library, potentially all of it, will be
|
|
59
|
+
gradually deprecated in favour of earthkit. Any deprecation will be announced in the changelog. If you start a new
|
|
60
|
+
project, please consider earthkit first.
|
|
61
|
+
|
|
62
|
+
Features
|
|
63
|
+
--------
|
|
64
|
+
|
|
65
|
+
* Grid to points interpolations routines
|
|
66
|
+
* Temporal interpolation routines
|
|
67
|
+
* Spatial and temporal aggregation routines
|
|
68
|
+
* Ensemble and spatial statistics
|
|
69
|
+
* Configurable data model (dimension, coordinate and variable names) to support many data conventions
|
|
70
|
+
* And much more
|
|
71
|
+
|
|
72
|
+
.. note::
|
|
73
|
+
|
|
74
|
+
``grid-process`` was originally developed internally at MeteoSwiss as ``gridefix-process`` (versions 1 to 6),
|
|
75
|
+
to process grids from an internal grid database. The first open-source release is ``1.0.0``.
|
|
76
|
+
See `Migrating from gridefix-process`_ if you are upgrading from the internal package.
|
|
77
|
+
|
|
78
|
+
Development Setup with Poetry
|
|
79
|
+
-----------------------------
|
|
80
|
+
|
|
81
|
+
Building the Project
|
|
82
|
+
''''''''''''''''''''
|
|
83
|
+
.. code-block:: console
|
|
84
|
+
|
|
85
|
+
$ cd grid-process
|
|
86
|
+
$ poetry install
|
|
87
|
+
|
|
88
|
+
Run Tests
|
|
89
|
+
'''''''''
|
|
90
|
+
|
|
91
|
+
.. code-block:: console
|
|
92
|
+
|
|
93
|
+
$ poetry run pytest
|
|
94
|
+
|
|
95
|
+
Run Quality Tools
|
|
96
|
+
'''''''''''''''''
|
|
97
|
+
|
|
98
|
+
.. code-block:: console
|
|
99
|
+
|
|
100
|
+
$ poetry run pylint grid_process
|
|
101
|
+
$ poetry run mypy grid_process
|
|
102
|
+
$ poetry run ruff format
|
|
103
|
+
|
|
104
|
+
Generate Documentation
|
|
105
|
+
''''''''''''''''''''''
|
|
106
|
+
|
|
107
|
+
.. code-block:: console
|
|
108
|
+
|
|
109
|
+
$ poetry run sphinx-build doc doc/_build
|
|
110
|
+
|
|
111
|
+
Then open the index.html file generated in *grid-process/doc/_build/*.
|
|
112
|
+
|
|
113
|
+
Build wheels
|
|
114
|
+
''''''''''''
|
|
115
|
+
|
|
116
|
+
.. code-block:: console
|
|
117
|
+
|
|
118
|
+
$ poetry build
|
|
119
|
+
|
|
120
|
+
Using the Library
|
|
121
|
+
-----------------
|
|
122
|
+
|
|
123
|
+
To install grid-process in your project, run this command in your terminal:
|
|
124
|
+
|
|
125
|
+
.. code-block:: console
|
|
126
|
+
|
|
127
|
+
$ poetry add grid-process
|
|
128
|
+
|
|
129
|
+
You can then use the library in your project through
|
|
130
|
+
|
|
131
|
+
.. code-block:: python
|
|
132
|
+
|
|
133
|
+
import grid_process
|
|
134
|
+
|
|
135
|
+
Migrating from gridefix-process
|
|
136
|
+
-------------------------------
|
|
137
|
+
|
|
138
|
+
* Package and import name: ``gridefix-process`` / ``gridefix_process`` became ``grid-process`` / ``grid_process``.
|
|
139
|
+
* Environment variable prefix: ``GRIDEFIX_PROCESS__`` became ``GRID_PROCESS__``
|
|
140
|
+
(e.g. ``GRID_PROCESS__data_model__validtime``).
|
|
141
|
+
* Versioning restarts at ``1.0.0``; the last internal release was ``gridefix-process`` 6.0.1.
|
|
142
|
+
|
|
143
|
+
Release the Project
|
|
144
|
+
-------------------
|
|
145
|
+
|
|
146
|
+
The project follows the **GitOps concept**: releases are triggered whenever a Git TAG is created.
|
|
147
|
+
|
|
148
|
+
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.
|
|
149
|
+
|
|
150
|
+
Follow these steps to create a new release:
|
|
151
|
+
|
|
152
|
+
* Adapt CHANGELOG.rst with release information
|
|
153
|
+
* Adapt ``doc/_static/switcher_config.json`` adding the new documentation URL for the release
|
|
154
|
+
* Create a new Release in the Github project
|
|
155
|
+
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
.. image:: https://img.shields.io/pypi/v/grid-process.svg
|
|
2
|
+
:target: https://pypi.org/project/grid-process/
|
|
3
|
+
|
|
4
|
+
.. image:: https://img.shields.io/pypi/pyversions/grid-process.svg
|
|
5
|
+
:target: https://pypi.org/project/grid-process/
|
|
6
|
+
|
|
7
|
+
.. image:: https://img.shields.io/pypi/l/grid-process.svg
|
|
8
|
+
:target: https://pypi.org/project/grid-process/
|
|
9
|
+
|
|
10
|
+
.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml/badge.svg
|
|
11
|
+
:target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_test.yaml
|
|
12
|
+
|
|
13
|
+
.. image:: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml/badge.svg
|
|
14
|
+
:target: https://github.com/MeteoSwiss/grid-process/actions/workflows/CI_publish_dev_documentation.yaml
|
|
15
|
+
|
|
16
|
+
===============
|
|
17
|
+
Getting Started
|
|
18
|
+
===============
|
|
19
|
+
|
|
20
|
+
Weather forecast oriented Python library to process xarray Datasets.
|
|
21
|
+
|
|
22
|
+
.. warning::
|
|
23
|
+
|
|
24
|
+
**Project status and deprecation outlook.** ``grid-process`` mainly serves the needs of MeteoSwiss operational
|
|
25
|
+
processing. As equivalent functionality becomes available in the
|
|
26
|
+
`ECMWF earthkit ecosystem <https://earthkit.ecmwf.int/>`_, parts of this library, potentially all of it, will be
|
|
27
|
+
gradually deprecated in favour of earthkit. Any deprecation will be announced in the changelog. If you start a new
|
|
28
|
+
project, please consider earthkit first.
|
|
29
|
+
|
|
30
|
+
Features
|
|
31
|
+
--------
|
|
32
|
+
|
|
33
|
+
* Grid to points interpolations routines
|
|
34
|
+
* Temporal interpolation routines
|
|
35
|
+
* Spatial and temporal aggregation routines
|
|
36
|
+
* Ensemble and spatial statistics
|
|
37
|
+
* Configurable data model (dimension, coordinate and variable names) to support many data conventions
|
|
38
|
+
* And much more
|
|
39
|
+
|
|
40
|
+
.. note::
|
|
41
|
+
|
|
42
|
+
``grid-process`` was originally developed internally at MeteoSwiss as ``gridefix-process`` (versions 1 to 6),
|
|
43
|
+
to process grids from an internal grid database. The first open-source release is ``1.0.0``.
|
|
44
|
+
See `Migrating from gridefix-process`_ if you are upgrading from the internal package.
|
|
45
|
+
|
|
46
|
+
Development Setup with Poetry
|
|
47
|
+
-----------------------------
|
|
48
|
+
|
|
49
|
+
Building the Project
|
|
50
|
+
''''''''''''''''''''
|
|
51
|
+
.. code-block:: console
|
|
52
|
+
|
|
53
|
+
$ cd grid-process
|
|
54
|
+
$ poetry install
|
|
55
|
+
|
|
56
|
+
Run Tests
|
|
57
|
+
'''''''''
|
|
58
|
+
|
|
59
|
+
.. code-block:: console
|
|
60
|
+
|
|
61
|
+
$ poetry run pytest
|
|
62
|
+
|
|
63
|
+
Run Quality Tools
|
|
64
|
+
'''''''''''''''''
|
|
65
|
+
|
|
66
|
+
.. code-block:: console
|
|
67
|
+
|
|
68
|
+
$ poetry run pylint grid_process
|
|
69
|
+
$ poetry run mypy grid_process
|
|
70
|
+
$ poetry run ruff format
|
|
71
|
+
|
|
72
|
+
Generate Documentation
|
|
73
|
+
''''''''''''''''''''''
|
|
74
|
+
|
|
75
|
+
.. code-block:: console
|
|
76
|
+
|
|
77
|
+
$ poetry run sphinx-build doc doc/_build
|
|
78
|
+
|
|
79
|
+
Then open the index.html file generated in *grid-process/doc/_build/*.
|
|
80
|
+
|
|
81
|
+
Build wheels
|
|
82
|
+
''''''''''''
|
|
83
|
+
|
|
84
|
+
.. code-block:: console
|
|
85
|
+
|
|
86
|
+
$ poetry build
|
|
87
|
+
|
|
88
|
+
Using the Library
|
|
89
|
+
-----------------
|
|
90
|
+
|
|
91
|
+
To install grid-process in your project, run this command in your terminal:
|
|
92
|
+
|
|
93
|
+
.. code-block:: console
|
|
94
|
+
|
|
95
|
+
$ poetry add grid-process
|
|
96
|
+
|
|
97
|
+
You can then use the library in your project through
|
|
98
|
+
|
|
99
|
+
.. code-block:: python
|
|
100
|
+
|
|
101
|
+
import grid_process
|
|
102
|
+
|
|
103
|
+
Migrating from gridefix-process
|
|
104
|
+
-------------------------------
|
|
105
|
+
|
|
106
|
+
* Package and import name: ``gridefix-process`` / ``gridefix_process`` became ``grid-process`` / ``grid_process``.
|
|
107
|
+
* Environment variable prefix: ``GRIDEFIX_PROCESS__`` became ``GRID_PROCESS__``
|
|
108
|
+
(e.g. ``GRID_PROCESS__data_model__validtime``).
|
|
109
|
+
* Versioning restarts at ``1.0.0``; the last internal release was ``gridefix-process`` 6.0.1.
|
|
110
|
+
|
|
111
|
+
Release the Project
|
|
112
|
+
-------------------
|
|
113
|
+
|
|
114
|
+
The project follows the **GitOps concept**: releases are triggered whenever a Git TAG is created.
|
|
115
|
+
|
|
116
|
+
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.
|
|
117
|
+
|
|
118
|
+
Follow these steps to create a new release:
|
|
119
|
+
|
|
120
|
+
* Adapt CHANGELOG.rst with release information
|
|
121
|
+
* Adapt ``doc/_static/switcher_config.json`` adding the new documentation URL for the release
|
|
122
|
+
* Create a new Release in the Github project
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Copyright (c) 2026 MeteoSwiss, contributors listed in AUTHORS
|
|
2
|
+
#
|
|
3
|
+
# Distributed under the terms of the BSD 3-Clause License.
|
|
4
|
+
#
|
|
5
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
grid-process provides functionalities to process xarray Datasets from weather
|
|
9
|
+
forecast grids, following configurable data models and conventions.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from grid_process.config.library_settings import LibrarySettings
|
|
13
|
+
|
|
14
|
+
CONFIG = LibrarySettings()
|