Skip to content

Commit 8560fa5

Browse files
committed
Merge branch 'master' into pont-612-rfc3339
2 parents 05c655c + 50022a9 commit 8560fa5

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

CHANGES.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
## Changes in 0.10.1 (in development)
1+
## Changes in 0.10.2 (in development)
22

33
### Enhancements
44

55
### Fixes
66

7+
### Other
8+
9+
## Changes in 0.10.1
10+
11+
### Fixes
12+
13+
* Deprecated argument `xy_var_names` in function `GridMapping.from_dataset`,
14+
thereby preventing a NotImplementedError. (#551)
15+
716
### Other Changes
817

9-
* For compatibility, now also `xcube.__version__` now contains the xcube
18+
* For compatibility, now also `xcube.__version__` contains the xcube
1019
version number.
1120

12-
1321
## Changes in 0.10.0
1422

1523
### Incompatible Changes

test/core/gridmapping/test_dataset.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,6 @@ def test_from_sentinel_2(self):
131131
self.assertEqual('Geographic 2D CRS', gm.crs.type_name)
132132
self.assertEqual(False, gm.is_regular)
133133

134-
def test_xy_names(self):
135-
dataset = create_s2plus_dataset()
136-
with self.assertRaises(ValueError) as cm:
137-
GridMapping.from_dataset(dataset, xy_var_names=('lons', 'lats'))
138-
self.assertEqual('coordinate variables "lons" or "lats" not found in dataset', f'{cm.exception}')
139-
140-
dataset = create_s2plus_dataset()
141-
with self.assertRaises(NotImplementedError) as cm:
142-
GridMapping.from_dataset(dataset, xy_var_names=('lon', 'lat'))
143-
self.assertEqual('xy_var_names not yet supported', f'{cm.exception}')
144-
145134
def test_no_grid_mapping_found(self):
146135
with self.assertRaises(ValueError) as cm:
147136
GridMapping.from_dataset(xr.Dataset())

xcube/core/gridmapping/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ def from_dataset(cls,
648648
:param crs: Optional spatial coordinate reference system.
649649
:param xy_var_names: Optional tuple of the x- and
650650
y-coordinate variables in *dataset*.
651+
Deprecated since xcube 0.10.1.
651652
:param tile_size: Optional tile size
652653
:param prefer_is_regular: Whether to prefer a regular
653654
grid mapping if multiple found. Default is True.

xcube/core/gridmapping/dataset.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# SOFTWARE.
2121

2222
from typing import Optional, Union, Tuple
23+
import warnings
2324

2425
import pyproj
2526
import xarray as xr
@@ -53,13 +54,10 @@ def new_grid_mapping_from_dataset(
5354
prefer_crs = _normalize_crs(prefer_crs)
5455
else:
5556
prefer_crs = crs
56-
if xy_var_names is not None:
57-
x_var_name, y_var_name = xy_var_names
58-
if x_var_name not in dataset or y_var_name not in dataset:
59-
raise ValueError(f'coordinate variables "{x_var_name}" '
60-
f'or "{y_var_name}" not found in dataset')
61-
# TODO: create new instance using named coordinate variables
62-
raise NotImplementedError('xy_var_names not yet supported')
57+
if xy_var_names:
58+
warnings.warn('Argument "xy_var_names" is deprecated since '
59+
'xcube 0.10.1 and will be ignored.',
60+
category=DeprecationWarning)
6361

6462
grid_mapping_proxies = get_dataset_grid_mapping_proxies(
6563
dataset,

xcube/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2020
# SOFTWARE.
2121

22-
version = '0.10.1.dev0'
22+
version = '0.10.2.dev0'

0 commit comments

Comments
 (0)