roms-tools 1.7.0__py3-none-any.whl → 2.0.0__py3-none-any.whl
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.
- roms_tools/_version.py +1 -1
- roms_tools/setup/boundary_forcing.py +253 -144
- roms_tools/setup/datasets.py +216 -48
- roms_tools/setup/download.py +13 -17
- roms_tools/setup/grid.py +561 -512
- roms_tools/setup/initial_conditions.py +148 -30
- roms_tools/setup/mask.py +69 -0
- roms_tools/setup/plot.py +4 -8
- roms_tools/setup/regrid.py +4 -2
- roms_tools/setup/surface_forcing.py +11 -18
- roms_tools/setup/tides.py +9 -12
- roms_tools/setup/topography.py +92 -128
- roms_tools/setup/utils.py +49 -25
- roms_tools/setup/vertical_coordinate.py +5 -16
- roms_tools/tests/test_setup/test_boundary_forcing.py +10 -5
- roms_tools/tests/test_setup/test_data/grid.zarr/.zattrs +0 -1
- roms_tools/tests/test_setup/test_data/grid.zarr/.zmetadata +56 -201
- roms_tools/tests/test_setup/test_data/grid.zarr/Cs_r/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/grid.zarr/Cs_w/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/grid.zarr/{interface_depth_rho → sigma_r}/.zarray +2 -6
- roms_tools/tests/test_setup/test_data/grid.zarr/sigma_r/.zattrs +7 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/sigma_r/0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/{interface_depth_u → sigma_w}/.zarray +2 -6
- roms_tools/tests/test_setup/test_data/grid.zarr/sigma_w/.zattrs +7 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/sigma_w/0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zattrs +1 -2
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zmetadata +58 -203
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/Cs_r/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/Cs_w/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/h/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/h/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/mask_coarse/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/mask_rho/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/mask_u/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/mask_v/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/{grid.zarr/interface_depth_v → grid_that_straddles_dateline.zarr/sigma_r}/.zarray +2 -6
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/sigma_r/.zattrs +7 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/sigma_r/0 +0 -0
- roms_tools/tests/test_setup/test_data/{grid.zarr/layer_depth_rho → grid_that_straddles_dateline.zarr/sigma_w}/.zarray +2 -6
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/sigma_w/.zattrs +7 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/sigma_w/0 +0 -0
- roms_tools/tests/test_setup/test_grid.py +110 -12
- roms_tools/tests/test_setup/test_initial_conditions.py +2 -1
- roms_tools/tests/test_setup/test_river_forcing.py +3 -2
- roms_tools/tests/test_setup/test_surface_forcing.py +2 -22
- roms_tools/tests/test_setup/test_tides.py +2 -1
- roms_tools/tests/test_setup/test_topography.py +106 -1
- {roms_tools-1.7.0.dist-info → roms_tools-2.0.0.dist-info}/LICENSE +1 -1
- {roms_tools-1.7.0.dist-info → roms_tools-2.0.0.dist-info}/METADATA +2 -1
- {roms_tools-1.7.0.dist-info → roms_tools-2.0.0.dist-info}/RECORD +52 -76
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_rho/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_rho/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_u/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_u/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_v/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/interface_depth_v/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_rho/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_rho/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_u/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_u/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_u/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_v/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_v/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid.zarr/layer_depth_v/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_rho/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_rho/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_rho/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_u/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_u/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_u/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_v/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_v/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/interface_depth_v/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_rho/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_rho/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_rho/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_u/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_u/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_u/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_v/.zarray +0 -24
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_v/.zattrs +0 -9
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/layer_depth_v/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_vertical_coordinate.py +0 -91
- {roms_tools-1.7.0.dist-info → roms_tools-2.0.0.dist-info}/WHEEL +0 -0
- {roms_tools-1.7.0.dist-info → roms_tools-2.0.0.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -114,7 +114,7 @@ def test_plot_save_methods(tmp_path):
|
|
|
114
114
|
|
|
115
115
|
|
|
116
116
|
def test_raise_if_domain_too_large():
|
|
117
|
-
with pytest.raises(ValueError, match="Domain size
|
|
117
|
+
with pytest.raises(ValueError, match="Domain size exceeds"):
|
|
118
118
|
Grid(nx=3, ny=3, size_x=30000, size_y=30000, center_lon=0, center_lat=51.5)
|
|
119
119
|
|
|
120
120
|
# test grid with reasonable domain size
|
|
@@ -181,12 +181,6 @@ def test_compatability_with_matlab_grid(tmp_path):
|
|
|
181
181
|
"lon_v",
|
|
182
182
|
"lat_coarse",
|
|
183
183
|
"lon_coarse",
|
|
184
|
-
"layer_depth_rho",
|
|
185
|
-
"layer_depth_u",
|
|
186
|
-
"layer_depth_v",
|
|
187
|
-
"interface_depth_rho",
|
|
188
|
-
"interface_depth_u",
|
|
189
|
-
"interface_depth_v",
|
|
190
184
|
]
|
|
191
185
|
)
|
|
192
186
|
actual_coords = set(grid.ds.coords.keys())
|
|
@@ -229,7 +223,7 @@ def test_roundtrip_netcdf(tmp_path):
|
|
|
229
223
|
center_lon=0.0,
|
|
230
224
|
center_lat=0.0,
|
|
231
225
|
rot=0.0,
|
|
232
|
-
topography_source="ETOPO5",
|
|
226
|
+
topography_source={"name": "ETOPO5"},
|
|
233
227
|
hmin=5.0,
|
|
234
228
|
)
|
|
235
229
|
|
|
@@ -267,7 +261,7 @@ def test_roundtrip_yaml(tmp_path):
|
|
|
267
261
|
center_lon=0.0,
|
|
268
262
|
center_lat=0.0,
|
|
269
263
|
rot=0.0,
|
|
270
|
-
topography_source="ETOPO5",
|
|
264
|
+
topography_source={"name": "ETOPO5"},
|
|
271
265
|
hmin=5.0,
|
|
272
266
|
)
|
|
273
267
|
|
|
@@ -300,7 +294,7 @@ def test_files_have_same_hash(tmp_path):
|
|
|
300
294
|
center_lon=0.0,
|
|
301
295
|
center_lat=0.0,
|
|
302
296
|
rot=0.0,
|
|
303
|
-
topography_source="ETOPO5",
|
|
297
|
+
topography_source={"name": "ETOPO5"},
|
|
304
298
|
hmin=5.0,
|
|
305
299
|
)
|
|
306
300
|
|
|
@@ -336,7 +330,8 @@ def test_from_yaml_missing_version(tmp_path):
|
|
|
336
330
|
center_lon: -10
|
|
337
331
|
center_lat: 61
|
|
338
332
|
rot: -20
|
|
339
|
-
topography_source:
|
|
333
|
+
topography_source:
|
|
334
|
+
name: ETOPO5
|
|
340
335
|
hmin: 5.0
|
|
341
336
|
"""
|
|
342
337
|
)
|
|
@@ -405,7 +400,8 @@ def test_from_yaml_version_mismatch(tmp_path, caplog):
|
|
|
405
400
|
center_lon: -10
|
|
406
401
|
center_lat: 61
|
|
407
402
|
rot: -20
|
|
408
|
-
topography_source:
|
|
403
|
+
topography_source:
|
|
404
|
+
name: ETOPO5
|
|
409
405
|
hmin: 5.0
|
|
410
406
|
"""
|
|
411
407
|
)
|
|
@@ -432,3 +428,105 @@ def test_from_yaml_version_mismatch(tmp_path, caplog):
|
|
|
432
428
|
|
|
433
429
|
yaml_filepath = Path(yaml_filepath)
|
|
434
430
|
yaml_filepath.unlink()
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
def test_invalid_theta_s_value():
|
|
434
|
+
"""Test the validation of the theta_s value."""
|
|
435
|
+
with pytest.raises(ValueError):
|
|
436
|
+
|
|
437
|
+
Grid(
|
|
438
|
+
nx=2,
|
|
439
|
+
ny=2,
|
|
440
|
+
size_x=500,
|
|
441
|
+
size_y=1000,
|
|
442
|
+
center_lon=0,
|
|
443
|
+
center_lat=55,
|
|
444
|
+
rot=10,
|
|
445
|
+
N=3,
|
|
446
|
+
theta_s=11.0, # Invalid value, should be 0 < theta_s <= 10
|
|
447
|
+
theta_b=2.0,
|
|
448
|
+
hc=250.0,
|
|
449
|
+
)
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
def test_invalid_theta_b_value():
|
|
453
|
+
"""Test the validation of the theta_b value."""
|
|
454
|
+
with pytest.raises(ValueError):
|
|
455
|
+
Grid(
|
|
456
|
+
nx=2,
|
|
457
|
+
ny=2,
|
|
458
|
+
size_x=500,
|
|
459
|
+
size_y=1000,
|
|
460
|
+
center_lon=0,
|
|
461
|
+
center_lat=55,
|
|
462
|
+
rot=10,
|
|
463
|
+
N=3,
|
|
464
|
+
theta_s=5.0,
|
|
465
|
+
theta_b=5.0, # Invalid value, should be 0 < theta_b <= 4
|
|
466
|
+
hc=250.0,
|
|
467
|
+
)
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
def test_update_vertical_coordinate():
|
|
471
|
+
|
|
472
|
+
grid = Grid(
|
|
473
|
+
nx=2, ny=2, size_x=500, size_y=1000, center_lon=0, center_lat=55, rot=10
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
assert grid.N == 100
|
|
477
|
+
assert grid.theta_s == 5.0
|
|
478
|
+
assert grid.theta_b == 2.0
|
|
479
|
+
assert grid.hc == 300.0
|
|
480
|
+
assert len(grid.ds.s_rho) == 100
|
|
481
|
+
|
|
482
|
+
grid.update_vertical_coordinate(N=3, theta_s=10.0, theta_b=1.0, hc=400.0)
|
|
483
|
+
|
|
484
|
+
assert grid.N == 3
|
|
485
|
+
assert grid.theta_s == 10.0
|
|
486
|
+
assert grid.theta_b == 1.0
|
|
487
|
+
assert grid.hc == 400.0
|
|
488
|
+
assert len(grid.ds.s_rho) == 3
|
|
489
|
+
|
|
490
|
+
grid.update_vertical_coordinate(N=5)
|
|
491
|
+
|
|
492
|
+
assert grid.N == 5
|
|
493
|
+
assert grid.theta_s == 10.0
|
|
494
|
+
assert grid.theta_b == 1.0
|
|
495
|
+
assert grid.hc == 400.0
|
|
496
|
+
assert len(grid.ds.s_rho) == 5
|
|
497
|
+
|
|
498
|
+
grid.update_vertical_coordinate()
|
|
499
|
+
|
|
500
|
+
assert grid.N == 5
|
|
501
|
+
assert grid.theta_s == 10.0
|
|
502
|
+
assert grid.theta_b == 1.0
|
|
503
|
+
assert grid.hc == 400.0
|
|
504
|
+
assert len(grid.ds.s_rho) == 5
|
|
505
|
+
|
|
506
|
+
|
|
507
|
+
def test_plot():
|
|
508
|
+
grid = Grid(
|
|
509
|
+
nx=2,
|
|
510
|
+
ny=2,
|
|
511
|
+
size_x=500,
|
|
512
|
+
size_y=1000,
|
|
513
|
+
center_lon=0,
|
|
514
|
+
center_lat=55,
|
|
515
|
+
rot=10,
|
|
516
|
+
N=3,
|
|
517
|
+
theta_s=5.0,
|
|
518
|
+
theta_b=2.0,
|
|
519
|
+
hc=250.0,
|
|
520
|
+
)
|
|
521
|
+
grid.plot_vertical_coordinate(s=-1)
|
|
522
|
+
grid.plot_vertical_coordinate(eta=0)
|
|
523
|
+
grid.plot_vertical_coordinate(xi=0)
|
|
524
|
+
|
|
525
|
+
with pytest.raises(ValueError, match="Exactly one of"):
|
|
526
|
+
grid.plot_vertical_coordinate(s=-1, eta=0)
|
|
527
|
+
with pytest.raises(ValueError, match="Exactly one of"):
|
|
528
|
+
grid.plot_vertical_coordinate(s=-1, xi=0)
|
|
529
|
+
with pytest.raises(ValueError, match="Exactly one of"):
|
|
530
|
+
grid.plot_vertical_coordinate(eta=-1, xi=0)
|
|
531
|
+
with pytest.raises(ValueError, match="Exactly one of"):
|
|
532
|
+
grid.plot_vertical_coordinate(eta=-1, xi=0, s=-1)
|
|
@@ -323,7 +323,7 @@ def test_files_have_same_hash(river_forcing, tmp_path):
|
|
|
323
323
|
grid_filepath2.unlink()
|
|
324
324
|
|
|
325
325
|
|
|
326
|
-
def
|
|
326
|
+
def test_from_yaml_missing_river_forcing(tmp_path):
|
|
327
327
|
yaml_content = textwrap.dedent(
|
|
328
328
|
"""\
|
|
329
329
|
---
|
|
@@ -337,7 +337,8 @@ def test_from_yaml_missing_initial_conditions(tmp_path):
|
|
|
337
337
|
center_lon: -10
|
|
338
338
|
center_lat: 61
|
|
339
339
|
rot: -20
|
|
340
|
-
topography_source:
|
|
340
|
+
topography_source:
|
|
341
|
+
name: ETOPO5
|
|
341
342
|
hmin: 5.0
|
|
342
343
|
"""
|
|
343
344
|
)
|
|
@@ -153,27 +153,6 @@ def grid_that_lies_west_of_dateline_more_than_five_degrees_away():
|
|
|
153
153
|
return grid
|
|
154
154
|
|
|
155
155
|
|
|
156
|
-
@pytest.fixture
|
|
157
|
-
def grid_that_straddles_180_degree_meridian():
|
|
158
|
-
"""Fixture for creating a domain that straddles 180 degree meridian.
|
|
159
|
-
|
|
160
|
-
This is a good test grid for the global ERA5 data, which comes on an [-180, 180]
|
|
161
|
-
longitude grid.
|
|
162
|
-
"""
|
|
163
|
-
|
|
164
|
-
grid = Grid(
|
|
165
|
-
nx=5,
|
|
166
|
-
ny=5,
|
|
167
|
-
size_x=1800,
|
|
168
|
-
size_y=2400,
|
|
169
|
-
center_lon=180,
|
|
170
|
-
center_lat=61,
|
|
171
|
-
rot=20,
|
|
172
|
-
)
|
|
173
|
-
|
|
174
|
-
return grid
|
|
175
|
-
|
|
176
|
-
|
|
177
156
|
@pytest.mark.parametrize(
|
|
178
157
|
"grid_fixture",
|
|
179
158
|
[
|
|
@@ -747,7 +726,8 @@ def test_from_yaml_missing_surface_forcing(tmp_path, use_dask):
|
|
|
747
726
|
center_lon: -10
|
|
748
727
|
center_lat: 61
|
|
749
728
|
rot: -20
|
|
750
|
-
topography_source:
|
|
729
|
+
topography_source:
|
|
730
|
+
name: ETOPO5
|
|
751
731
|
hmin: 5.0
|
|
752
732
|
"""
|
|
753
733
|
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import pytest
|
|
1
2
|
from roms_tools import Grid
|
|
2
3
|
from roms_tools.setup.topography import _compute_rfactor
|
|
4
|
+
from roms_tools.setup.download import download_test_data
|
|
3
5
|
import numpy as np
|
|
4
6
|
import numpy.testing as npt
|
|
5
7
|
from scipy.ndimage import label
|
|
@@ -52,7 +54,13 @@ def test_hmin_criterion():
|
|
|
52
54
|
assert grid.hmin == 5.0
|
|
53
55
|
assert np.less_equal(grid.hmin, grid.ds.h.min())
|
|
54
56
|
|
|
55
|
-
grid.
|
|
57
|
+
grid.update_topography(hmin=10.0)
|
|
58
|
+
|
|
59
|
+
assert grid.hmin == 10.0
|
|
60
|
+
assert np.less_equal(grid.hmin, grid.ds.h.min())
|
|
61
|
+
|
|
62
|
+
# this should not do anything
|
|
63
|
+
grid.update_topography()
|
|
56
64
|
|
|
57
65
|
assert grid.hmin == 10.0
|
|
58
66
|
assert np.less_equal(grid.hmin, grid.ds.h.min())
|
|
@@ -94,3 +102,100 @@ def test_mask_topography_boundary():
|
|
|
94
102
|
np.testing.assert_array_equal(
|
|
95
103
|
grid.ds.mask_rho.isel(xi_rho=-1).data, grid.ds.mask_rho.isel(xi_rho=-2).data
|
|
96
104
|
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@pytest.fixture()
|
|
108
|
+
def grid_that_straddles_dateline_with_shifted_global_etopo_data():
|
|
109
|
+
|
|
110
|
+
grid = Grid(
|
|
111
|
+
nx=5,
|
|
112
|
+
ny=5,
|
|
113
|
+
size_x=1000,
|
|
114
|
+
size_y=1000,
|
|
115
|
+
center_lon=0,
|
|
116
|
+
center_lat=0,
|
|
117
|
+
rot=20,
|
|
118
|
+
topography_source={
|
|
119
|
+
"name": "ETOPO5",
|
|
120
|
+
"path": download_test_data("etopo5_coarsened_and_shifted.nc"),
|
|
121
|
+
},
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return grid
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
@pytest.fixture()
|
|
128
|
+
def grid_that_straddles_dateline_with_global_srtm15_data():
|
|
129
|
+
|
|
130
|
+
grid = Grid(
|
|
131
|
+
nx=5,
|
|
132
|
+
ny=5,
|
|
133
|
+
size_x=1000,
|
|
134
|
+
size_y=1000,
|
|
135
|
+
center_lon=0,
|
|
136
|
+
center_lat=0,
|
|
137
|
+
rot=20,
|
|
138
|
+
topography_source={
|
|
139
|
+
"name": "SRTM15",
|
|
140
|
+
"path": download_test_data("srtm15_coarsened.nc"),
|
|
141
|
+
},
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
return grid
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
@pytest.fixture()
|
|
148
|
+
def grid_that_straddles_180_degree_meridian_with_shifted_global_etopo_data():
|
|
149
|
+
|
|
150
|
+
grid = Grid(
|
|
151
|
+
nx=5,
|
|
152
|
+
ny=5,
|
|
153
|
+
size_x=1000,
|
|
154
|
+
size_y=1000,
|
|
155
|
+
center_lon=180,
|
|
156
|
+
center_lat=0,
|
|
157
|
+
rot=20,
|
|
158
|
+
topography_source={
|
|
159
|
+
"name": "ETOPO5",
|
|
160
|
+
"path": download_test_data("etopo5_coarsened_and_shifted.nc"),
|
|
161
|
+
},
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
return grid
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
@pytest.fixture()
|
|
168
|
+
def grid_that_straddles_180_degree_meridian_with_global_srtm15_data():
|
|
169
|
+
|
|
170
|
+
grid = Grid(
|
|
171
|
+
nx=5,
|
|
172
|
+
ny=5,
|
|
173
|
+
size_x=1000,
|
|
174
|
+
size_y=1000,
|
|
175
|
+
center_lon=180,
|
|
176
|
+
center_lat=0,
|
|
177
|
+
rot=20,
|
|
178
|
+
topography_source={
|
|
179
|
+
"name": "SRTM15",
|
|
180
|
+
"path": download_test_data("srtm15_coarsened.nc"),
|
|
181
|
+
},
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
return grid
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
@pytest.mark.parametrize(
|
|
188
|
+
"grid_fixture",
|
|
189
|
+
[
|
|
190
|
+
"grid_that_straddles_dateline",
|
|
191
|
+
"grid_that_straddles_180_degree_meridian",
|
|
192
|
+
"grid_that_straddles_dateline_with_shifted_global_etopo_data",
|
|
193
|
+
"grid_that_straddles_180_degree_meridian_with_shifted_global_etopo_data",
|
|
194
|
+
"grid_that_straddles_dateline_with_global_srtm15_data",
|
|
195
|
+
"grid_that_straddles_180_degree_meridian_with_global_srtm15_data",
|
|
196
|
+
],
|
|
197
|
+
)
|
|
198
|
+
def test_successful_initialization(grid_fixture, request):
|
|
199
|
+
|
|
200
|
+
grid = request.getfixturevalue(grid_fixture)
|
|
201
|
+
assert grid is not None
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2024 [C-Worthy
|
|
189
|
+
Copyright 2024 [C]-Worthy LLC.
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: roms-tools
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Tools for running and analysing UCLA-ROMS simulations
|
|
5
5
|
Author-email: Nora Loose <nora.loose@gmail.com>, Thomas Nicholas <tom@cworthy.org>
|
|
6
6
|
License: Apache-2
|
|
@@ -31,6 +31,7 @@ Requires-Dist: netcdf4
|
|
|
31
31
|
Requires-Dist: PyYAML
|
|
32
32
|
Requires-Dist: pyamg
|
|
33
33
|
Requires-Dist: bottleneck
|
|
34
|
+
Requires-Dist: regionmask
|
|
34
35
|
Provides-Extra: dask
|
|
35
36
|
Requires-Dist: dask[diagnostics]; extra == "dask"
|
|
36
37
|
|