Major refactor of tide modelling funcs to add improved parallelization #1112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
This PR implements a major refactor of the
model_tides
andpixel_tides
functions to improve performance when modelling large numbers of points/timesteps with multiple models by adding parallelisation usingconcurrent.futures
and Dask.Parallelisation in
model_tides
is applied both across each individual tide model, as well as (optionally) by splitting tide modelling points into smaller chunks that are run in parallel. These are configurable via theparallel
andparallel_splits
params.For modelling 10,000 timesteps, 1000 lat/lon points and 6 tide models on the 16XL DEA Sandbox server with
parallel_splits=10
, this improves runtimes by more than an order of magnitude:The
pixel_tides
function has additionally been updated to use new Dask reproject functionality fromodc-geo
, used to reproject low-res tide outputs to each higher res satellite pixel (@Kirill888).Other updates:
DEA_TOOLS_TIDE_MODELS
(thanks to a suggestion by @omad in Provide a global method to set the tidal data directory #1109)model_tides
to be returned in wide or long dataframe formatcoastal.py
test coverage to include newly added multiple tide modelling functionalityCloses issues
Closes #1109