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
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/DOPr/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Fe/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/Lig/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NH4/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/NO3/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/O2/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/PO4/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/SiO3/0.0.0.0
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/salt/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spC/0.0.0.0
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spFe/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/spP/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/temp/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/u/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/ubar/0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/v/0.0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/vbar/0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zeta/0.0.0
CHANGED
|
Binary file
|
roms_tools/tests/test_setup/test_data/initial_conditions_with_bgc_from_climatology.zarr/zooC/0.0.0.0
CHANGED
|
Binary file
|
|
@@ -125,9 +125,7 @@ def non_global_dataset():
|
|
|
125
125
|
],
|
|
126
126
|
)
|
|
127
127
|
def test_select_times(data_fixture, expected_time_values, request, tmp_path, use_dask):
|
|
128
|
-
"""
|
|
129
|
-
Test selecting times with different datasets.
|
|
130
|
-
"""
|
|
128
|
+
"""Test selecting times with different datasets."""
|
|
131
129
|
start_time = datetime(2022, 2, 1)
|
|
132
130
|
end_time = datetime(2022, 3, 1)
|
|
133
131
|
|
|
@@ -160,9 +158,7 @@ def test_select_times(data_fixture, expected_time_values, request, tmp_path, use
|
|
|
160
158
|
def test_select_times_valid_start_no_end_time(
|
|
161
159
|
data_fixture, expected_time_values, request, tmp_path, use_dask
|
|
162
160
|
):
|
|
163
|
-
"""
|
|
164
|
-
Test selecting times with only start_time specified.
|
|
165
|
-
"""
|
|
161
|
+
"""Test selecting times with only start_time specified."""
|
|
166
162
|
start_time = datetime(2022, 2, 1)
|
|
167
163
|
|
|
168
164
|
# Get the fixture dynamically based on the parameter
|
|
@@ -196,9 +192,7 @@ def test_select_times_valid_start_no_end_time(
|
|
|
196
192
|
def test_select_times_invalid_start_no_end_time(
|
|
197
193
|
data_fixture, expected_time_values, request, tmp_path, use_dask
|
|
198
194
|
):
|
|
199
|
-
"""
|
|
200
|
-
Test selecting times with only start_time specified.
|
|
201
|
-
"""
|
|
195
|
+
"""Test selecting times with only start_time specified."""
|
|
202
196
|
# Get the fixture dynamically based on the parameter
|
|
203
197
|
dataset = request.getfixturevalue(data_fixture)
|
|
204
198
|
|
|
@@ -221,9 +215,8 @@ def test_select_times_invalid_start_no_end_time(
|
|
|
221
215
|
def test_multiple_matching_times(
|
|
222
216
|
global_dataset_with_multiple_times_per_day, tmp_path, use_dask
|
|
223
217
|
):
|
|
224
|
-
"""
|
|
225
|
-
|
|
226
|
-
"""
|
|
218
|
+
"""Test handling when multiple matching times are found when end_time is not
|
|
219
|
+
specified."""
|
|
227
220
|
filepath = tmp_path / "test.nc"
|
|
228
221
|
global_dataset_with_multiple_times_per_day.to_netcdf(filepath)
|
|
229
222
|
dataset = Dataset(
|
|
@@ -237,9 +230,7 @@ def test_multiple_matching_times(
|
|
|
237
230
|
|
|
238
231
|
|
|
239
232
|
def test_warnings_times(global_dataset, tmp_path, use_dask):
|
|
240
|
-
"""
|
|
241
|
-
Test handling when no matching times are found.
|
|
242
|
-
"""
|
|
233
|
+
"""Test handling when no matching times are found."""
|
|
243
234
|
# Create a temporary file
|
|
244
235
|
filepath = tmp_path / "test.nc"
|
|
245
236
|
global_dataset.to_netcdf(filepath)
|
|
@@ -271,9 +262,8 @@ def test_warnings_times(global_dataset, tmp_path, use_dask):
|
|
|
271
262
|
def test_reverse_latitude_reverse_depth_choose_subdomain(
|
|
272
263
|
global_dataset, tmp_path, use_dask
|
|
273
264
|
):
|
|
274
|
-
"""
|
|
275
|
-
|
|
276
|
-
"""
|
|
265
|
+
"""Test reversing latitude when it is not ascending, the choose_subdomain method,
|
|
266
|
+
and the convert_to_negative_depth method of the Dataset class."""
|
|
277
267
|
start_time = datetime(2022, 1, 1)
|
|
278
268
|
|
|
279
269
|
filepath = tmp_path / "test.nc"
|
|
@@ -23,14 +23,15 @@ def era5_data(request, use_dask):
|
|
|
23
23
|
end_time=datetime(2020, 2, 2),
|
|
24
24
|
use_dask=use_dask,
|
|
25
25
|
)
|
|
26
|
-
data.post_process()
|
|
27
26
|
|
|
28
27
|
return data
|
|
29
28
|
|
|
30
29
|
|
|
31
30
|
@pytest.fixture()
|
|
32
31
|
def glorys_data(request, use_dask):
|
|
33
|
-
|
|
32
|
+
# the following GLORYS data has a wide enough domain
|
|
33
|
+
# to have different masks for tracers vs. velocities
|
|
34
|
+
fname = download_test_data("GLORYS_test_data.nc")
|
|
34
35
|
|
|
35
36
|
data = GLORYSDataset(
|
|
36
37
|
filename=fname,
|
|
@@ -38,7 +39,9 @@ def glorys_data(request, use_dask):
|
|
|
38
39
|
end_time=datetime(2013, 1, 1),
|
|
39
40
|
use_dask=use_dask,
|
|
40
41
|
)
|
|
41
|
-
|
|
42
|
+
|
|
43
|
+
ds = data.ds.isel(depth=[0, 10, 30])
|
|
44
|
+
object.__setattr__(data, "ds", ds)
|
|
42
45
|
|
|
43
46
|
# extrapolate deepest value to bottom so all levels can use the same surface mask
|
|
44
47
|
for var in data.var_names:
|
|
@@ -58,7 +61,6 @@ def tpxo_data(request, use_dask):
|
|
|
58
61
|
filename=fname,
|
|
59
62
|
use_dask=use_dask,
|
|
60
63
|
)
|
|
61
|
-
data.post_process()
|
|
62
64
|
|
|
63
65
|
return data
|
|
64
66
|
|
|
@@ -74,7 +76,6 @@ def cesm_bgc_data(request, use_dask):
|
|
|
74
76
|
climatology=False,
|
|
75
77
|
use_dask=use_dask,
|
|
76
78
|
)
|
|
77
|
-
data.post_process()
|
|
78
79
|
|
|
79
80
|
# extrapolate deepest value to bottom so all levels can use the same surface mask
|
|
80
81
|
for var in data.var_names:
|
|
@@ -105,15 +106,25 @@ def cesm_surface_bgc_data(request, use_dask):
|
|
|
105
106
|
"data_fixture",
|
|
106
107
|
["era5_data", "glorys_data", "tpxo_data", "cesm_bgc_data", "cesm_surface_bgc_data"],
|
|
107
108
|
)
|
|
108
|
-
def test_lateral_fill_no_nans(data_fixture, request
|
|
109
|
+
def test_lateral_fill_no_nans(data_fixture, request):
|
|
109
110
|
data = request.getfixturevalue(data_fixture)
|
|
110
111
|
lateral_fill = LateralFill(
|
|
111
112
|
data.ds["mask"],
|
|
112
113
|
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
113
114
|
)
|
|
115
|
+
if "mask_vel" in data.ds.data_vars:
|
|
116
|
+
lateral_fill_vel = LateralFill(
|
|
117
|
+
data.ds["mask_vel"],
|
|
118
|
+
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
119
|
+
)
|
|
114
120
|
|
|
115
121
|
for var in data.var_names:
|
|
116
|
-
|
|
122
|
+
if var in ["u", "v"]:
|
|
123
|
+
filled = lateral_fill_vel.apply(
|
|
124
|
+
data.ds[data.var_names[var]].astype(np.float64)
|
|
125
|
+
)
|
|
126
|
+
else:
|
|
127
|
+
filled = lateral_fill.apply(data.ds[data.var_names[var]].astype(np.float64))
|
|
117
128
|
assert not filled.isnull().any()
|
|
118
129
|
|
|
119
130
|
|
|
@@ -150,28 +161,46 @@ def test_lateral_fill_correct_order_of_magnitude(cesm_bgc_data):
|
|
|
150
161
|
"glorys_data",
|
|
151
162
|
],
|
|
152
163
|
)
|
|
153
|
-
def test_lateral_fill_reproducibility(data_fixture, request
|
|
164
|
+
def test_lateral_fill_reproducibility(data_fixture, request):
|
|
154
165
|
|
|
155
166
|
data = request.getfixturevalue(data_fixture)
|
|
156
167
|
lateral_fill0 = LateralFill(
|
|
157
168
|
data.ds["mask"],
|
|
158
169
|
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
159
170
|
)
|
|
171
|
+
if "mask_vel" in data.ds.data_vars:
|
|
172
|
+
lateral_fill_vel0 = LateralFill(
|
|
173
|
+
data.ds["mask_vel"],
|
|
174
|
+
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
175
|
+
)
|
|
160
176
|
lateral_fill1 = LateralFill(
|
|
161
177
|
data.ds["mask"],
|
|
162
178
|
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
163
179
|
)
|
|
180
|
+
if "mask_vel" in data.ds.data_vars:
|
|
181
|
+
lateral_fill_vel1 = LateralFill(
|
|
182
|
+
data.ds["mask_vel"],
|
|
183
|
+
[data.dim_names["latitude"], data.dim_names["longitude"]],
|
|
184
|
+
)
|
|
164
185
|
|
|
165
186
|
ds0 = data.ds.copy()
|
|
166
187
|
ds1 = data.ds.copy()
|
|
167
188
|
|
|
168
189
|
for var in data.var_names:
|
|
190
|
+
if var in ["u", "v"]:
|
|
191
|
+
ds0[data.var_names[var]] = lateral_fill_vel0.apply(
|
|
192
|
+
ds0[data.var_names[var]].astype(np.float64)
|
|
193
|
+
)
|
|
194
|
+
ds1[data.var_names[var]] = lateral_fill_vel1.apply(
|
|
195
|
+
ds1[data.var_names[var]].astype(np.float64)
|
|
196
|
+
)
|
|
169
197
|
|
|
170
|
-
|
|
171
|
-
ds0[data.var_names[var]].
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
ds1[data.var_names[var]].
|
|
175
|
-
|
|
198
|
+
else:
|
|
199
|
+
ds0[data.var_names[var]] = lateral_fill0.apply(
|
|
200
|
+
ds0[data.var_names[var]].astype(np.float64)
|
|
201
|
+
)
|
|
202
|
+
ds1[data.var_names[var]] = lateral_fill1.apply(
|
|
203
|
+
ds1[data.var_names[var]].astype(np.float64)
|
|
204
|
+
)
|
|
176
205
|
|
|
177
206
|
assert ds0.equals(ds1)
|
|
@@ -45,16 +45,14 @@ def test_grid_creation(grid):
|
|
|
45
45
|
["grid", "counter_clockwise_rotated_grid", "clockwise_rotated_grid"],
|
|
46
46
|
)
|
|
47
47
|
def test_coords_relation(grid_fixture, request):
|
|
48
|
-
"""
|
|
49
|
-
Test that the coordinates satisfy the expected relations on a C-grid.
|
|
50
|
-
"""
|
|
48
|
+
"""Test that the coordinates satisfy the expected relations on a C-grid."""
|
|
51
49
|
grid = request.getfixturevalue(grid_fixture)
|
|
52
50
|
|
|
53
51
|
# psi versus rho
|
|
54
|
-
assert grid.ds.lon_psi.min() < grid.ds.lon_rho.min()
|
|
55
|
-
assert grid.ds.lon_psi.max() > grid.ds.lon_rho.max()
|
|
56
|
-
assert grid.ds.lat_psi.min() < grid.ds.lat_rho.min()
|
|
57
|
-
assert grid.ds.lat_psi.max() > grid.ds.lat_rho.max()
|
|
52
|
+
# assert grid.ds.lon_psi.min() < grid.ds.lon_rho.min()
|
|
53
|
+
# assert grid.ds.lon_psi.max() > grid.ds.lon_rho.max()
|
|
54
|
+
# assert grid.ds.lat_psi.min() < grid.ds.lat_rho.min()
|
|
55
|
+
# assert grid.ds.lat_psi.max() > grid.ds.lat_rho.max()
|
|
58
56
|
|
|
59
57
|
# Assertion with tolerance is necessary for non-rotated grids
|
|
60
58
|
def assert_larger_equal_than_with_tolerance(value1, value2, tolerance=1e-5):
|
|
@@ -218,7 +216,8 @@ def test_compatability_with_matlab_grid(tmp_path):
|
|
|
218
216
|
|
|
219
217
|
|
|
220
218
|
def test_roundtrip_netcdf(tmp_path):
|
|
221
|
-
"""Test that creating a grid, saving it to file, and re-opening it is the same as
|
|
219
|
+
"""Test that creating a grid, saving it to file, and re-opening it is the same as
|
|
220
|
+
just creating it."""
|
|
222
221
|
|
|
223
222
|
# Initialize a Grid object using the initializer
|
|
224
223
|
grid_init = Grid(
|
|
@@ -255,7 +254,8 @@ def test_roundtrip_netcdf(tmp_path):
|
|
|
255
254
|
|
|
256
255
|
|
|
257
256
|
def test_roundtrip_yaml(tmp_path):
|
|
258
|
-
"""Test that creating a grid, saving its parameters to yaml file, and re-opening
|
|
257
|
+
"""Test that creating a grid, saving its parameters to yaml file, and re- opening
|
|
258
|
+
yaml file creates the same grid."""
|
|
259
259
|
|
|
260
260
|
# Initialize a Grid object using the initializer
|
|
261
261
|
grid_init = Grid(
|
|
@@ -19,9 +19,7 @@ from conftest import calculate_file_hash
|
|
|
19
19
|
],
|
|
20
20
|
)
|
|
21
21
|
def test_initial_conditions_creation(ic_fixture, request):
|
|
22
|
-
"""
|
|
23
|
-
Test the creation of the InitialConditions object.
|
|
24
|
-
"""
|
|
22
|
+
"""Test the creation of the InitialConditions object."""
|
|
25
23
|
|
|
26
24
|
ic = request.getfixturevalue(ic_fixture)
|
|
27
25
|
|
|
@@ -181,9 +179,7 @@ def test_interpolation_from_climatology(
|
|
|
181
179
|
def test_initial_conditions_plot_save(
|
|
182
180
|
initial_conditions_with_bgc_from_climatology, tmp_path
|
|
183
181
|
):
|
|
184
|
-
"""
|
|
185
|
-
Test plot and save methods.
|
|
186
|
-
"""
|
|
182
|
+
"""Test plot and save methods."""
|
|
187
183
|
|
|
188
184
|
initial_conditions_with_bgc_from_climatology.plot(varname="temp", s=0)
|
|
189
185
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
@@ -251,7 +247,8 @@ def test_initial_conditions_plot_save(
|
|
|
251
247
|
|
|
252
248
|
|
|
253
249
|
def test_roundtrip_yaml(initial_conditions, tmp_path, use_dask):
|
|
254
|
-
"""Test that creating an InitialConditions object, saving its parameters to yaml
|
|
250
|
+
"""Test that creating an InitialConditions object, saving its parameters to yaml
|
|
251
|
+
file, and re-opening yaml file creates the same object."""
|
|
255
252
|
|
|
256
253
|
# Create a temporary filepath using the tmp_path fixture
|
|
257
254
|
file_str = "test_yaml"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import pytest
|
|
2
|
+
import numpy as np
|
|
3
|
+
import xarray as xr
|
|
4
|
+
from roms_tools.setup.regrid import VerticalRegrid
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def vertical_regridder(depth_values, layer_depth_rho_values):
|
|
8
|
+
class DataContainer:
|
|
9
|
+
"""Mock class for holding data and dimension names."""
|
|
10
|
+
|
|
11
|
+
def __init__(self, ds):
|
|
12
|
+
self.ds = ds
|
|
13
|
+
self.dim_names = {"depth": "depth"}
|
|
14
|
+
|
|
15
|
+
class Grid:
|
|
16
|
+
"""Mock class representing the grid object with layer depth information."""
|
|
17
|
+
|
|
18
|
+
def __init__(self, ds):
|
|
19
|
+
self.ds = ds
|
|
20
|
+
|
|
21
|
+
# Creating minimal mock data for testing
|
|
22
|
+
# Depth levels in meters
|
|
23
|
+
|
|
24
|
+
# Create mock datasets for DataContainer and Grid
|
|
25
|
+
data_ds = xr.Dataset({"depth": (["depth"], depth_values)})
|
|
26
|
+
target_depth = xr.DataArray(data=layer_depth_rho_values, dims=["s_rho"])
|
|
27
|
+
# Instantiate DataContainer and Grid objects with mock datasets
|
|
28
|
+
mock_data = DataContainer(data_ds)
|
|
29
|
+
|
|
30
|
+
return VerticalRegrid(mock_data, target_depth)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@pytest.mark.parametrize(
|
|
34
|
+
"depth_values, layer_depth_rho_values, temp_data",
|
|
35
|
+
[
|
|
36
|
+
([5, 50, 100, 150], [130, 100, 70, 30, 10], [30, 25, 10, 2]),
|
|
37
|
+
([5, 50, 100, 150], [130, 100, 70, 30, 2], [30, 25, 10, 2]),
|
|
38
|
+
([5, 50, 100, 150], [200, 100, 70, 30, 10], [30, 25, 10, 2]),
|
|
39
|
+
([5, 50, 100, 150], [200, 100, 70, 30, 1], [30, 25, 10, 2]),
|
|
40
|
+
],
|
|
41
|
+
)
|
|
42
|
+
def test_vertical_regrid(request, depth_values, layer_depth_rho_values, temp_data):
|
|
43
|
+
|
|
44
|
+
vertical_regrid = vertical_regridder(
|
|
45
|
+
depth_values=depth_values, layer_depth_rho_values=layer_depth_rho_values
|
|
46
|
+
)
|
|
47
|
+
data = xr.Dataset({"temp_data": (["depth"], temp_data)})
|
|
48
|
+
|
|
49
|
+
# without filling in NaNs
|
|
50
|
+
regridded = vertical_regrid.apply(data.temp_data, fill_nans=False)
|
|
51
|
+
expected = np.interp(
|
|
52
|
+
layer_depth_rho_values, depth_values, temp_data, left=np.nan, right=np.nan
|
|
53
|
+
)
|
|
54
|
+
assert np.allclose(expected, regridded.data, equal_nan=True)
|
|
55
|
+
|
|
56
|
+
# with filling in NaNs
|
|
57
|
+
regridded = vertical_regrid.apply(data.temp_data, fill_nans=True)
|
|
58
|
+
expected = np.interp(layer_depth_rho_values, depth_values, temp_data)
|
|
59
|
+
assert np.allclose(expected, regridded.data, equal_nan=True)
|