roms-tools 2.2.0__py3-none-any.whl → 2.2.1__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/setup/utils.py +11 -1
- roms_tools/tests/test_setup/test_initial_conditions.py +7 -3
- {roms_tools-2.2.0.dist-info → roms_tools-2.2.1.dist-info}/METADATA +1 -1
- {roms_tools-2.2.0.dist-info → roms_tools-2.2.1.dist-info}/RECORD +7 -7
- {roms_tools-2.2.0.dist-info → roms_tools-2.2.1.dist-info}/LICENSE +0 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.2.1.dist-info}/WHEEL +0 -0
- {roms_tools-2.2.0.dist-info → roms_tools-2.2.1.dist-info}/top_level.txt +0 -0
roms_tools/setup/utils.py
CHANGED
|
@@ -1080,8 +1080,18 @@ def _to_yaml(forcing_object, filepath: Union[str, Path]) -> None:
|
|
|
1080
1080
|
grid_yaml_data = {**parent_grid_yaml_data, **child_grid_yaml_data}
|
|
1081
1081
|
|
|
1082
1082
|
# Ensure forcing_object.source.path is a string (convert if it's a pathlib object)
|
|
1083
|
-
if
|
|
1083
|
+
if (
|
|
1084
|
+
hasattr(forcing_object, "source")
|
|
1085
|
+
and forcing_object.source is not None
|
|
1086
|
+
and "path" in forcing_object.source
|
|
1087
|
+
):
|
|
1084
1088
|
forcing_object.source["path"] = str(forcing_object.source["path"])
|
|
1089
|
+
if (
|
|
1090
|
+
hasattr(forcing_object, "bgc_source")
|
|
1091
|
+
and forcing_object.bgc_source is not None
|
|
1092
|
+
and "path" in forcing_object.bgc_source
|
|
1093
|
+
):
|
|
1094
|
+
forcing_object.bgc_source["path"] = str(forcing_object.bgc_source["path"])
|
|
1085
1095
|
|
|
1086
1096
|
# Step 2: Get ROMS Tools version
|
|
1087
1097
|
# Fetch the version of the 'roms-tools' package for inclusion in the YAML header
|
|
@@ -250,7 +250,9 @@ def test_initial_conditions_save(
|
|
|
250
250
|
expected_filepath.unlink()
|
|
251
251
|
|
|
252
252
|
|
|
253
|
-
def test_roundtrip_yaml(
|
|
253
|
+
def test_roundtrip_yaml(
|
|
254
|
+
initial_conditions_with_bgc_from_climatology, tmp_path, use_dask
|
|
255
|
+
):
|
|
254
256
|
"""Test that creating an InitialConditions object, saving its parameters to yaml
|
|
255
257
|
file, and re-opening yaml file creates the same object."""
|
|
256
258
|
|
|
@@ -261,13 +263,15 @@ def test_roundtrip_yaml(initial_conditions, tmp_path, use_dask):
|
|
|
261
263
|
str(tmp_path / file_str),
|
|
262
264
|
]: # test for Path object and str
|
|
263
265
|
|
|
264
|
-
|
|
266
|
+
initial_conditions_with_bgc_from_climatology.to_yaml(filepath)
|
|
265
267
|
|
|
266
268
|
initial_conditions_from_file = InitialConditions.from_yaml(
|
|
267
269
|
filepath, use_dask=use_dask
|
|
268
270
|
)
|
|
269
271
|
|
|
270
|
-
assert
|
|
272
|
+
assert (
|
|
273
|
+
initial_conditions_with_bgc_from_climatology == initial_conditions_from_file
|
|
274
|
+
)
|
|
271
275
|
|
|
272
276
|
filepath = Path(filepath)
|
|
273
277
|
filepath.unlink()
|
|
@@ -16,7 +16,7 @@ roms_tools/setup/river_forcing.py,sha256=Ox61M_SNousC_FLwmBoR865oiTyisbvJb4bcEaJ
|
|
|
16
16
|
roms_tools/setup/surface_forcing.py,sha256=-i2lAxv_vhjO2QQyWPfLg1mIIOx4N0VDmMUrkI1V0qQ,21409
|
|
17
17
|
roms_tools/setup/tides.py,sha256=EgsPsLY70ERB6q2w1DClRQZvSbX-i_Ypume01Ub_EYU,28257
|
|
18
18
|
roms_tools/setup/topography.py,sha256=pKf2EmUc85meKN5aDkN1fY2U3Zn5nn80RDqzaEfpvvw,13475
|
|
19
|
-
roms_tools/setup/utils.py,sha256=
|
|
19
|
+
roms_tools/setup/utils.py,sha256=baNIkZXKJFA1OlPKwf7UOP8J2rXIBDMbXlDhokkyyw0,46807
|
|
20
20
|
roms_tools/setup/vertical_coordinate.py,sha256=yw3L_ONELAZfOHwNvcyQaJ0Vqir05FRzFBd601eTLUM,2689
|
|
21
21
|
roms_tools/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
roms_tools/tests/test_utils.py,sha256=X16UHYzd8KmUgxBHJqmVP6cIHfOtScCdXPw905bgGMk,7966
|
|
@@ -25,7 +25,7 @@ roms_tools/tests/test_setup/test_boundary_forcing.py,sha256=izCr5zRLtCsbWa2jjEvu
|
|
|
25
25
|
roms_tools/tests/test_setup/test_datasets.py,sha256=Pxh95V-x-EaemVm6F_T0TbtrEp4Lh1_OAaOxPwTLrfQ,16441
|
|
26
26
|
roms_tools/tests/test_setup/test_fill.py,sha256=gDHuM58d3ECQE317ZntChYt4hWCfo4eVhkW13NiZ1V4,3735
|
|
27
27
|
roms_tools/tests/test_setup/test_grid.py,sha256=oGRiM2mqKuQavlS0C52ambLURu64Yc7zwaKYQxt5tOk,14663
|
|
28
|
-
roms_tools/tests/test_setup/test_initial_conditions.py,sha256=
|
|
28
|
+
roms_tools/tests/test_setup/test_initial_conditions.py,sha256=8UYTSmQHDNO9omGI7l5xXGyZ8VHOwdVsuyEs-iHyMTg,11309
|
|
29
29
|
roms_tools/tests/test_setup/test_nesting.py,sha256=_LB_10XgGkQ6DmpHp5rgIWTEN6nR14aZY8B_ADX4cRQ,18525
|
|
30
30
|
roms_tools/tests/test_setup/test_regrid.py,sha256=NMzMkPHaFfO_9H0SbIpFL3VHlzhd71gUVLu81QmU-bs,1891
|
|
31
31
|
roms_tools/tests/test_setup/test_river_forcing.py,sha256=K0XoT8sIbqoFGyIkK6oPOPpihAJftXrcsymV2q5tD6o,12010
|
|
@@ -1048,8 +1048,8 @@ roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/0.0.0,sha256=60jWZ
|
|
|
1048
1048
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/.zarray,sha256=2P8kKjSgdw5-3udU-vGJ3bzhNuRn7fZmWN811qBJn34,357
|
|
1049
1049
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/.zattrs,sha256=2z7WUPvCT9VfFs8VCBltFHLWgaGj1jcw3yZ4n0viLRg,197
|
|
1050
1050
|
roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/0.0.0,sha256=33Gl8otBmgqVarmAnZuEqTYS2_hVJUJh-iN1HzvaDuo,96
|
|
1051
|
-
roms_tools-2.2.
|
|
1052
|
-
roms_tools-2.2.
|
|
1053
|
-
roms_tools-2.2.
|
|
1054
|
-
roms_tools-2.2.
|
|
1055
|
-
roms_tools-2.2.
|
|
1051
|
+
roms_tools-2.2.1.dist-info/LICENSE,sha256=yiff76E4xRioW2bHhlPpyYpstmePQBx2bF8HhgQhSsg,11318
|
|
1052
|
+
roms_tools-2.2.1.dist-info/METADATA,sha256=2J9nvZ1qgY7BnN4e8n7-pyw0P4dddCcRwJNul51A8sE,4244
|
|
1053
|
+
roms_tools-2.2.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
1054
|
+
roms_tools-2.2.1.dist-info/top_level.txt,sha256=aAf4T4nYQSkay5iKJ9kmTjlDgd4ETdp9OSlB4sJdt8Y,19
|
|
1055
|
+
roms_tools-2.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|