roms-tools 1.5.0__py3-none-any.whl → 1.6.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/_version.py +1 -1
- roms_tools/setup/boundary_forcing.py +263 -100
- roms_tools/setup/datasets.py +169 -39
- roms_tools/setup/fill.py +0 -36
- roms_tools/setup/grid.py +1 -1
- roms_tools/setup/initial_conditions.py +108 -73
- roms_tools/setup/regrid.py +43 -98
- roms_tools/setup/surface_forcing.py +104 -82
- roms_tools/setup/tides.py +76 -48
- roms_tools/setup/utils.py +25 -53
- roms_tools/tests/test_setup/test_boundary_forcing.py +84 -47
- 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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/dust/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/iron/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/nhy/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/nox/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing.zarr/pco2_air/0.0.0 +0 -0
- 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/dust/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/iron/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nhy/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/nox/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_surface_forcing_from_climatology.zarr/pco2_air/0.0.0 +0 -0
- 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/.zmetadata +7 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/abs_time/.zattrs +3 -0
- 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_south/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_south/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/.zattrs +1 -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_north/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_south/0.0 +0 -0
- roms_tools/tests/test_setup/test_data/boundary_forcing.zarr/zeta_west/.zattrs +1 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/Tair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/lwrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/qair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/rain/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/swrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/uwnd/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/coarse_surface_forcing.zarr/vwnd/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/Tair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/lwrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/qair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/rain/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/swrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/uwnd/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/corrected_surface_forcing.zarr/vwnd/0.0.0 +0 -0
- 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_data/surface_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/.zmetadata +1 -1
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/Tair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/lwrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/qair/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/rain/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/swrad/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/uwnd/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/surface_forcing.zarr/vwnd/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/.zattrs +1 -1
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/.zmetadata +4 -2
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/omega/.zattrs +3 -1
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/pot_Im/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/pot_Re/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/ssh_Im/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/ssh_Re/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Im/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/u_Re/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Im/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_data/tidal_forcing.zarr/v_Re/0.0.0 +0 -0
- roms_tools/tests/test_setup/test_datasets.py +79 -21
- roms_tools/tests/test_setup/test_fill.py +18 -105
- roms_tools/tests/test_setup/test_initial_conditions.py +29 -25
- roms_tools/tests/test_setup/test_regrid.py +2 -8
- roms_tools/tests/test_setup/test_surface_forcing.py +49 -29
- roms_tools/tests/test_setup/test_tides.py +7 -5
- {roms_tools-1.5.0.dist-info → roms_tools-1.6.1.dist-info}/METADATA +13 -3
- {roms_tools-1.5.0.dist-info → roms_tools-1.6.1.dist-info}/RECORD +239 -239
- {roms_tools-1.5.0.dist-info → roms_tools-1.6.1.dist-info}/WHEEL +1 -1
- {roms_tools-1.5.0.dist-info → roms_tools-1.6.1.dist-info}/LICENSE +0 -0
- {roms_tools-1.5.0.dist-info → roms_tools-1.6.1.dist-info}/top_level.txt +0 -0
|
@@ -1,110 +1,18 @@
|
|
|
1
1
|
import pytest
|
|
2
|
-
from roms_tools.setup.datasets import (
|
|
3
|
-
GLORYSDataset,
|
|
4
|
-
ERA5Dataset,
|
|
5
|
-
CESMBGCDataset,
|
|
6
|
-
CESMBGCSurfaceForcingDataset,
|
|
7
|
-
TPXODataset,
|
|
8
|
-
)
|
|
9
|
-
from roms_tools.setup.download import download_test_data
|
|
10
2
|
from roms_tools.setup.fill import LateralFill
|
|
11
|
-
from roms_tools.setup.utils import extrapolate_deepest_to_bottom
|
|
12
|
-
from datetime import datetime
|
|
13
3
|
import numpy as np
|
|
14
4
|
import xarray as xr
|
|
15
5
|
|
|
16
6
|
|
|
17
|
-
@pytest.fixture()
|
|
18
|
-
def era5_data(request, use_dask):
|
|
19
|
-
fname = download_test_data("ERA5_regional_test_data.nc")
|
|
20
|
-
data = ERA5Dataset(
|
|
21
|
-
filename=fname,
|
|
22
|
-
start_time=datetime(2020, 1, 31),
|
|
23
|
-
end_time=datetime(2020, 2, 2),
|
|
24
|
-
use_dask=use_dask,
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
return data
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@pytest.fixture()
|
|
31
|
-
def glorys_data(request, use_dask):
|
|
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")
|
|
35
|
-
|
|
36
|
-
data = GLORYSDataset(
|
|
37
|
-
filename=fname,
|
|
38
|
-
start_time=datetime(2012, 1, 1),
|
|
39
|
-
end_time=datetime(2013, 1, 1),
|
|
40
|
-
use_dask=use_dask,
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
ds = data.ds.isel(depth=[0, 10, 30])
|
|
44
|
-
object.__setattr__(data, "ds", ds)
|
|
45
|
-
|
|
46
|
-
# extrapolate deepest value to bottom so all levels can use the same surface mask
|
|
47
|
-
for var in data.var_names:
|
|
48
|
-
if var != "zeta":
|
|
49
|
-
data.ds[data.var_names[var]] = extrapolate_deepest_to_bottom(
|
|
50
|
-
data.ds[data.var_names[var]], data.dim_names["depth"]
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
return data
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@pytest.fixture()
|
|
57
|
-
def tpxo_data(request, use_dask):
|
|
58
|
-
fname = download_test_data("TPXO_regional_test_data.nc")
|
|
59
|
-
|
|
60
|
-
data = TPXODataset(
|
|
61
|
-
filename=fname,
|
|
62
|
-
use_dask=use_dask,
|
|
63
|
-
)
|
|
64
|
-
|
|
65
|
-
return data
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
@pytest.fixture()
|
|
69
|
-
def cesm_bgc_data(request, use_dask):
|
|
70
|
-
fname = download_test_data("CESM_BGC_2012.nc")
|
|
71
|
-
|
|
72
|
-
data = CESMBGCDataset(
|
|
73
|
-
filename=fname,
|
|
74
|
-
start_time=datetime(2012, 1, 1),
|
|
75
|
-
end_time=datetime(2013, 1, 1),
|
|
76
|
-
climatology=False,
|
|
77
|
-
use_dask=use_dask,
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
# extrapolate deepest value to bottom so all levels can use the same surface mask
|
|
81
|
-
for var in data.var_names:
|
|
82
|
-
data.ds[data.var_names[var]] = extrapolate_deepest_to_bottom(
|
|
83
|
-
data.ds[data.var_names[var]], data.dim_names["depth"]
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
return data
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
@pytest.fixture()
|
|
90
|
-
def cesm_surface_bgc_data(request, use_dask):
|
|
91
|
-
fname = download_test_data("CESM_BGC_SURFACE_2012.nc")
|
|
92
|
-
|
|
93
|
-
data = CESMBGCSurfaceForcingDataset(
|
|
94
|
-
filename=fname,
|
|
95
|
-
start_time=datetime(2012, 1, 1),
|
|
96
|
-
end_time=datetime(2013, 1, 1),
|
|
97
|
-
climatology=False,
|
|
98
|
-
use_dask=use_dask,
|
|
99
|
-
)
|
|
100
|
-
data.post_process()
|
|
101
|
-
|
|
102
|
-
return data
|
|
103
|
-
|
|
104
|
-
|
|
105
7
|
@pytest.mark.parametrize(
|
|
106
8
|
"data_fixture",
|
|
107
|
-
[
|
|
9
|
+
[
|
|
10
|
+
"era5_data",
|
|
11
|
+
"glorys_data",
|
|
12
|
+
"tpxo_data",
|
|
13
|
+
"coarsened_cesm_bgc_data",
|
|
14
|
+
"cesm_surface_bgc_data",
|
|
15
|
+
],
|
|
108
16
|
)
|
|
109
17
|
def test_lateral_fill_no_nans(data_fixture, request):
|
|
110
18
|
data = request.getfixturevalue(data_fixture)
|
|
@@ -128,18 +36,23 @@ def test_lateral_fill_no_nans(data_fixture, request):
|
|
|
128
36
|
assert not filled.isnull().any()
|
|
129
37
|
|
|
130
38
|
|
|
131
|
-
def test_lateral_fill_correct_order_of_magnitude(
|
|
39
|
+
def test_lateral_fill_correct_order_of_magnitude(coarsened_cesm_bgc_data):
|
|
132
40
|
|
|
133
41
|
lateral_fill = LateralFill(
|
|
134
|
-
|
|
135
|
-
[
|
|
42
|
+
coarsened_cesm_bgc_data.ds["mask"],
|
|
43
|
+
[
|
|
44
|
+
coarsened_cesm_bgc_data.dim_names["latitude"],
|
|
45
|
+
coarsened_cesm_bgc_data.dim_names["longitude"],
|
|
46
|
+
],
|
|
136
47
|
)
|
|
137
48
|
|
|
138
|
-
ALK =
|
|
49
|
+
ALK = coarsened_cesm_bgc_data.ds["ALK"]
|
|
139
50
|
|
|
140
51
|
# zero out alkalinity field in all depth levels but the uppermost
|
|
141
|
-
ALK = xr.where(
|
|
142
|
-
|
|
52
|
+
ALK = xr.where(
|
|
53
|
+
coarsened_cesm_bgc_data.ds.ALK.depth > 25, 0, coarsened_cesm_bgc_data.ds.ALK
|
|
54
|
+
)
|
|
55
|
+
ALK = ALK.where(coarsened_cesm_bgc_data.ds.mask)
|
|
143
56
|
|
|
144
57
|
filled = lateral_fill.apply(ALK.astype(np.float64))
|
|
145
58
|
|
|
@@ -176,42 +176,46 @@ def test_interpolation_from_climatology(
|
|
|
176
176
|
)
|
|
177
177
|
|
|
178
178
|
|
|
179
|
-
def
|
|
180
|
-
|
|
181
|
-
):
|
|
182
|
-
"""Test plot and save methods."""
|
|
179
|
+
def test_initial_conditions_plot(initial_conditions_with_bgc_from_climatology):
|
|
180
|
+
"""Test plot method."""
|
|
183
181
|
|
|
184
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
182
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="temp", s=0)
|
|
185
183
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
186
|
-
|
|
184
|
+
var_name="temp", s=0, depth_contours=True
|
|
187
185
|
)
|
|
188
186
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
189
|
-
|
|
187
|
+
var_name="temp", eta=0, layer_contours=True
|
|
190
188
|
)
|
|
191
189
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
192
|
-
|
|
190
|
+
var_name="temp", xi=0, layer_contours=True
|
|
193
191
|
)
|
|
194
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
195
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
196
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
197
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
192
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="temp", eta=0)
|
|
193
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="temp", xi=0)
|
|
194
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="temp", s=0, xi=0)
|
|
195
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="temp", eta=0, xi=0)
|
|
198
196
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
199
|
-
|
|
197
|
+
var_name="u", s=0, layer_contours=True
|
|
200
198
|
)
|
|
201
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
202
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
203
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
199
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="u", s=0)
|
|
200
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="u", eta=0)
|
|
201
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="u", xi=0)
|
|
204
202
|
initial_conditions_with_bgc_from_climatology.plot(
|
|
205
|
-
|
|
203
|
+
var_name="v", s=0, layer_contours=True
|
|
206
204
|
)
|
|
207
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
208
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
209
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
210
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
211
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
212
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
213
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
214
|
-
initial_conditions_with_bgc_from_climatology.plot(
|
|
205
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="v", s=0)
|
|
206
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="v", eta=0)
|
|
207
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="v", xi=0)
|
|
208
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="zeta")
|
|
209
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="ubar")
|
|
210
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="vbar")
|
|
211
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="ALK", s=0, xi=0)
|
|
212
|
+
initial_conditions_with_bgc_from_climatology.plot(var_name="ALK", eta=0, xi=0)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def test_initial_conditions_save(
|
|
216
|
+
initial_conditions_with_bgc_from_climatology, tmp_path
|
|
217
|
+
):
|
|
218
|
+
"""Test save method."""
|
|
215
219
|
|
|
216
220
|
for file_str in ["test_ic", "test_ic.nc"]:
|
|
217
221
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -18,16 +18,10 @@ def vertical_regridder(depth_values, layer_depth_rho_values):
|
|
|
18
18
|
def __init__(self, ds):
|
|
19
19
|
self.ds = ds
|
|
20
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
21
|
target_depth = xr.DataArray(data=layer_depth_rho_values, dims=["s_rho"])
|
|
27
|
-
|
|
28
|
-
mock_data = DataContainer(data_ds)
|
|
22
|
+
source_depth = xr.DataArray(data=depth_values, dims=["depth"])
|
|
29
23
|
|
|
30
|
-
return VerticalRegrid(
|
|
24
|
+
return VerticalRegrid(target_depth, source_depth)
|
|
31
25
|
|
|
32
26
|
|
|
33
27
|
@pytest.mark.parametrize(
|
|
@@ -187,12 +187,6 @@ def grid_that_straddles_180_degree_meridian():
|
|
|
187
187
|
def test_successful_initialization_with_regional_data(grid_fixture, request, use_dask):
|
|
188
188
|
"""Test the initialization of SurfaceForcing with regional ERA5 data.
|
|
189
189
|
|
|
190
|
-
This test checks the following:
|
|
191
|
-
1. SurfaceForcing object initializes successfully with provided regional data.
|
|
192
|
-
2. Attributes such as `start_time`, `end_time`, and `source` are set correctly.
|
|
193
|
-
3. The dataset contains expected variables, including "uwnd", "vwnd", "swrad", "lwrad", "Tair", "qair", and "rain".
|
|
194
|
-
4. Surface forcing plots for "uwnd", "vwnd", and "rain" are generated without errors.
|
|
195
|
-
|
|
196
190
|
The test is performed twice:
|
|
197
191
|
- First with the default fine grid.
|
|
198
192
|
- Then with the coarse grid enabled.
|
|
@@ -513,10 +507,10 @@ def test_surface_forcing_pco2_replication(sfc_forcing_fixture, request):
|
|
|
513
507
|
"coarse_surface_forcing",
|
|
514
508
|
],
|
|
515
509
|
)
|
|
516
|
-
def
|
|
517
|
-
"""Test
|
|
510
|
+
def test_surface_forcing_save(sfc_forcing_fixture, request, tmp_path):
|
|
511
|
+
"""Test save method."""
|
|
518
512
|
sfc_forcing = request.getfixturevalue(sfc_forcing_fixture)
|
|
519
|
-
sfc_forcing.plot(
|
|
513
|
+
sfc_forcing.plot(var_name="uwnd", time=0)
|
|
520
514
|
|
|
521
515
|
for file_str in ["test_sf", "test_sf.nc"]:
|
|
522
516
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -525,16 +519,24 @@ def test_surface_forcing_plot_save(sfc_forcing_fixture, request, tmp_path):
|
|
|
525
519
|
str(tmp_path / file_str),
|
|
526
520
|
]: # test for Path object and str
|
|
527
521
|
|
|
528
|
-
# Test saving without partitioning
|
|
522
|
+
# Test saving without partitioning and grouping
|
|
529
523
|
saved_filenames = sfc_forcing.save(filepath)
|
|
530
524
|
filepath_str = str(Path(filepath).with_suffix(""))
|
|
525
|
+
expected_filepath = Path(f"{filepath_str}.nc")
|
|
526
|
+
assert saved_filenames == [expected_filepath]
|
|
527
|
+
assert expected_filepath.exists()
|
|
528
|
+
expected_filepath.unlink()
|
|
529
|
+
|
|
530
|
+
# Test saving without partitioning but with grouping
|
|
531
|
+
saved_filenames = sfc_forcing.save(filepath, group=True)
|
|
532
|
+
filepath_str = str(Path(filepath).with_suffix(""))
|
|
531
533
|
expected_filepath = Path(f"{filepath_str}_202002.nc")
|
|
532
534
|
assert saved_filenames == [expected_filepath]
|
|
533
535
|
assert expected_filepath.exists()
|
|
534
536
|
expected_filepath.unlink()
|
|
535
537
|
|
|
536
538
|
# Test saving with partitioning
|
|
537
|
-
saved_filenames = sfc_forcing.save(filepath, np_eta=1)
|
|
539
|
+
saved_filenames = sfc_forcing.save(filepath, np_eta=1, group=True)
|
|
538
540
|
|
|
539
541
|
expected_filepath_list = [
|
|
540
542
|
Path(filepath_str + f"_202002.{index}.nc") for index in range(1)
|
|
@@ -545,11 +547,14 @@ def test_surface_forcing_plot_save(sfc_forcing_fixture, request, tmp_path):
|
|
|
545
547
|
expected_filepath.unlink()
|
|
546
548
|
|
|
547
549
|
|
|
548
|
-
def
|
|
549
|
-
"""Test plot
|
|
550
|
+
def test_surface_forcing_bgc_plot(bgc_surface_forcing):
|
|
551
|
+
"""Test plot method."""
|
|
550
552
|
|
|
551
|
-
|
|
552
|
-
|
|
553
|
+
bgc_surface_forcing.plot(var_name="pco2_air", time=0)
|
|
554
|
+
|
|
555
|
+
|
|
556
|
+
def test_surface_forcing_bgc_save(bgc_surface_forcing, tmp_path):
|
|
557
|
+
"""Test save method."""
|
|
553
558
|
|
|
554
559
|
for file_str in ["test_sf", "test_sf.nc"]:
|
|
555
560
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -558,16 +563,24 @@ def test_surface_forcing_bgc_plot_save(bgc_surface_forcing, tmp_path):
|
|
|
558
563
|
str(tmp_path / file_str),
|
|
559
564
|
]: # test for Path object and str
|
|
560
565
|
|
|
561
|
-
# Test saving without partitioning
|
|
566
|
+
# Test saving without partitioning and grouping
|
|
562
567
|
saved_filenames = bgc_surface_forcing.save(filepath)
|
|
563
568
|
filepath_str = str(Path(filepath).with_suffix(""))
|
|
569
|
+
expected_filepath = Path(f"{filepath_str}.nc")
|
|
570
|
+
assert saved_filenames == [expected_filepath]
|
|
571
|
+
assert expected_filepath.exists()
|
|
572
|
+
expected_filepath.unlink()
|
|
573
|
+
|
|
574
|
+
# Test saving without partitioning but with grouping
|
|
575
|
+
saved_filenames = bgc_surface_forcing.save(filepath, group=True)
|
|
576
|
+
filepath_str = str(Path(filepath).with_suffix(""))
|
|
564
577
|
expected_filepath = Path(f"{filepath_str}_202002.nc")
|
|
565
578
|
assert saved_filenames == [expected_filepath]
|
|
566
579
|
assert expected_filepath.exists()
|
|
567
580
|
expected_filepath.unlink()
|
|
568
581
|
|
|
569
582
|
# Test saving with partitioning
|
|
570
|
-
saved_filenames = bgc_surface_forcing.save(filepath, np_xi=5)
|
|
583
|
+
saved_filenames = bgc_surface_forcing.save(filepath, np_xi=5, group=True)
|
|
571
584
|
|
|
572
585
|
expected_filepath_list = [
|
|
573
586
|
Path(filepath_str + f"_202002.{index}.nc") for index in range(5)
|
|
@@ -578,13 +591,10 @@ def test_surface_forcing_bgc_plot_save(bgc_surface_forcing, tmp_path):
|
|
|
578
591
|
expected_filepath.unlink()
|
|
579
592
|
|
|
580
593
|
|
|
581
|
-
def
|
|
594
|
+
def test_surface_forcing_bgc_from_clim_save(
|
|
582
595
|
bgc_surface_forcing_from_climatology, tmp_path
|
|
583
596
|
):
|
|
584
|
-
"""Test
|
|
585
|
-
|
|
586
|
-
# Check the values in the dataset
|
|
587
|
-
bgc_surface_forcing_from_climatology.plot(varname="pco2_air", time=0)
|
|
597
|
+
"""Test save method."""
|
|
588
598
|
|
|
589
599
|
for file_str in ["test_sf", "test_sf.nc"]:
|
|
590
600
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -593,17 +603,27 @@ def test_surface_forcing_bgc_from_clim_plot_save(
|
|
|
593
603
|
str(tmp_path / file_str),
|
|
594
604
|
]: # test for Path object and str
|
|
595
605
|
|
|
596
|
-
# Test saving without partitioning
|
|
606
|
+
# Test saving without partitioning and grouping
|
|
597
607
|
saved_filenames = bgc_surface_forcing_from_climatology.save(filepath)
|
|
598
608
|
filepath_str = str(Path(filepath).with_suffix(""))
|
|
609
|
+
expected_filepath = Path(f"{filepath_str}.nc")
|
|
610
|
+
assert saved_filenames == [expected_filepath]
|
|
611
|
+
assert expected_filepath.exists()
|
|
612
|
+
expected_filepath.unlink()
|
|
613
|
+
|
|
614
|
+
# Test saving without partitioning but with grouping
|
|
615
|
+
saved_filenames = bgc_surface_forcing_from_climatology.save(
|
|
616
|
+
filepath, group=True
|
|
617
|
+
)
|
|
618
|
+
filepath_str = str(Path(filepath).with_suffix(""))
|
|
599
619
|
expected_filepath = Path(f"{filepath_str}_clim.nc")
|
|
600
620
|
assert saved_filenames == [expected_filepath]
|
|
601
621
|
assert expected_filepath.exists()
|
|
602
622
|
expected_filepath.unlink()
|
|
603
623
|
|
|
604
|
-
# Test saving with partitioning
|
|
624
|
+
# Test saving with partitioning and grouping
|
|
605
625
|
saved_filenames = bgc_surface_forcing_from_climatology.save(
|
|
606
|
-
filepath, np_eta=5
|
|
626
|
+
filepath, np_eta=5, group=True
|
|
607
627
|
)
|
|
608
628
|
|
|
609
629
|
expected_filepath_list = [
|
|
@@ -666,9 +686,9 @@ def test_files_have_same_hash(sfc_forcing_fixture, request, tmp_path, use_dask):
|
|
|
666
686
|
filepath2 = tmp_path / "test2.nc"
|
|
667
687
|
|
|
668
688
|
sfc_forcing.to_yaml(yaml_filepath)
|
|
669
|
-
sfc_forcing.save(filepath1)
|
|
689
|
+
sfc_forcing.save(filepath1, group=True)
|
|
670
690
|
sfc_forcing_from_file = SurfaceForcing.from_yaml(yaml_filepath, use_dask=use_dask)
|
|
671
|
-
sfc_forcing_from_file.save(filepath2)
|
|
691
|
+
sfc_forcing_from_file.save(filepath2, group=True)
|
|
672
692
|
|
|
673
693
|
filepath_str1 = str(Path(filepath1).with_suffix(""))
|
|
674
694
|
filepath_str2 = str(Path(filepath2).with_suffix(""))
|
|
@@ -694,9 +714,9 @@ def test_files_have_same_hash_clim(
|
|
|
694
714
|
filepath2 = tmp_path / "test2.nc"
|
|
695
715
|
|
|
696
716
|
bgc_surface_forcing_from_climatology.to_yaml(yaml_filepath)
|
|
697
|
-
bgc_surface_forcing_from_climatology.save(filepath1)
|
|
717
|
+
bgc_surface_forcing_from_climatology.save(filepath1, group=True)
|
|
698
718
|
sfc_forcing_from_file = SurfaceForcing.from_yaml(yaml_filepath, use_dask=use_dask)
|
|
699
|
-
sfc_forcing_from_file.save(filepath2)
|
|
719
|
+
sfc_forcing_from_file.save(filepath2, group=True)
|
|
700
720
|
|
|
701
721
|
filepath_str1 = str(Path(filepath1).with_suffix(""))
|
|
702
722
|
filepath_str2 = str(Path(filepath2).with_suffix(""))
|
|
@@ -169,12 +169,14 @@ def test_insufficient_number_of_consituents(grid_that_straddles_dateline, use_da
|
|
|
169
169
|
)
|
|
170
170
|
|
|
171
171
|
|
|
172
|
-
def
|
|
173
|
-
"""Test plot
|
|
174
|
-
computed."""
|
|
175
|
-
tidal_forcing.ds.load()
|
|
172
|
+
def test_tidal_forcing_plot(tidal_forcing):
|
|
173
|
+
"""Test plot method."""
|
|
176
174
|
|
|
177
|
-
tidal_forcing.plot(
|
|
175
|
+
tidal_forcing.plot(var_name="ssh_Re", ntides=0)
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def test_tidal_forcing_save(tidal_forcing, tmp_path):
|
|
179
|
+
"""Test save method."""
|
|
178
180
|
|
|
179
181
|
for file_str in ["test_tides", "test_tides.nc"]:
|
|
180
182
|
# Create a temporary filepath using the tmp_path fixture
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: roms-tools
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.1
|
|
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
|
|
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python
|
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.11
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
19
|
Requires-Python: >=3.10
|
|
19
20
|
Description-Content-Type: text/markdown
|
|
20
21
|
License-File: LICENSE
|
|
@@ -34,6 +35,7 @@ Provides-Extra: dask
|
|
|
34
35
|
Requires-Dist: dask; extra == "dask"
|
|
35
36
|
|
|
36
37
|
# ROMS-Tools
|
|
38
|
+
[](https://anaconda.org/conda-forge/roms-tools)
|
|
37
39
|
[](https://pypi.org/project/roms-tools/)
|
|
38
40
|
[](https://codecov.io/gh/CWorthy-ocean/roms-tools)
|
|
39
41
|
[](https://roms-tools.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -49,6 +51,14 @@ A suite of python tools for setting up a [ROMS](https://github.com/CESR-lab/ucla
|
|
|
49
51
|
|
|
50
52
|
## Installation
|
|
51
53
|
|
|
54
|
+
### Installation from conda forge
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
conda install -c conda-forge roms-tools
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
This command installs `ROMS-Tools` along with its `dask` dependency.
|
|
61
|
+
|
|
52
62
|
### Installation from pip
|
|
53
63
|
|
|
54
64
|
```bash
|
|
@@ -75,7 +85,7 @@ Next, install and activate the following conda environment:
|
|
|
75
85
|
|
|
76
86
|
```bash
|
|
77
87
|
conda env create -f ci/environment.yml
|
|
78
|
-
conda activate romstools
|
|
88
|
+
conda activate romstools-test
|
|
79
89
|
```
|
|
80
90
|
|
|
81
91
|
Finally, install `ROMS-Tools` in the same environment:
|
|
@@ -97,7 +107,7 @@ pip install -e .[dask]
|
|
|
97
107
|
Before running the tests, you can activate the conda environment created in the previous section:
|
|
98
108
|
|
|
99
109
|
```bash
|
|
100
|
-
conda activate romstools
|
|
110
|
+
conda activate romstools-test
|
|
101
111
|
```
|
|
102
112
|
|
|
103
113
|
Check the installation of `ROMS-Tools` has worked by running the test suite
|