xarray-selafin 0.2.5__tar.gz → 0.2.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: xarray-selafin
3
- Version: 0.2.5
3
+ Version: 0.2.6
4
4
  Summary:
5
5
  Author: tomsail
6
6
  Author-email: saillour.thomas@gmail.com
@@ -18,6 +18,8 @@ Description-Content-Type: text/markdown
18
18
  [![Available on pypi](https://img.shields.io/pypi/v/xarray-selafin.svg)](https://pypi.python.org/pypi/xarray-selafin/)
19
19
  [![CI](https://github.com/oceanmodeling/xarray-selafin/actions/workflows/run_tests.yml/badge.svg)](https://github.com/oceanmodeling/xarray-selafin/actions/workflows/run_tests.yml)
20
20
 
21
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/oceanmodeling/xarray-selafin/blob/main/workshop/01_getting_started.ipynb)
22
+
21
23
  # xarray backend for Selafin formats
22
24
 
23
25
  Supports lazy loading by default.
@@ -139,3 +141,9 @@ All attributes are optional except `ikle2`:
139
141
  | variables | Dictionary with variable names and units (key is variable abbreviation) | - |
140
142
  | date_start | Starting date with integers (year to seconds) | (from first time serie) |
141
143
 
144
+ ## Cite this project
145
+
146
+ ```
147
+ Saillour, Thomas; Salamon, Peter; Voukouvalas, Evangelos; Bourban, Sébastien E.; Cuomo, Giovanni (2024): Support for global models and integration of TELEMAC in a Python-based ecosystem. In: Proceedings of the XXXth TELEMAC User Conference, Chambéry, 8–9 October 2024.
148
+ ```
149
+
@@ -1,6 +1,8 @@
1
1
  [![Available on pypi](https://img.shields.io/pypi/v/xarray-selafin.svg)](https://pypi.python.org/pypi/xarray-selafin/)
2
2
  [![CI](https://github.com/oceanmodeling/xarray-selafin/actions/workflows/run_tests.yml/badge.svg)](https://github.com/oceanmodeling/xarray-selafin/actions/workflows/run_tests.yml)
3
3
 
4
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/oceanmodeling/xarray-selafin/blob/main/workshop/01_getting_started.ipynb)
5
+
4
6
  # xarray backend for Selafin formats
5
7
 
6
8
  Supports lazy loading by default.
@@ -121,3 +123,9 @@ All attributes are optional except `ikle2`:
121
123
  | ikle3 | Connectivity table in 3D (1-indexed, only in 3D, optional) | (can be rebuilt from 2D) |
122
124
  | variables | Dictionary with variable names and units (key is variable abbreviation) | - |
123
125
  | date_start | Starting date with integers (year to seconds) | (from first time serie) |
126
+
127
+ ## Cite this project
128
+
129
+ ```
130
+ Saillour, Thomas; Salamon, Peter; Voukouvalas, Evangelos; Bourban, Sébastien E.; Cuomo, Giovanni (2024): Support for global models and integration of TELEMAC in a Python-based ecosystem. In: Proceedings of the XXXth TELEMAC User Conference, Chambéry, 8–9 October 2024.
131
+ ```
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "xarray-selafin"
3
- version = "0.2.5"
3
+ version = "0.2.6"
4
4
  description = ""
5
5
  authors = ["tomsail <saillour.thomas@gmail.com>", "lucduron <l.duron@cnr.tm.fr>"]
6
6
  readme = "README.md"
@@ -262,7 +262,9 @@ class SelafinAccessor:
262
262
  # Check input DataSet
263
263
  if "plan" not in self._ds.dims:
264
264
  raise RuntimeError("get_dataset_as_2d requires a 3D DataSet")
265
- assert 0 <= plan <= self._ds.sizes.get("plan") - 1
265
+ nb_planes = self._ds.sizes["plan"]
266
+ if not -nb_planes <= plan < nb_planes:
267
+ raise IndexError(f"plan {plan} is out of range [-{nb_planes}, {nb_planes - 1}]")
266
268
 
267
269
  # Generate a shallow copy
268
270
  ds_out = self._ds.copy(deep=False).isel(plan=plan)