roms-tools 3.3.0__py3-none-any.whl → 3.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/__init__.py +1 -1
- roms_tools/analysis/cdr_ensemble.py +10 -13
- roms_tools/analysis/roms_output.py +5 -304
- roms_tools/{download.py → datasets/download.py} +1 -0
- roms_tools/{setup → datasets}/lat_lon_datasets.py +88 -64
- roms_tools/{setup → datasets}/river_datasets.py +9 -4
- roms_tools/datasets/roms_dataset.py +854 -0
- roms_tools/datasets/utils.py +487 -0
- roms_tools/{setup/fill.py → fill.py} +110 -13
- roms_tools/plot.py +4 -4
- roms_tools/regrid.py +76 -0
- roms_tools/setup/boundary_forcing.py +53 -45
- roms_tools/setup/cdr_release.py +2 -4
- roms_tools/setup/grid.py +46 -15
- roms_tools/setup/initial_conditions.py +330 -71
- roms_tools/setup/mask.py +2 -5
- roms_tools/setup/nesting.py +13 -6
- roms_tools/setup/river_forcing.py +4 -4
- roms_tools/setup/surface_forcing.py +15 -11
- roms_tools/setup/tides.py +7 -6
- roms_tools/setup/topography.py +10 -2
- roms_tools/setup/utils.py +292 -666
- roms_tools/tests/test_analysis/test_cdr_ensemble.py +4 -6
- roms_tools/tests/test_analysis/test_roms_output.py +1 -220
- roms_tools/tests/{test_setup → test_datasets}/test_lat_lon_datasets.py +4 -4
- roms_tools/tests/{test_setup → test_datasets}/test_river_datasets.py +1 -1
- roms_tools/tests/test_datasets/test_roms_dataset.py +743 -0
- roms_tools/tests/test_datasets/test_utils.py +527 -0
- roms_tools/tests/{test_setup/test_fill.py → test_fill.py} +72 -9
- roms_tools/tests/test_regrid.py +120 -1
- roms_tools/tests/test_setup/test_boundary_forcing.py +57 -138
- roms_tools/tests/test_setup/test_cdr_release.py +4 -5
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zarr.json +293 -2021
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zarr.json +294 -2022
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ALK/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/ALK_west → initial_conditions_from_roms.zarr/ALK}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ALK_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west → initial_conditions_from_roms.zarr/ALK_ALT_CO2}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Cs_r/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_unified_climatology.zarr/diatFe_west → initial_conditions_from_roms.zarr/Cs_r}/zarr.json +5 -12
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Cs_w/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatFe_west → initial_conditions_from_roms.zarr/Cs_w}/zarr.json +3 -10
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOCr_west → initial_conditions_from_roms.zarr/DIC}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC_ALT_CO2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DIC_ALT_CO2/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOCr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west → initial_conditions_from_roms.zarr/DOCr}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DON/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DON/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DONr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DONr/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOPr/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/DOPr/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Fe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Fe/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/Lig/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOP_west → initial_conditions_from_roms.zarr/Lig}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NH4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DON_west → initial_conditions_from_roms.zarr/NH4}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/NO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/O2/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/Lig_west → initial_conditions_from_roms.zarr/O2}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/PO4/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/PO4/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/SiO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/SiO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/abs_time/zarr.json +47 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatC_west → initial_conditions_from_roms.zarr/diatC}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diatChl_west → initial_conditions_from_roms.zarr/diatChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/O2_west → initial_conditions_from_roms.zarr/diatFe}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DIC_west → initial_conditions_from_roms.zarr/diatP}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diatSi/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/DOC_west → initial_conditions_from_roms.zarr/diatSi}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/diazChl_west → initial_conditions_from_roms.zarr/diazChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/Fe_west → initial_conditions_from_roms.zarr/diazFe}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/diazP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ocean_time/c/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ocean_time/zarr.json +47 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/salt/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_unified_climatology.zarr/ALK_west → initial_conditions_from_roms.zarr/salt}/zarr.json +12 -9
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spCaCO3/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spCaCO3/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spChl/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/spChl_west → initial_conditions_from_roms.zarr/spChl}/zarr.json +11 -8
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spFe/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spFe/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spP/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/spP/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/temp/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/temp/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/u/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/{bgc_boundary_forcing_from_climatology.zarr/NH4_west → initial_conditions_from_roms.zarr/u}/zarr.json +12 -9
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ubar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/ubar/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/v/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/v/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/vbar/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/vbar/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/w/zarr.json +57 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zarr.json +2481 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zeta/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zeta/zarr.json +54 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zooC/c/0/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/initial_conditions_from_roms.zarr/zooC/zarr.json +57 -0
- roms_tools/tests/test_setup/test_grid.py +66 -1
- roms_tools/tests/test_setup/test_initial_conditions.py +130 -104
- roms_tools/tests/test_setup/test_nesting.py +2 -1
- roms_tools/tests/test_setup/test_surface_forcing.py +1 -1
- roms_tools/tests/test_setup/test_tides.py +1 -1
- roms_tools/tests/test_setup/test_utils.py +100 -15
- roms_tools/tests/test_setup/test_validation.py +15 -0
- roms_tools/tests/test_tiling/test_partition.py +63 -15
- roms_tools/tests/test_utils.py +365 -0
- roms_tools/tiling/partition.py +81 -211
- roms_tools/utils.py +360 -62
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/METADATA +2 -3
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/RECORD +137 -174
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/WHEEL +1 -1
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/ALK_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DIC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DON_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DONr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/DOPr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Fe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/Lig_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NH4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/NO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/O2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/PO4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/SiO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diatSi_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/diazP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spCaCO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/spP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_climatology.zarr/zooC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_ALT_CO2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/ALK_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_ALT_CO2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_ALT_CO2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DIC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOCr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOCr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DON_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DON_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DONr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DONr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOPr_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/DOPr_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Fe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Fe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Lig_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/Lig_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NH4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NH4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/NO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/O2_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/O2_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/PO4_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/PO4_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/SiO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/SiO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatSi_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diatSi_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/diazP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spC_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spCaCO3_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spCaCO3_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spChl_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spChl_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spFe_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spFe_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spP_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/spP_west/zarr.json +0 -54
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zooC_west/c/0/0/0 +0 -0
- roms_tools/tests/test_setup/test_data/bgc_boundary_forcing_from_unified_climatology.zarr/zooC_west/zarr.json +0 -54
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/licenses/LICENSE +0 -0
- {roms_tools-3.3.0.dist-info → roms_tools-3.5.0.dist-info}/top_level.txt +0 -0
roms_tools/tiling/partition.py
CHANGED
|
@@ -7,6 +7,61 @@ import xarray as xr
|
|
|
7
7
|
|
|
8
8
|
from roms_tools.utils import save_datasets
|
|
9
9
|
|
|
10
|
+
DIM_INFO = {
|
|
11
|
+
# eta-direction
|
|
12
|
+
"eta_rho": dict(axis="eta", ghost=2, edge="both"),
|
|
13
|
+
"eta_u": dict(axis="eta", ghost=2, edge="both"),
|
|
14
|
+
"eta_v": dict(axis="eta", ghost=1, edge="upper"),
|
|
15
|
+
"eta_psi": dict(axis="eta", ghost=3, edge="both"),
|
|
16
|
+
"eta_coarse": dict(axis="eta", ghost=2, edge="both"),
|
|
17
|
+
# xi-direction
|
|
18
|
+
"xi_rho": dict(axis="xi", ghost=2, edge="both"),
|
|
19
|
+
"xi_u": dict(axis="xi", ghost=1, edge="upper"),
|
|
20
|
+
"xi_v": dict(axis="xi", ghost=2, edge="both"),
|
|
21
|
+
"xi_psi": dict(axis="xi", ghost=3, edge="both"),
|
|
22
|
+
"xi_coarse": dict(axis="xi", ghost=2, edge="both"),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _exact_division(size: int, nparts: int, dim: str) -> int:
|
|
27
|
+
if size % nparts != 0:
|
|
28
|
+
raise ValueError(
|
|
29
|
+
f"Dimension '{dim}' of size {size} cannot be evenly divided into {nparts} partitions."
|
|
30
|
+
)
|
|
31
|
+
return size // nparts
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _compute_partition_sizes(
|
|
35
|
+
total_size: int,
|
|
36
|
+
nparts: int,
|
|
37
|
+
ghost: int,
|
|
38
|
+
edge: str,
|
|
39
|
+
dim: str,
|
|
40
|
+
) -> list[int]:
|
|
41
|
+
"""Compute per-tile sizes including ghost cells."""
|
|
42
|
+
if nparts == 1:
|
|
43
|
+
return [total_size]
|
|
44
|
+
|
|
45
|
+
core = _exact_division(total_size - ghost, nparts, dim)
|
|
46
|
+
|
|
47
|
+
sizes = [core] * nparts
|
|
48
|
+
|
|
49
|
+
if edge == "both":
|
|
50
|
+
sizes[0] += ghost // 2
|
|
51
|
+
sizes[-1] += ghost - ghost // 2
|
|
52
|
+
elif edge == "upper":
|
|
53
|
+
sizes[-1] += ghost
|
|
54
|
+
else:
|
|
55
|
+
raise ValueError(f"Unknown edge rule '{edge}' for {dim}")
|
|
56
|
+
|
|
57
|
+
return sizes
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _cumsum(sizes: list[int]) -> np.ndarray:
|
|
61
|
+
out = np.zeros(len(sizes) + 1, dtype=int)
|
|
62
|
+
out[1:] = np.cumsum(sizes)
|
|
63
|
+
return out
|
|
64
|
+
|
|
10
65
|
|
|
11
66
|
def partition(
|
|
12
67
|
ds: xr.Dataset, np_eta: int = 1, np_xi: int = 1, include_coarse_dims: bool = True
|
|
@@ -16,8 +71,8 @@ def partition(
|
|
|
16
71
|
|
|
17
72
|
This function divides the input dataset into `np_eta` by `np_xi` tiles, where each tile
|
|
18
73
|
represents a subdomain of the original dataset. The partitioning is performed along
|
|
19
|
-
the spatial dimensions `eta_rho`, `
|
|
20
|
-
depending on which dimensions are present in the dataset.
|
|
74
|
+
the spatial dimensions `eta_rho`, `eta_u`, `eta_v`, `eta_coarse`, `xi_rho`, `xi_u`, `xi_v`,
|
|
75
|
+
and `xi_coarse`, depending on which dimensions are present in the dataset.
|
|
21
76
|
|
|
22
77
|
Parameters
|
|
23
78
|
----------
|
|
@@ -71,227 +126,42 @@ def partition(
|
|
|
71
126
|
):
|
|
72
127
|
raise ValueError("np_eta and np_xi must be positive integers")
|
|
73
128
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"
|
|
79
|
-
"eta_psi",
|
|
80
|
-
"xi_psi",
|
|
129
|
+
# Select applicable dimensions
|
|
130
|
+
dims_to_partition = [
|
|
131
|
+
d
|
|
132
|
+
for d in DIM_INFO
|
|
133
|
+
if d in ds.dims and (include_coarse_dims or "coarse" not in d)
|
|
81
134
|
]
|
|
82
|
-
coarse_dims = ["eta_coarse", "xi_coarse"]
|
|
83
|
-
partitionable_dims = base_dims + coarse_dims if include_coarse_dims else base_dims
|
|
84
|
-
|
|
85
|
-
dims_to_partition = [d for d in partitionable_dims if d in ds.dims]
|
|
86
|
-
|
|
87
|
-
# if eta is periodic there are no ghost cells along those dimensions
|
|
88
|
-
if "eta_v" in ds.sizes and ds.sizes["eta_rho"] == ds.sizes["eta_v"]:
|
|
89
|
-
# TODO how are we supposed to know if eta is periodic if eta_v doesn't appear? partit.F doesn't say...
|
|
90
|
-
n_eta_ghost_cells = 0
|
|
91
|
-
else:
|
|
92
|
-
n_eta_ghost_cells = 1
|
|
93
|
-
|
|
94
|
-
# if xi is periodic there are no ghost cells along those dimensions
|
|
95
|
-
if "xi_u" in ds.sizes and ds.sizes["xi_rho"] == ds.sizes["xi_u"]:
|
|
96
|
-
n_xi_ghost_cells = 0
|
|
97
|
-
else:
|
|
98
|
-
n_xi_ghost_cells = 1
|
|
99
|
-
|
|
100
|
-
def integer_division_or_raise(a: int, b: int, dimension: str) -> int:
|
|
101
|
-
"""Perform integer division and ensure that the division is exact.
|
|
102
|
-
|
|
103
|
-
Parameters
|
|
104
|
-
----------
|
|
105
|
-
a : int
|
|
106
|
-
The numerator for the division.
|
|
107
|
-
b : int
|
|
108
|
-
The denominator for the division.
|
|
109
|
-
dimension : str
|
|
110
|
-
The name of the dimension being partitioned, used for error reporting.
|
|
111
|
-
|
|
112
|
-
Returns
|
|
113
|
-
-------
|
|
114
|
-
int
|
|
115
|
-
The result of the integer division.
|
|
116
|
-
|
|
117
|
-
Raises
|
|
118
|
-
------
|
|
119
|
-
ValueError
|
|
120
|
-
If the division is not exact, indicating that the domain cannot be evenly divided
|
|
121
|
-
along the specified dimension.
|
|
122
|
-
"""
|
|
123
|
-
remainder = a % b
|
|
124
|
-
if remainder == 0:
|
|
125
|
-
return a // b
|
|
126
|
-
else:
|
|
127
|
-
raise ValueError(
|
|
128
|
-
f"Dimension '{dimension}' of size {a} cannot be evenly divided into {b} partitions."
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
if "eta_rho" in dims_to_partition:
|
|
132
|
-
eta_rho_domain_size = integer_division_or_raise(
|
|
133
|
-
ds.sizes["eta_rho"] - 2 * n_eta_ghost_cells, np_eta, "eta_rho"
|
|
134
|
-
)
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
xi_rho_domain_size = integer_division_or_raise(
|
|
138
|
-
ds.sizes["xi_rho"] - 2 * n_xi_ghost_cells, np_xi, "xi_rho"
|
|
139
|
-
)
|
|
136
|
+
partitioned_sizes = {}
|
|
140
137
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
if "xi_u" in dims_to_partition:
|
|
147
|
-
xi_u_domain_size = integer_division_or_raise(
|
|
148
|
-
ds.sizes["xi_u"] - 1 * n_xi_ghost_cells, np_xi, "xi_u"
|
|
149
|
-
)
|
|
150
|
-
|
|
151
|
-
if "eta_psi" in dims_to_partition:
|
|
152
|
-
eta_psi_domain_size = integer_division_or_raise(
|
|
153
|
-
ds.sizes["eta_psi"] - 3 * n_eta_ghost_cells, np_eta, "eta_psi"
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
if "xi_psi" in dims_to_partition:
|
|
157
|
-
xi_psi_domain_size = integer_division_or_raise(
|
|
158
|
-
ds.sizes["xi_psi"] - 3 * n_xi_ghost_cells, np_xi, "xi_psi"
|
|
159
|
-
)
|
|
138
|
+
for dim in dims_to_partition:
|
|
139
|
+
info = DIM_INFO[dim]
|
|
140
|
+
nparts = np_eta if info["axis"] == "eta" else np_xi
|
|
160
141
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
142
|
+
partitioned_sizes[dim] = _compute_partition_sizes(
|
|
143
|
+
total_size=ds.sizes[dim],
|
|
144
|
+
nparts=nparts,
|
|
145
|
+
ghost=info["ghost"],
|
|
146
|
+
edge=info["edge"],
|
|
147
|
+
dim=dim,
|
|
164
148
|
)
|
|
165
|
-
if "xi_coarse" in dims_to_partition:
|
|
166
|
-
xi_coarse_domain_size = integer_division_or_raise(
|
|
167
|
-
ds.sizes["xi_coarse"] - 2 * n_xi_ghost_cells, np_xi, "xi_coarse"
|
|
168
|
-
)
|
|
169
|
-
|
|
170
|
-
# unpartitioned dimensions should have sizes unchanged
|
|
171
|
-
partitioned_sizes = {
|
|
172
|
-
dim: [size] for dim, size in ds.sizes.items() if dim in dims_to_partition
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
# TODO refactor to use two functions for odd- and even-length dimensions
|
|
176
|
-
if "eta_v" in dims_to_partition:
|
|
177
|
-
partitioned_sizes["eta_v"] = [eta_v_domain_size] * (np_eta - 1) + [
|
|
178
|
-
eta_v_domain_size + n_eta_ghost_cells
|
|
179
|
-
]
|
|
180
|
-
if "xi_u" in dims_to_partition:
|
|
181
|
-
partitioned_sizes["xi_u"] = [xi_u_domain_size] * (np_xi - 1) + [
|
|
182
|
-
xi_u_domain_size + n_xi_ghost_cells
|
|
183
|
-
]
|
|
184
|
-
|
|
185
|
-
if np_eta > 1:
|
|
186
|
-
if "eta_rho" in dims_to_partition:
|
|
187
|
-
partitioned_sizes["eta_rho"] = (
|
|
188
|
-
[eta_rho_domain_size + n_eta_ghost_cells]
|
|
189
|
-
+ [eta_rho_domain_size] * (np_eta - 2)
|
|
190
|
-
+ [eta_rho_domain_size + n_eta_ghost_cells]
|
|
191
|
-
)
|
|
192
|
-
if "eta_psi" in dims_to_partition:
|
|
193
|
-
partitioned_sizes["eta_psi"] = (
|
|
194
|
-
[n_eta_ghost_cells + eta_psi_domain_size]
|
|
195
|
-
+ [eta_psi_domain_size] * (np_eta - 2)
|
|
196
|
-
+ [eta_psi_domain_size + 2 * n_eta_ghost_cells]
|
|
197
|
-
)
|
|
198
|
-
if "eta_coarse" in dims_to_partition:
|
|
199
|
-
partitioned_sizes["eta_coarse"] = (
|
|
200
|
-
[eta_coarse_domain_size + n_eta_ghost_cells]
|
|
201
|
-
+ [eta_coarse_domain_size] * (np_eta - 2)
|
|
202
|
-
+ [eta_coarse_domain_size + n_eta_ghost_cells]
|
|
203
|
-
)
|
|
204
|
-
|
|
205
|
-
if np_xi > 1:
|
|
206
|
-
if "xi_rho" in dims_to_partition:
|
|
207
|
-
partitioned_sizes["xi_rho"] = (
|
|
208
|
-
[xi_rho_domain_size + n_xi_ghost_cells]
|
|
209
|
-
+ [xi_rho_domain_size] * (np_xi - 2)
|
|
210
|
-
+ [xi_rho_domain_size + n_xi_ghost_cells]
|
|
211
|
-
)
|
|
212
|
-
if "xi_psi" in dims_to_partition:
|
|
213
|
-
partitioned_sizes["xi_psi"] = (
|
|
214
|
-
[n_xi_ghost_cells + xi_psi_domain_size]
|
|
215
|
-
+ [xi_psi_domain_size] * (np_xi - 2)
|
|
216
|
-
+ [xi_psi_domain_size + 2 * n_xi_ghost_cells]
|
|
217
|
-
)
|
|
218
|
-
if "xi_coarse" in dims_to_partition:
|
|
219
|
-
partitioned_sizes["xi_coarse"] = (
|
|
220
|
-
[xi_coarse_domain_size + n_xi_ghost_cells]
|
|
221
|
-
+ [xi_coarse_domain_size] * (np_xi - 2)
|
|
222
|
-
+ [xi_coarse_domain_size + n_xi_ghost_cells]
|
|
223
|
-
)
|
|
224
|
-
|
|
225
|
-
def cumsum(pmf):
|
|
226
|
-
"""Implementation of cumsum which ensures the result starts with zero."""
|
|
227
|
-
cdf = np.empty(len(pmf) + 1, dtype=int)
|
|
228
|
-
cdf[0] = 0
|
|
229
|
-
np.cumsum(pmf, out=cdf[1:])
|
|
230
|
-
return cdf
|
|
231
149
|
|
|
232
150
|
file_numbers = []
|
|
233
151
|
partitioned_datasets = []
|
|
152
|
+
|
|
234
153
|
for i in range(np_eta):
|
|
235
154
|
for j in range(np_xi):
|
|
236
|
-
|
|
237
|
-
file_numbers.append(file_number)
|
|
238
|
-
|
|
155
|
+
file_numbers.append(j + i * np_xi)
|
|
239
156
|
indexers = {}
|
|
240
157
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
xi_rho_partition_indices = cumsum(partitioned_sizes["xi_rho"])
|
|
249
|
-
indexers["xi_rho"] = slice(
|
|
250
|
-
int(xi_rho_partition_indices[j]),
|
|
251
|
-
int(xi_rho_partition_indices[j + 1]),
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
if "eta_v" in dims_to_partition:
|
|
255
|
-
eta_v_partition_indices = cumsum(partitioned_sizes["eta_v"])
|
|
256
|
-
indexers["eta_v"] = slice(
|
|
257
|
-
int(eta_v_partition_indices[i]),
|
|
258
|
-
int(eta_v_partition_indices[i + 1]),
|
|
259
|
-
)
|
|
260
|
-
if "xi_u" in dims_to_partition:
|
|
261
|
-
xi_u_partition_indices = cumsum(partitioned_sizes["xi_u"])
|
|
262
|
-
indexers["xi_u"] = slice(
|
|
263
|
-
int(xi_u_partition_indices[j]), int(xi_u_partition_indices[j + 1])
|
|
264
|
-
)
|
|
265
|
-
if "eta_psi" in dims_to_partition:
|
|
266
|
-
eta_psi_partition_indices = cumsum(partitioned_sizes["eta_psi"])
|
|
267
|
-
indexers["eta_psi"] = slice(
|
|
268
|
-
int(eta_psi_partition_indices[i]),
|
|
269
|
-
int(eta_psi_partition_indices[i + 1]),
|
|
270
|
-
)
|
|
271
|
-
if "xi_psi" in dims_to_partition:
|
|
272
|
-
xi_psi_partition_indices = cumsum(partitioned_sizes["xi_psi"])
|
|
273
|
-
indexers["xi_psi"] = slice(
|
|
274
|
-
int(xi_psi_partition_indices[j]),
|
|
275
|
-
int(xi_psi_partition_indices[j + 1]),
|
|
276
|
-
)
|
|
277
|
-
|
|
278
|
-
if "eta_coarse" in dims_to_partition:
|
|
279
|
-
eta_coarse_partition_indices = cumsum(partitioned_sizes["eta_coarse"])
|
|
280
|
-
indexers["eta_coarse"] = slice(
|
|
281
|
-
int(eta_coarse_partition_indices[i]),
|
|
282
|
-
int(eta_coarse_partition_indices[i + 1]),
|
|
283
|
-
)
|
|
284
|
-
|
|
285
|
-
if "xi_coarse" in dims_to_partition:
|
|
286
|
-
xi_coarse_partition_indices = cumsum(partitioned_sizes["xi_coarse"])
|
|
287
|
-
indexers["xi_coarse"] = slice(
|
|
288
|
-
int(xi_coarse_partition_indices[j]),
|
|
289
|
-
int(xi_coarse_partition_indices[j + 1]),
|
|
290
|
-
)
|
|
291
|
-
|
|
292
|
-
partitioned_ds = ds.isel(**indexers)
|
|
293
|
-
|
|
294
|
-
partitioned_datasets.append(partitioned_ds)
|
|
158
|
+
for dim, sizes in partitioned_sizes.items():
|
|
159
|
+
info = DIM_INFO[dim]
|
|
160
|
+
idx = i if info["axis"] == "eta" else j
|
|
161
|
+
bounds = _cumsum(sizes)
|
|
162
|
+
indexers[dim] = slice(bounds[idx], bounds[idx + 1])
|
|
163
|
+
|
|
164
|
+
partitioned_datasets.append(ds.isel(**indexers))
|
|
295
165
|
|
|
296
166
|
return file_numbers, partitioned_datasets
|
|
297
167
|
|