Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new "one-to-one" mode for modelling tides at multiple locations with unique timesteps #1142

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

robbibt
Copy link
Member

@robbibt robbibt commented Sep 20, 2023

Proposed changes

Currently, the model_tides function operates in "one-to-many" mode, which will model tides for every requested timestep, at every requested location. For example, if we provided five x, y coordinates and five timesteps, the function would return:

5 locations * 5 timesteps = 25 modelled tides

However, often a user may want to model tides for a list of locations, each with a unique timesteps.

This change adds a new "one-to-one" mode, allowing users to model tides for only these exact pairs of locations and times. Using the previous example (five x, y coordinates and five timesteps) in "one-to-one" mode:

5 timesteps at 5 locations = 5 modelled tides

Example from notebook:
image

Other changes:

  • Updated How_to_guides/Tidal_modelling.ipynb to document new functionality
  • Added tests for new functionality

Closes issues (optional)

Checklist (replace [ ] with [x] to check off)

  • Notebook created using the DEA-notebooks template
  • Remove any unused Python packages from Load packages
  • Remove any unused/empty code cells
  • Remove any guidance cells (e.g. General advice)
  • Ensure that all code cells follow the PEP8 standard for code. The jupyterlab_code_formatter tool can be used to format code cells to a consistent style: select each code cell, then click Edit and then one of the Apply X Formatter options (YAPF or Black are recommended).
  • Include relevant tags in the final notebook cell (refer to the DEA Tags Index, and re-use tags if possible)
  • Clear all outputs, run notebook from start to finish, and save the notebook in the state where all cells have been sequentially evaluated
  • Test notebook on both the NCI and DEA Sandbox (flag if not working as part of PR and ask for help to solve if needed)
  • If applicable, update the Notebook currently compatible with the NCI|DEA Sandbox environment only line below the notebook title to reflect the environments the notebook is compatible with

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@robbibt robbibt changed the title Add analysis mode selection to model_tides function Add new "one-to-one" mode to model tides for lists of locations and matching timesteps Sep 21, 2023
@robbibt robbibt changed the title Add new "one-to-one" mode to model tides for lists of locations and matching timesteps Add new "one-to-one" mode for modelling tides at multiple locations with unique timesteps Sep 21, 2023
@robbibt robbibt marked this pull request as ready for review September 21, 2023 05:23
Copy link
Collaborator

@vnewey vnewey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Robbi!

@vnewey vnewey merged commit b26dc86 into develop Sep 21, 2023
2 checks passed
@vnewey vnewey deleted the model_tides_updates branch September 21, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants