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

Remove the pygmt.test function from pygmt/__init__.py? #2633

Closed
seisman opened this issue Aug 17, 2023 · 3 comments · Fixed by #2652
Closed

Remove the pygmt.test function from pygmt/__init__.py? #2633

seisman opened this issue Aug 17, 2023 · 3 comments · Fixed by #2652
Labels
deprecation Deprecating a feature
Milestone

Comments

@seisman
Copy link
Member

seisman commented Aug 17, 2023

The pygmt/__init__.py file provides a test function:

def test(doctest=True, verbose=True, coverage=False, figures=True):

With this test function, users can run pygmt.test() to run the full tests.

I think we should remove this function based on the following reasons:

  1. The function was first added in commit ef1fa9c in 2017, and there is almost no changes/maintenance since then (https://github.com/GenericMappingTools/pygmt/blame/main/pygmt/__init__.py#L187).
  2. The pygmt.test() is useless for regular users, because the baseline images hosted by DVC are not available in regular pip/conda packages.
  3. For PyGMT maintainers, the Makefile provides more powerful targets like test/fulltest/doctest/test_no_images to test PyGMT, and no one has used pygmt.test before.
  4. The pygmt.test() function is not documented in the current documentation, so removing it won't cause any backward-incompatibility. Related PR: Remove "Full test" section from the installation guide #1200

Let's have a vote: 👍 for removing it and 👎 for keeping it. Or you can leave your thoughts/comments here.

@seisman seisman added the triage Unsure where this issue fits label Aug 17, 2023
@weiji14 weiji14 added question Further information is requested and removed triage Unsure where this issue fits labels Aug 31, 2023
@weiji14
Copy link
Member

weiji14 commented Aug 31, 2023

Agree with removing it. There is also no code coverage currently for this pygmt.test function (see https://app.codecov.io/gh/GenericMappingTools/pygmt/blob/release-v0.9.0/pygmt%2F__init__.py#L185), so this would bump up the codecov metrics slightly.

The only reference I found of pygmt.test() on GitHub at https://github.com/search?q=pygmt.test%28%29&type=code is someone that's been scraping the PyGMT issues for some AI model 😅

@weiji14
Copy link
Member

weiji14 commented Sep 1, 2023

The pygmt.test() function is not documented in the current documentation, so removing it won't cause any backward-incompatibility.

Actually, we do have it documented at https://www.pygmt.org/v0.9.0/api/generated/pygmt.test.html, but I don't think it would be a breaking change since pygmt.test isn't used to process data or produce figures. We could skip the deprecation cycle, and just decide to remove it?

@seisman
Copy link
Member Author

seisman commented Sep 1, 2023

The pygmt.test() function is not documented in the current documentation, so removing it won't cause any backward-incompatibility.

Actually, we do have it documented at https://www.pygmt.org/v0.9.0/api/generated/pygmt.test.html, but I don't think it would be a breaking change since pygmt.test isn't used to process data or produce figures. We could skip the deprecation cycle, and just decide to remove it?

Yes to me.

@seisman seisman added this to the 0.10.0 milestone Sep 1, 2023
@seisman seisman added deprecation Deprecating a feature and removed question Further information is requested labels Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Deprecating a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants