Skip to content

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

Closed

Description

@seisman

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.

Activity

  1. added
    triage
    on Aug 17, 2023
  2. added
    question
    and removed
    triage
    on Aug 31, 2023
  3. weiji14 commented on Aug 31, 2023

    @weiji14
    Member

    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 😅

  4. weiji14 commented on Sep 1, 2023

    @weiji14
    Member

    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?

  5. seisman commented on Sep 1, 2023

    @seisman
    MemberAuthor

    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.

  6. added this to the 0.10.0 milestone on Sep 1, 2023
  7. added
    deprecation
    and removed
    question
    on Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deprecation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions