roms-tools 1.4.1__py3-none-any.whl → 1.5.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 +350 -166
- roms_tools/setup/datasets.py +57 -74
- roms_tools/setup/download.py +3 -6
- roms_tools/setup/fill.py +46 -18
- roms_tools/setup/grid.py +74 -113
- roms_tools/setup/initial_conditions.py +209 -76
- roms_tools/setup/regrid.py +198 -0
- roms_tools/setup/surface_forcing.py +167 -80
- roms_tools/setup/tides.py +135 -67
- roms_tools/setup/topography.py +9 -17
- roms_tools/setup/utils.py +251 -77
- roms_tools/setup/vertical_coordinate.py +4 -6
- roms_tools/tests/test_setup/test_boundary_forcing.py +6 -13
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/pco2_air_alt/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air_alt/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/salt_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/temp_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/u_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_north/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/ubar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_east/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_north/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_south/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/v_west/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_north/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/vbar_west/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_east/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/.zattrs +2 -2
- roms_tools/tests/test_setup/test_data/grid.zarr/.zmetadata +2 -62
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zattrs +2 -2
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/.zmetadata +2 -62
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ALK_ALT_CO2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DIC_ALT_CO2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOCr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DON/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DONr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diatSi/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/diazP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spCaCO3/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spChl/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zeta/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/0.0.0.0 +0 -0
- roms_tools/tests/test_setup/test_datasets.py +8 -18
- roms_tools/tests/test_setup/test_fill.py +43 -14
- roms_tools/tests/test_setup/test_grid.py +9 -9
- roms_tools/tests/test_setup/test_initial_conditions.py +4 -7
- roms_tools/tests/test_setup/test_regrid.py +59 -0
- roms_tools/tests/test_setup/test_surface_forcing.py +74 -56
- roms_tools/tests/test_setup/test_tides.py +6 -10
- roms_tools/tests/test_setup/test_topography.py +2 -4
- roms_tools/tests/test_setup/test_vertical_coordinate.py +2 -6
- roms_tools/tests/test_utils.py +30 -30
- roms_tools/utils.py +6 -7
- {roms_tools-1.4.1.dist-info → roms_tools-1.5.0.dist-info}/METADATA +2 -2
- {roms_tools-1.4.1.dist-info → roms_tools-1.5.0.dist-info}/RECORD +239 -250
- roms_tools/setup/mixins.py +0 -231
- roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/.zarray +0 -22
- roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/.zattrs +0 -8
- roms_tools/tests/test_setup/test_data/grid.zarr/lat_psi/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/.zarray +0 -22
- roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/.zattrs +0 -8
- roms_tools/tests/test_setup/test_data/grid.zarr/lon_psi/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/.zarray +0 -22
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/.zattrs +0 -8
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lat_psi/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/.zarray +0 -22
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/.zattrs +0 -8
- roms_tools/tests/test_setup/test_data/grid_that_straddles_dateline.zarr/lon_psi/0.0 +0 -0
- {roms_tools-1.4.1.dist-info → roms_tools-1.5.0.dist-info}/LICENSE +0 -0
- {roms_tools-1.4.1.dist-info → roms_tools-1.5.0.dist-info}/WHEEL +0 -0
- {roms_tools-1.4.1.dist-info → roms_tools-1.5.0.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
from datetime import datetime
|
|
3
|
+
import xarray as xr
|
|
3
4
|
from roms_tools import Grid, SurfaceForcing
|
|
4
5
|
from roms_tools.setup.download import download_test_data
|
|
5
6
|
import textwrap
|
|
@@ -9,9 +10,8 @@ from conftest import calculate_file_hash
|
|
|
9
10
|
|
|
10
11
|
@pytest.fixture
|
|
11
12
|
def grid_that_straddles_dateline():
|
|
12
|
-
"""
|
|
13
|
-
|
|
14
|
-
"""
|
|
13
|
+
"""Fixture for creating a domain that straddles the dateline and lies within the
|
|
14
|
+
bounds of the regional ERA5 data."""
|
|
15
15
|
grid = Grid(
|
|
16
16
|
nx=20,
|
|
17
17
|
ny=20,
|
|
@@ -27,8 +27,9 @@ def grid_that_straddles_dateline():
|
|
|
27
27
|
|
|
28
28
|
@pytest.fixture
|
|
29
29
|
def grid_that_straddles_dateline_but_is_too_big_for_regional_test_data():
|
|
30
|
-
"""
|
|
31
|
-
|
|
30
|
+
"""Fixture for creating a domain that straddles the dateline but exceeds the bounds
|
|
31
|
+
of the regional ERA5 data.
|
|
32
|
+
|
|
32
33
|
Centered east of dateline.
|
|
33
34
|
"""
|
|
34
35
|
grid = Grid(
|
|
@@ -46,9 +47,11 @@ def grid_that_straddles_dateline_but_is_too_big_for_regional_test_data():
|
|
|
46
47
|
|
|
47
48
|
@pytest.fixture
|
|
48
49
|
def another_grid_that_straddles_dateline_but_is_too_big_for_regional_test_data():
|
|
49
|
-
"""
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
"""Fixture for creating a domain that straddles the dateline but exceeds the bounds
|
|
51
|
+
of the regional ERA5 data.
|
|
52
|
+
|
|
53
|
+
Centered west of dateline. This one was hard to catch for the nan_check for a long
|
|
54
|
+
time, but should work now.
|
|
52
55
|
"""
|
|
53
56
|
grid = Grid(
|
|
54
57
|
nx=5,
|
|
@@ -65,9 +68,11 @@ def another_grid_that_straddles_dateline_but_is_too_big_for_regional_test_data()
|
|
|
65
68
|
|
|
66
69
|
@pytest.fixture
|
|
67
70
|
def grid_that_lies_east_of_dateline_less_than_five_degrees_away():
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
"""Fixture for creating a domain that lies east of Greenwich meridian, but less than
|
|
72
|
+
5 degrees away.
|
|
73
|
+
|
|
74
|
+
We care about the 5 degree mark because it decides whether the code handles the
|
|
75
|
+
longitudes as straddling the dateline or not.
|
|
71
76
|
"""
|
|
72
77
|
|
|
73
78
|
grid = Grid(
|
|
@@ -85,9 +90,11 @@ def grid_that_lies_east_of_dateline_less_than_five_degrees_away():
|
|
|
85
90
|
|
|
86
91
|
@pytest.fixture
|
|
87
92
|
def grid_that_lies_east_of_dateline_more_than_five_degrees_away():
|
|
88
|
-
"""
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
"""Fixture for creating a domain that lies east of Greenwich meridian, more than 5
|
|
94
|
+
degrees away.
|
|
95
|
+
|
|
96
|
+
We care about the 5 degree mark because it decides whether the code handles the
|
|
97
|
+
longitudes as straddling the dateline or not.
|
|
91
98
|
"""
|
|
92
99
|
grid = Grid(
|
|
93
100
|
nx=5,
|
|
@@ -104,9 +111,11 @@ def grid_that_lies_east_of_dateline_more_than_five_degrees_away():
|
|
|
104
111
|
|
|
105
112
|
@pytest.fixture
|
|
106
113
|
def grid_that_lies_west_of_dateline_less_than_five_degrees_away():
|
|
107
|
-
"""
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
"""Fixture for creating a domain that lies west of Greenwich meridian, less than 5
|
|
115
|
+
degrees away.
|
|
116
|
+
|
|
117
|
+
We care about the 5 degree mark because it decides whether the code handles the
|
|
118
|
+
longitudes as straddling the dateline or not.
|
|
110
119
|
"""
|
|
111
120
|
|
|
112
121
|
grid = Grid(
|
|
@@ -124,9 +133,11 @@ def grid_that_lies_west_of_dateline_less_than_five_degrees_away():
|
|
|
124
133
|
|
|
125
134
|
@pytest.fixture
|
|
126
135
|
def grid_that_lies_west_of_dateline_more_than_five_degrees_away():
|
|
127
|
-
"""
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
"""Fixture for creating a domain that lies west of Greenwich meridian, more than 5
|
|
137
|
+
degrees away.
|
|
138
|
+
|
|
139
|
+
We care about the 5 degree mark because it decides whether the code handles the
|
|
140
|
+
longitudes as straddling the dateline or not.
|
|
130
141
|
"""
|
|
131
142
|
|
|
132
143
|
grid = Grid(
|
|
@@ -144,8 +155,10 @@ def grid_that_lies_west_of_dateline_more_than_five_degrees_away():
|
|
|
144
155
|
|
|
145
156
|
@pytest.fixture
|
|
146
157
|
def grid_that_straddles_180_degree_meridian():
|
|
147
|
-
"""
|
|
148
|
-
|
|
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.
|
|
149
162
|
"""
|
|
150
163
|
|
|
151
164
|
grid = Grid(
|
|
@@ -172,8 +185,7 @@ def grid_that_straddles_180_degree_meridian():
|
|
|
172
185
|
],
|
|
173
186
|
)
|
|
174
187
|
def test_successful_initialization_with_regional_data(grid_fixture, request, use_dask):
|
|
175
|
-
"""
|
|
176
|
-
Test the initialization of SurfaceForcing with regional ERA5 data.
|
|
188
|
+
"""Test the initialization of SurfaceForcing with regional ERA5 data.
|
|
177
189
|
|
|
178
190
|
This test checks the following:
|
|
179
191
|
1. SurfaceForcing object initializes successfully with provided regional data.
|
|
@@ -242,8 +254,7 @@ def test_successful_initialization_with_regional_data(grid_fixture, request, use
|
|
|
242
254
|
def test_nan_detection_initialization_with_regional_data(
|
|
243
255
|
grid_fixture, request, use_dask
|
|
244
256
|
):
|
|
245
|
-
"""
|
|
246
|
-
Test handling of NaN values during initialization with regional data.
|
|
257
|
+
"""Test handling of NaN values during initialization with regional data.
|
|
247
258
|
|
|
248
259
|
Ensures ValueError is raised if NaN values are detected in the dataset.
|
|
249
260
|
"""
|
|
@@ -270,10 +281,11 @@ def test_nan_detection_initialization_with_regional_data(
|
|
|
270
281
|
def test_no_longitude_intersection_initialization_with_regional_data(
|
|
271
282
|
grid_that_straddles_180_degree_meridian, use_dask
|
|
272
283
|
):
|
|
273
|
-
"""
|
|
274
|
-
|
|
284
|
+
"""Test initialization of SurfaceForcing with a grid that straddles the 180°
|
|
285
|
+
meridian.
|
|
275
286
|
|
|
276
|
-
Ensures ValueError is raised when the longitude range does not intersect with the
|
|
287
|
+
Ensures ValueError is raised when the longitude range does not intersect with the
|
|
288
|
+
dataset.
|
|
277
289
|
"""
|
|
278
290
|
start_time = datetime(2020, 1, 31)
|
|
279
291
|
end_time = datetime(2020, 2, 2)
|
|
@@ -309,11 +321,11 @@ def test_no_longitude_intersection_initialization_with_regional_data(
|
|
|
309
321
|
],
|
|
310
322
|
)
|
|
311
323
|
def test_successful_initialization_with_global_data(grid_fixture, request, use_dask):
|
|
312
|
-
"""
|
|
313
|
-
Test initialization of SurfaceForcing with global data.
|
|
324
|
+
"""Test initialization of SurfaceForcing with global data.
|
|
314
325
|
|
|
315
326
|
Verifies that the SurfaceForcing object is correctly initialized with global data,
|
|
316
|
-
including the correct handling of the grid and physics data. Checks both coarse and
|
|
327
|
+
including the correct handling of the grid and physics data. Checks both coarse and
|
|
328
|
+
fine grid initialization.
|
|
317
329
|
"""
|
|
318
330
|
start_time = datetime(2020, 1, 31)
|
|
319
331
|
end_time = datetime(2020, 2, 2)
|
|
@@ -357,8 +369,7 @@ def test_successful_initialization_with_global_data(grid_fixture, request, use_d
|
|
|
357
369
|
|
|
358
370
|
|
|
359
371
|
def test_nans_filled_in(grid_that_straddles_dateline, use_dask):
|
|
360
|
-
"""
|
|
361
|
-
Test that the surface forcing fields contain no NaNs.
|
|
372
|
+
"""Test that the surface forcing fields contain no NaNs.
|
|
362
373
|
|
|
363
374
|
The test is performed twice:
|
|
364
375
|
- First with the default fine grid.
|
|
@@ -405,10 +416,8 @@ def test_nans_filled_in(grid_that_straddles_dateline, use_dask):
|
|
|
405
416
|
|
|
406
417
|
|
|
407
418
|
def test_time_attr_climatology(bgc_surface_forcing_from_climatology):
|
|
408
|
-
"""
|
|
409
|
-
|
|
410
|
-
when using climatology data.
|
|
411
|
-
"""
|
|
419
|
+
"""Test that the 'cycle_length' attribute is present in the time coordinate of the
|
|
420
|
+
BGC dataset when using climatology data."""
|
|
412
421
|
for time_coord in ["pco2_time", "iron_time", "dust_time", "nox_time", "nhy_time"]:
|
|
413
422
|
assert hasattr(
|
|
414
423
|
bgc_surface_forcing_from_climatology.ds[time_coord],
|
|
@@ -418,10 +427,8 @@ def test_time_attr_climatology(bgc_surface_forcing_from_climatology):
|
|
|
418
427
|
|
|
419
428
|
|
|
420
429
|
def test_time_attr(bgc_surface_forcing):
|
|
421
|
-
"""
|
|
422
|
-
|
|
423
|
-
when not using climatology data.
|
|
424
|
-
"""
|
|
430
|
+
"""Test that the 'cycle_length' attribute is not present in the time coordinate of
|
|
431
|
+
the BGC dataset when not using climatology data."""
|
|
425
432
|
for time_coord in ["pco2_time", "iron_time", "dust_time", "nox_time", "nhy_time"]:
|
|
426
433
|
assert not hasattr(
|
|
427
434
|
bgc_surface_forcing.ds[time_coord],
|
|
@@ -448,12 +455,11 @@ def test_time_attr(bgc_surface_forcing):
|
|
|
448
455
|
def test_surface_forcing_creation(
|
|
449
456
|
sfc_forcing_fixture, expected_climatology, expected_fname, request
|
|
450
457
|
):
|
|
451
|
-
"""
|
|
452
|
-
Test the creation and initialization of the SurfaceForcing object with BGC.
|
|
458
|
+
"""Test the creation and initialization of the SurfaceForcing object with BGC.
|
|
453
459
|
|
|
454
460
|
Verifies that the SurfaceForcing object is properly created with correct attributes.
|
|
455
|
-
Ensures that expected variables are present in the dataset
|
|
456
|
-
|
|
461
|
+
Ensures that expected variables are present in the dataset and that attributes match
|
|
462
|
+
the given configurations.
|
|
457
463
|
"""
|
|
458
464
|
|
|
459
465
|
sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
|
|
@@ -482,6 +488,23 @@ def test_surface_forcing_creation(
|
|
|
482
488
|
sfc_forcing.plot("pco2_air", time=0)
|
|
483
489
|
|
|
484
490
|
|
|
491
|
+
@pytest.mark.parametrize(
|
|
492
|
+
"sfc_forcing_fixture",
|
|
493
|
+
[
|
|
494
|
+
"bgc_surface_forcing",
|
|
495
|
+
"bgc_surface_forcing_from_climatology",
|
|
496
|
+
],
|
|
497
|
+
)
|
|
498
|
+
def test_surface_forcing_pco2_replication(sfc_forcing_fixture, request):
|
|
499
|
+
"""Test whether pco2_air and pco2_air_alt is the same after processing."""
|
|
500
|
+
|
|
501
|
+
sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
|
|
502
|
+
|
|
503
|
+
xr.testing.assert_allclose(
|
|
504
|
+
sfc_forcing.ds.pco2_air, sfc_forcing.ds.pco2_air_alt, rtol=1.0e-5
|
|
505
|
+
)
|
|
506
|
+
|
|
507
|
+
|
|
485
508
|
@pytest.mark.parametrize(
|
|
486
509
|
"sfc_forcing_fixture",
|
|
487
510
|
[
|
|
@@ -491,9 +514,7 @@ def test_surface_forcing_creation(
|
|
|
491
514
|
],
|
|
492
515
|
)
|
|
493
516
|
def test_surface_forcing_plot_save(sfc_forcing_fixture, request, tmp_path):
|
|
494
|
-
"""
|
|
495
|
-
Test plot and save methods.
|
|
496
|
-
"""
|
|
517
|
+
"""Test plot and save methods."""
|
|
497
518
|
sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
|
|
498
519
|
sfc_forcing.plot(varname="uwnd", time=0)
|
|
499
520
|
|
|
@@ -525,9 +546,7 @@ def test_surface_forcing_plot_save(sfc_forcing_fixture, request, tmp_path):
|
|
|
525
546
|
|
|
526
547
|
|
|
527
548
|
def test_surface_forcing_bgc_plot_save(bgc_surface_forcing, tmp_path):
|
|
528
|
-
"""
|
|
529
|
-
Test plot and save methods.
|
|
530
|
-
"""
|
|
549
|
+
"""Test plot and save methods."""
|
|
531
550
|
|
|
532
551
|
# Check the values in the dataset
|
|
533
552
|
bgc_surface_forcing.plot(varname="pco2_air", time=0)
|
|
@@ -562,9 +581,7 @@ def test_surface_forcing_bgc_plot_save(bgc_surface_forcing, tmp_path):
|
|
|
562
581
|
def test_surface_forcing_bgc_from_clim_plot_save(
|
|
563
582
|
bgc_surface_forcing_from_climatology, tmp_path
|
|
564
583
|
):
|
|
565
|
-
"""
|
|
566
|
-
Test plot and save methods.
|
|
567
|
-
"""
|
|
584
|
+
"""Test plot and save methods."""
|
|
568
585
|
|
|
569
586
|
# Check the values in the dataset
|
|
570
587
|
bgc_surface_forcing_from_climatology.plot(varname="pco2_air", time=0)
|
|
@@ -609,7 +626,8 @@ def test_surface_forcing_bgc_from_clim_plot_save(
|
|
|
609
626
|
],
|
|
610
627
|
)
|
|
611
628
|
def test_roundtrip_yaml(sfc_forcing_fixture, request, tmp_path, use_dask):
|
|
612
|
-
"""Test that creating an SurfaceForcing object, saving its parameters to yaml file,
|
|
629
|
+
"""Test that creating an SurfaceForcing object, saving its parameters to yaml file,
|
|
630
|
+
and re-opening yaml file creates the same object."""
|
|
613
631
|
|
|
614
632
|
sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
|
|
615
633
|
|
|
@@ -25,9 +25,7 @@ def grid_that_is_out_of_bounds_of_regional_tpxo_data():
|
|
|
25
25
|
|
|
26
26
|
@pytest.fixture
|
|
27
27
|
def grid_that_straddles_dateline():
|
|
28
|
-
"""
|
|
29
|
-
Fixture for creating a domain that straddles the dateline.
|
|
30
|
-
"""
|
|
28
|
+
"""Fixture for creating a domain that straddles the dateline."""
|
|
31
29
|
grid = Grid(
|
|
32
30
|
nx=5,
|
|
33
31
|
ny=5,
|
|
@@ -43,9 +41,7 @@ def grid_that_straddles_dateline():
|
|
|
43
41
|
|
|
44
42
|
@pytest.fixture
|
|
45
43
|
def grid_that_straddles_180_degree_meridian():
|
|
46
|
-
"""
|
|
47
|
-
Fixture for creating a domain that straddles 180 degree meridian.
|
|
48
|
-
"""
|
|
44
|
+
"""Fixture for creating a domain that straddles 180 degree meridian."""
|
|
49
45
|
|
|
50
46
|
grid = Grid(
|
|
51
47
|
nx=5,
|
|
@@ -174,9 +170,8 @@ def test_insufficient_number_of_consituents(grid_that_straddles_dateline, use_da
|
|
|
174
170
|
|
|
175
171
|
|
|
176
172
|
def test_tidal_forcing_plot_save(tidal_forcing, tmp_path):
|
|
177
|
-
"""
|
|
178
|
-
|
|
179
|
-
"""
|
|
173
|
+
"""Test plot and save methods in the same test since we dask arrays are already
|
|
174
|
+
computed."""
|
|
180
175
|
tidal_forcing.ds.load()
|
|
181
176
|
|
|
182
177
|
tidal_forcing.plot(varname="ssh_Re", ntides=0)
|
|
@@ -211,7 +206,8 @@ def test_tidal_forcing_plot_save(tidal_forcing, tmp_path):
|
|
|
211
206
|
|
|
212
207
|
|
|
213
208
|
def test_roundtrip_yaml(tidal_forcing, tmp_path, use_dask):
|
|
214
|
-
"""Test that creating a TidalForcing object, saving its parameters to yaml file, and
|
|
209
|
+
"""Test that creating a TidalForcing object, saving its parameters to yaml file, and
|
|
210
|
+
re-opening yaml file creates the same object."""
|
|
215
211
|
|
|
216
212
|
# Create a temporary filepath using the tmp_path fixture
|
|
217
213
|
file_str = "test_yaml"
|
|
@@ -59,10 +59,8 @@ def test_hmin_criterion():
|
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
def test_mask_topography_boundary():
|
|
62
|
-
"""
|
|
63
|
-
|
|
64
|
-
are identical to the adjacent inland cells.
|
|
65
|
-
"""
|
|
62
|
+
"""Test that the mask and topography along the grid boundaries (north, south, east,
|
|
63
|
+
west) are identical to the adjacent inland cells."""
|
|
66
64
|
|
|
67
65
|
# Create a grid with some land along the northern boundary
|
|
68
66
|
grid = Grid(
|
|
@@ -3,9 +3,7 @@ from roms_tools import Grid
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def test_invalid_theta_s_value():
|
|
6
|
-
"""
|
|
7
|
-
Test the validation of the theta_s value.
|
|
8
|
-
"""
|
|
6
|
+
"""Test the validation of the theta_s value."""
|
|
9
7
|
with pytest.raises(ValueError):
|
|
10
8
|
|
|
11
9
|
Grid(
|
|
@@ -24,9 +22,7 @@ def test_invalid_theta_s_value():
|
|
|
24
22
|
|
|
25
23
|
|
|
26
24
|
def test_invalid_theta_b_value():
|
|
27
|
-
"""
|
|
28
|
-
Test the validation of the theta_b value.
|
|
29
|
-
"""
|
|
25
|
+
"""Test the validation of the theta_b value."""
|
|
30
26
|
with pytest.raises(ValueError):
|
|
31
27
|
Grid(
|
|
32
28
|
nx=2,
|
roms_tools/tests/test_utils.py
CHANGED
|
@@ -23,8 +23,8 @@ class TestPartitionGrid:
|
|
|
23
23
|
"xi_rho": 32,
|
|
24
24
|
"xi_u": 31,
|
|
25
25
|
"eta_v": 10,
|
|
26
|
-
"eta_psi": 11,
|
|
27
|
-
"xi_psi": 33,
|
|
26
|
+
# "eta_psi": 11,
|
|
27
|
+
# "xi_psi": 33,
|
|
28
28
|
"eta_coarse": 6,
|
|
29
29
|
"xi_coarse": 17,
|
|
30
30
|
"s_rho": 100,
|
|
@@ -35,8 +35,8 @@ class TestPartitionGrid:
|
|
|
35
35
|
"xi_rho": 32,
|
|
36
36
|
"xi_u": 31,
|
|
37
37
|
"eta_v": 10,
|
|
38
|
-
"eta_psi": 10,
|
|
39
|
-
"xi_psi": 33,
|
|
38
|
+
# "eta_psi": 10,
|
|
39
|
+
# "xi_psi": 33,
|
|
40
40
|
"eta_coarse": 5,
|
|
41
41
|
"xi_coarse": 17,
|
|
42
42
|
"s_rho": 100,
|
|
@@ -47,8 +47,8 @@ class TestPartitionGrid:
|
|
|
47
47
|
"xi_rho": 32,
|
|
48
48
|
"xi_u": 31,
|
|
49
49
|
"eta_v": 11,
|
|
50
|
-
"eta_psi": 12,
|
|
51
|
-
"xi_psi": 33,
|
|
50
|
+
# "eta_psi": 12,
|
|
51
|
+
# "xi_psi": 33,
|
|
52
52
|
"eta_coarse": 6,
|
|
53
53
|
"xi_coarse": 17,
|
|
54
54
|
"s_rho": 100,
|
|
@@ -63,8 +63,8 @@ class TestPartitionGrid:
|
|
|
63
63
|
"xi_rho": 11,
|
|
64
64
|
"xi_u": 10,
|
|
65
65
|
"eta_v": 31,
|
|
66
|
-
"eta_psi": 33,
|
|
67
|
-
"xi_psi": 11,
|
|
66
|
+
# "eta_psi": 33,
|
|
67
|
+
# "xi_psi": 11,
|
|
68
68
|
"eta_coarse": 17,
|
|
69
69
|
"xi_coarse": 6,
|
|
70
70
|
"s_rho": 100,
|
|
@@ -75,8 +75,8 @@ class TestPartitionGrid:
|
|
|
75
75
|
"xi_rho": 10,
|
|
76
76
|
"xi_u": 10,
|
|
77
77
|
"eta_v": 31,
|
|
78
|
-
"eta_psi": 33,
|
|
79
|
-
"xi_psi": 10,
|
|
78
|
+
# "eta_psi": 33,
|
|
79
|
+
# "xi_psi": 10,
|
|
80
80
|
"eta_coarse": 17,
|
|
81
81
|
"xi_coarse": 5,
|
|
82
82
|
"s_rho": 100,
|
|
@@ -87,8 +87,8 @@ class TestPartitionGrid:
|
|
|
87
87
|
"xi_rho": 11,
|
|
88
88
|
"xi_u": 11,
|
|
89
89
|
"eta_v": 31,
|
|
90
|
-
"eta_psi": 33,
|
|
91
|
-
"xi_psi": 12,
|
|
90
|
+
# "eta_psi": 33,
|
|
91
|
+
# "xi_psi": 12,
|
|
92
92
|
"eta_coarse": 17,
|
|
93
93
|
"xi_coarse": 6,
|
|
94
94
|
"s_rho": 100,
|
|
@@ -108,8 +108,8 @@ class TestPartitionGrid:
|
|
|
108
108
|
"xi_rho": 11,
|
|
109
109
|
"xi_u": 10,
|
|
110
110
|
"eta_v": 10,
|
|
111
|
-
"eta_psi": 11,
|
|
112
|
-
"xi_psi": 11,
|
|
111
|
+
# "eta_psi": 11,
|
|
112
|
+
# "xi_psi": 11,
|
|
113
113
|
"eta_coarse": 6,
|
|
114
114
|
"xi_coarse": 6,
|
|
115
115
|
"s_rho": 100,
|
|
@@ -121,8 +121,8 @@ class TestPartitionGrid:
|
|
|
121
121
|
"xi_u": 10,
|
|
122
122
|
"eta_v": 10,
|
|
123
123
|
"eta_coarse": 5,
|
|
124
|
-
"eta_psi": 10,
|
|
125
|
-
"xi_psi": 11,
|
|
124
|
+
# "eta_psi": 10,
|
|
125
|
+
# "xi_psi": 11,
|
|
126
126
|
"xi_coarse": 6,
|
|
127
127
|
"s_rho": 100,
|
|
128
128
|
"s_w": 101,
|
|
@@ -132,8 +132,8 @@ class TestPartitionGrid:
|
|
|
132
132
|
"xi_rho": 11,
|
|
133
133
|
"xi_u": 10,
|
|
134
134
|
"eta_v": 11,
|
|
135
|
-
"eta_psi": 12,
|
|
136
|
-
"xi_psi": 11,
|
|
135
|
+
# "eta_psi": 12,
|
|
136
|
+
# "xi_psi": 11,
|
|
137
137
|
"eta_coarse": 6,
|
|
138
138
|
"xi_coarse": 6,
|
|
139
139
|
"s_rho": 100,
|
|
@@ -144,8 +144,8 @@ class TestPartitionGrid:
|
|
|
144
144
|
"xi_rho": 10,
|
|
145
145
|
"xi_u": 10,
|
|
146
146
|
"eta_v": 10,
|
|
147
|
-
"eta_psi": 11,
|
|
148
|
-
"xi_psi": 10,
|
|
147
|
+
# "eta_psi": 11,
|
|
148
|
+
# "xi_psi": 10,
|
|
149
149
|
"eta_coarse": 6,
|
|
150
150
|
"xi_coarse": 5,
|
|
151
151
|
"s_rho": 100,
|
|
@@ -156,8 +156,8 @@ class TestPartitionGrid:
|
|
|
156
156
|
"xi_rho": 10,
|
|
157
157
|
"xi_u": 10,
|
|
158
158
|
"eta_v": 10,
|
|
159
|
-
"eta_psi": 10,
|
|
160
|
-
"xi_psi": 10,
|
|
159
|
+
# "eta_psi": 10,
|
|
160
|
+
# "xi_psi": 10,
|
|
161
161
|
"eta_coarse": 5,
|
|
162
162
|
"xi_coarse": 5,
|
|
163
163
|
"s_rho": 100,
|
|
@@ -168,8 +168,8 @@ class TestPartitionGrid:
|
|
|
168
168
|
"xi_rho": 10,
|
|
169
169
|
"xi_u": 10,
|
|
170
170
|
"eta_v": 11,
|
|
171
|
-
"eta_psi": 12,
|
|
172
|
-
"xi_psi": 10,
|
|
171
|
+
# "eta_psi": 12,
|
|
172
|
+
# "xi_psi": 10,
|
|
173
173
|
"eta_coarse": 6,
|
|
174
174
|
"xi_coarse": 5,
|
|
175
175
|
"s_rho": 100,
|
|
@@ -180,8 +180,8 @@ class TestPartitionGrid:
|
|
|
180
180
|
"xi_rho": 11,
|
|
181
181
|
"xi_u": 11,
|
|
182
182
|
"eta_v": 10,
|
|
183
|
-
"eta_psi": 11,
|
|
184
|
-
"xi_psi": 12,
|
|
183
|
+
# "eta_psi": 11,
|
|
184
|
+
# "xi_psi": 12,
|
|
185
185
|
"eta_coarse": 6,
|
|
186
186
|
"xi_coarse": 6,
|
|
187
187
|
"s_rho": 100,
|
|
@@ -192,8 +192,8 @@ class TestPartitionGrid:
|
|
|
192
192
|
"xi_rho": 11,
|
|
193
193
|
"xi_u": 11,
|
|
194
194
|
"eta_v": 10,
|
|
195
|
-
"eta_psi": 10,
|
|
196
|
-
"xi_psi": 12,
|
|
195
|
+
# "eta_psi": 10,
|
|
196
|
+
# "xi_psi": 12,
|
|
197
197
|
"eta_coarse": 5,
|
|
198
198
|
"xi_coarse": 6,
|
|
199
199
|
"s_rho": 100,
|
|
@@ -204,8 +204,8 @@ class TestPartitionGrid:
|
|
|
204
204
|
"xi_rho": 11,
|
|
205
205
|
"xi_u": 11,
|
|
206
206
|
"eta_v": 11,
|
|
207
|
-
"eta_psi": 12,
|
|
208
|
-
"xi_psi": 12,
|
|
207
|
+
# "eta_psi": 12,
|
|
208
|
+
# "xi_psi": 12,
|
|
209
209
|
"eta_coarse": 6,
|
|
210
210
|
"xi_coarse": 6,
|
|
211
211
|
"s_rho": 100,
|
roms_tools/utils.py
CHANGED
|
@@ -9,8 +9,8 @@ from pathlib import Path
|
|
|
9
9
|
def partition(
|
|
10
10
|
ds: xr.Dataset, np_eta: int = 1, np_xi: int = 1
|
|
11
11
|
) -> tuple[list[int], list[xr.Dataset]]:
|
|
12
|
-
"""
|
|
13
|
-
|
|
12
|
+
"""Partition a ROMS (Regional Ocean Modeling System) dataset into smaller spatial
|
|
13
|
+
tiles.
|
|
14
14
|
|
|
15
15
|
This function divides the input dataset into `np_eta` by `np_xi` tiles, where each tile
|
|
16
16
|
represents a subdomain of the original dataset. The partitioning is performed along
|
|
@@ -32,6 +32,7 @@ def partition(
|
|
|
32
32
|
-------
|
|
33
33
|
tuple[list[int], list[xr.Dataset]]
|
|
34
34
|
A tuple containing two elements:
|
|
35
|
+
|
|
35
36
|
- A list of integers representing the file numbers associated with each partition.
|
|
36
37
|
- A list of `xarray.Dataset` objects, each representing a partitioned subdomain of the original dataset.
|
|
37
38
|
|
|
@@ -90,8 +91,7 @@ def partition(
|
|
|
90
91
|
n_xi_ghost_cells = 1
|
|
91
92
|
|
|
92
93
|
def integer_division_or_raise(a: int, b: int, dimension: str) -> int:
|
|
93
|
-
"""
|
|
94
|
-
Perform integer division and ensure that the division is exact.
|
|
94
|
+
"""Perform integer division and ensure that the division is exact.
|
|
95
95
|
|
|
96
96
|
Parameters
|
|
97
97
|
----------
|
|
@@ -214,7 +214,7 @@ def partition(
|
|
|
214
214
|
)
|
|
215
215
|
|
|
216
216
|
def cumsum(pmf):
|
|
217
|
-
"""Implementation of cumsum which ensures the result starts with zero"""
|
|
217
|
+
"""Implementation of cumsum which ensures the result starts with zero."""
|
|
218
218
|
cdf = np.empty(len(pmf) + 1, dtype=int)
|
|
219
219
|
cdf[0] = 0
|
|
220
220
|
np.cumsum(pmf, out=cdf[1:])
|
|
@@ -290,8 +290,7 @@ def partition(
|
|
|
290
290
|
def partition_netcdf(
|
|
291
291
|
filepath: Union[str, Path], np_eta: int = 1, np_xi: int = 1
|
|
292
292
|
) -> None:
|
|
293
|
-
"""
|
|
294
|
-
Partition a ROMS NetCDF file into smaller spatial tiles and save them to disk.
|
|
293
|
+
"""Partition a ROMS NetCDF file into smaller spatial tiles and save them to disk.
|
|
295
294
|
|
|
296
295
|
This function divides the dataset in the specified NetCDF file into `np_eta` by `np_xi` tiles.
|
|
297
296
|
Each tile is saved as a separate NetCDF file.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: roms-tools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.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
|
|
@@ -47,7 +47,7 @@ A suite of python tools for setting up a [ROMS](https://github.com/CESR-lab/ucla
|
|
|
47
47
|
|
|
48
48
|
<mark>**DISCLAIMER**: This project is **ALPHA** and will be **EXPERIMENTAL** at least throughout Fall 2024. We do not recommend to use this software before this ALPHA development and test phase is completed.</mark>
|
|
49
49
|
|
|
50
|
-
## Installation
|
|
50
|
+
## Installation
|
|
51
51
|
|
|
52
52
|
### Installation from pip
|
|
53
53
|
|