Skip to content

Download data in dataexamples#1712

Merged
casperdcl merged 14 commits intomasterfrom
data_examples
Mar 13, 2024
Merged

Download data in dataexamples#1712
casperdcl merged 14 commits intomasterfrom
data_examples

Conversation

@hrobarts
Copy link
Copy Markdown
Contributor

@hrobarts hrobarts commented Feb 16, 2024

Describe your changes

  • Add REMOTEDATA class in dataexample.py for downloading remote data (for use in CIL demos and how-to examples How to demo notebooks for website CIL-Demos#144 )
  • Move the internal data to an CILDATA class which has a default data directory
  • REMOTEDATA, doesn't have a default data directory. get method must supply a data_dir pointing to the data. If the data isn't found, return an error suggesting to use the download_data method
  • download_data method checks if the data already exisits in the data_dir, then requires user confirmation to start download

Describe any testing you have performed

Added tests in test_dataexample.py TestRemoteData class

  • Mock the http response with a temporary zip file
  • Mock the user input to accept the download

Link relevant issues

#1708

Checklist when you are ready to request a review

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers
  • Change pull request label to 'Waiting for review'

Contribution Notes

Please read and adhere to the developer guide and local patterns and conventions.

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License.
  • I confirm that the contribution does not violate any intellectual property rights of third parties

@hrobarts hrobarts self-assigned this Feb 20, 2024
@hrobarts hrobarts marked this pull request as ready for review February 27, 2024 09:25
Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
Copy link
Copy Markdown
Member

@casperdcl casperdcl left a comment

Choose a reason for hiding this comment

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

lgtm; I'll probably open a follow-up PR slightly tidying the internal inheritance structure, but none of that is user-facing (wouldn't affect the docs)

@casperdcl casperdcl merged commit b16a429 into master Mar 13, 2024
@casperdcl casperdcl deleted the data_examples branch March 13, 2024 16:09
@casperdcl casperdcl mentioned this pull request Mar 13, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants