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

examples: define 'sample_data' for all examples #2044

Merged

Conversation

phil-blain
Copy link
Contributor

Ever since 297e1cb (Moving sample_data imports out of cartopy
namespace., 2020-07-23), some examples are not self-contained since they
want to import 'sample_data' from a non-existing module like 'waves' or
'arrows'.

Add the required 'sample_data' function to make all examples
self-contained. For 'contour_labels.py' and 'contour_transforms.py', the
function is copied from 'waves.py'. For 'barbs.py' and 'streamplot.py',
the function is copied from 'arrows.py'.

Rationale

Make all examples self-contained.

Implications

Examples can be downloaded and ran individually.

Ever since 297e1cb (Moving sample_data imports out of cartopy
namespace., 2020-07-23), some examples are not self-contained since they
want to import 'sample_data' from a non-existing module like 'waves' or
'arrows'.

Add the required 'sample_data' function to make all examples
self-contained. For 'contour_labels.py' and 'contour_transforms.py', the
function is copied from 'waves.py'. For 'barbs.py' and 'streamplot.py',
the function is copied from 'arrows.py'.
@phil-blain phil-blain force-pushed the examples-self-contained-sample-data branch from 8d34618 to 2fa98f9 Compare May 10, 2022 15:10
@greglucas greglucas added this to the 0.21 milestone May 11, 2022
Copy link
Contributor

@greglucas greglucas left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for updating these!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants