Skip to content

Is create_test_data() public API? #2686

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

Open
TomNicholas opened this issue Jan 17, 2019 · 3 comments
Open

Is create_test_data() public API? #2686

TomNicholas opened this issue Jan 17, 2019 · 3 comments

Comments

@TomNicholas
Copy link
Member

We want to encourage people to use and extend xarray, and we already provide testing functions as public API to help with this.

One function I keep using when writing code which uses xarray is xarray.tests.test_dataset.create_test_data(). This is very useful for quickly writing tests for the same reasons that it's useful in xarray's internal tests, but it's not explicitly public API. This means that there's no guarantee it won't change/disappear, which is not ideal if you're trying to write a test suite for separate software. But so many tests in xarray rely on it that presumably it's not going to get changed.

Is there any reason why it shouldn't be public API? Is there something I should use instead?

@max-sixty
Copy link
Collaborator

I think we could make that public, interested in others' thoughts

I'm often creating my own ds manually, and should instead just call that to get an object.

We could also promote it to xarray.testing if that make it more accessible and the API more explicit. And potentially encourage its usage in tests rather than manually creating a ds fixture.

@jhamman
Copy link
Member

jhamman commented Jan 17, 2019

Right, nothing in xarray/tests/ should be considered public API. +1 for moving this to xarray/testing.py if we want to expose this function as public API.

@stale
Copy link

stale bot commented Dec 19, 2020

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

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 a pull request may close this issue.

4 participants