Skip to content

Bump to GMT 6.2.0rc1 #1217

Closed
Closed

Description

@seisman

The first release candidate of GMT 6.2.0 has been released (https://github.com/GenericMappingTools/gmt/releases/tag/6.2.0rc1) today.

Now GMT 6.2.0rc1 is available in the devel channel on conda-forge (https://anaconda.org/conda-forge/gmt/) and can be installed using:

conda install -c conda-forge/label/dev gmt=6.2.0rc1

We need to:

Activity

  1. added
    maintenance
    on Apr 20, 2021
  2. weiji14 commented on Apr 20, 2021

    @weiji14
    Member

    Bumping to GMT 6.2.0rc1 will also affect several existing PRs. I think we should go ahead with bumping the version as soon as possible though (so that we can test and fix any new bugs). Is there any PR we would like to merge/finish before bumping PyGMT to use GMT 6.2.0rc1? Otherwise it will get lost under a torrent of PRs relating to fixing broken unit tests 😆

    I was actually thinking of updating https://github.com/GenericMappingTools/pygmt/blob/e4cb775346814dce46555a27c0c94f8e0aed6f04/.github/workflows/dvc-diff.yml to have a side-by-side before/after comparison of the images (instead of just having a single new image shown). Unsure if I have time this week to update that workflow (have a presentation and my PhD defence to prep for) but will see.

  3. seisman commented on Apr 20, 2021

    @seisman
    MemberAuthor

    I was actually thinking of updating e4cb775/.github/workflows/dvc-diff.yml to have a side-by-side before/after comparison of the images (instead of just having a single new image shown).

    I can work on this.

  4. seisman commented on Apr 21, 2021

    @seisman
    MemberAuthor

    @GenericMappingTools/pygmt-maintainers please give #1219 and #1218 a fast review and approval, otherwise, we won't finish the migration before the next 6.2.0rc2 or 6.2.0 release.

  5. pinned this issue on Apr 21, 2021
  6. maxrjones commented on Apr 21, 2021

    @maxrjones
    Member

    @GenericMappingTools/pygmt-maintainers please give #1219 and #1218 a fast review and approval, otherwise, we won't finish the migration before the next 6.2.0rc2 or 6.2.0 release.

    I know we haven't updated the documentation for the maintainer review process yet, but I think these are good examples of when to use the 'request a review' option for pinging pygmt-maintainers. At least for me, I usually periodically skim the PRs for any that have been marked 'ready for review' or 'final review call' but will notice specific review requests immediately.

  7. seisman commented on Apr 21, 2021

    @seisman
    MemberAuthor

    I've merged #1218, so now the CI tests are running with GMT 6.2.0rc1, and ~100 tests fail, due to the modern theme changes introduced in GMT 6.2.

    What we need to do to make the tests pass again:

    1. Install (or upgrade) 6.2.0rc1 in your local environment using conda install -c conda-forge/label/dev gmt=6.2.0rc1
    2. Run tests in a specific test file, e.g., pytest pygmt/tests/test_basemap.py
    3. If there are any failing tests, you should be able to see the baseline.png and result.png images in the results directory.
    4. Compare the baseline.png and result.png images. Do the differences make sense to you?
    5. Generate new baseline images using pytest --mpl-generate-path=baseline pygmt/tests/test_basemap.py
    6. Copy new baseline images of the failing tests to the pygmt/tests/baseline directory
    7. Add the baseline images to DVC and push the images following the contributing guides.
    8. Open PRs
  8. seisman commented on Apr 21, 2021

    @seisman
    MemberAuthor

    Here is a list of test files that contain failing tests. Anyone is welcome to work on them.

    Not failing, but wrong according to #1217 (comment)

    • pygmt/tests/test_subplot.py
    • pygmt/tests/test_text.py
    • pygmt/tests/test_wiggle.py
  9. added
    help wanted
    on Apr 21, 2021
  10. weiji14 commented on Apr 21, 2021

    @weiji14
    Member

    I'll handle all the test_grd*.py tests in a single PR if that's ok.

  11. seisman commented on Apr 21, 2021

    @seisman
    MemberAuthor

    I'll handle all the test_grd*.py tests in a single PR if that's ok.

    OK to me.

  12. weiji14 commented on Apr 21, 2021

    @weiji14
    Member

    Cool, can we also agree on a standardized PR title? E.g. "Update fig.??? baseline images for GMT 6.2.0rc1"?

  13. seisman commented on Apr 21, 2021

    @seisman
    MemberAuthor

    Cool, can we also agree on a standardized PR title? E.g. "Update fig.??? baseline images for GMT 6.2.0rc1"?

    Good.

  14. added this to the 0.4.0 milestone on Apr 22, 2021
  15. weiji14 commented on Apr 23, 2021

    @weiji14
    Member

    I think we may be encountering something flaky in PyGMT's test suite. There's 3 separate cases (opened by 3 different people) where using pytest pygmt/tests/test_somemodule.py passes on a specific module but make test fails for the whole test suite:

    This reminds me of https://github.com/GenericMappingTools/pygmt/pull/476/files#r453429872 (which motivated the use of a @pytest.mark.runfirst decorator, @seisman will remember this). The 3 cases above may well be 3 separate issues, but they seem to be too much of a coincidence. We'll need to track down whether this is an upstream GMT issue, or something wrong with the test suite on PyGMT's side, and this will require quite a bit of detective work.

  16. 6 remaining items

  17. maxrjones commented on Apr 27, 2021

    @maxrjones
    Member

    I understand the original logic behind a single GMT session for all tests in #327 (comment). Still, I don't expect that users will be attempting to use the entire PyGMT library in a single session, which is the goal of the test suite. So I think it would be worth revisiting this
    For the purposes of quickly resolving this GMT 6.2.0rc1 baseline image update issue, specifically for makecpt at #1231 and fig.solar at #1232 (ignoring fig.grdview since that's about dvc migration), we'll need a quick workaround to get the tests green again. Do we want to 1) use @pytest.mark.xfail or 2) get the image that make test expects from https://github.com/GenericMappingTools/pygmt/actions/runs/787380280 under Artifacts and upload it to dvc or 3) something else?

    Since option 2 will reverse the problem (i.e., fail with pytest pygmt/tests/test_makecpt.py), I am in favor of option 1 as an interim solution.

  18. seisman commented on Apr 27, 2021

    @seisman
    MemberAuthor

    Option 1 👍

  19. seisman commented on Apr 27, 2021

    @seisman
    MemberAuthor

    A little progress on the flaky tests.

    Similar to makecpt() tests in #1231, the Figure.soloar() tests (#1232) pass when running the single test, but fail when running with pygmt/tests/test_session_management.py. To reproduce it, you can check out the branch in #1232 and run:

    pytest pygmt/tests/test_session_management.py pygmt/tests/test_solar.py
    

    If I delete the file pygmt/tests/test_session_management.py and run the full tests with make test, the Figure.solar() tests pass, but some other tests fail (in a good way). Here are the list of new failing tests after deleting pygmt/tests/test_session_management.py:

    FAILED ../pygmt/tests/test_subplot.py::test_subplot_basic_frame
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_direct
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_autolabel_margins_title
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_clearance_and_shared_xy_axis_layout
    FAILED ../pygmt/tests/test_text.py::test_text_single_line_of_text
    FAILED ../pygmt/tests/test_text.py::test_text_multiple_lines_of_text
    FAILED ../pygmt/tests/test_text.py::test_text_input_single_filename
    FAILED ../pygmt/tests/test_text.py::test_text_input_remote_filename
    FAILED ../pygmt/tests/test_text.py::test_text_input_multiple_filenames
    FAILED ../pygmt/tests/test_text.py::test_text_position
    FAILED ../pygmt/tests/test_text.py::test_text_position_offset_with_line
    FAILED ../pygmt/tests/test_text.py::test_text_angle_30
    FAILED ../pygmt/tests/test_text.py::test_text_font_bold
    FAILED ../pygmt/tests/test_text.py::test_text_fill
    FAILED ../pygmt/tests/test_text.py::test_text_pen
    FAILED ../pygmt/tests/test_text.py::test_text_round_clearance
    FAILED ../pygmt/tests/test_text.py::test_text_justify_bottom_right_and_top_left
    FAILED ../pygmt/tests/test_text.py::test_text_justify_parsed_from_textfile
    FAILED ../pygmt/tests/test_text.py::test_text_angle_font_justify_from_textfile
    FAILED ../pygmt/tests/test_text.py::test_text_transparency
    FAILED ../pygmt/tests/test_text.py::test_text_varying_transparency
    FAILED ../pygmt/tests/test_text.py::test_text_nonstr_text
    FAILED ../pygmt/tests/test_wiggle.py::test_wiggle
    

    I didn't check all the tests, but it seems some baseline images are incorrect, but the tests on master branch pass. For example, for the test test_text_transparency, the current baseline image is incorrect:

    Current baseline Expected baseline
    image image

    As far as I understand it, test files like pygmt/tests/test_session_management.py or docstrings that call import pygmt (e.g., pygmt/src/grdfilter.py) create new sessions or nested sessions, which cause problems for us. Since we don't see these problems with GMT 6.1.1, perhaps some upstream bugs (e.g., memory leakages) in GMT 6.2.0rc1?

  20. seisman commented on Apr 27, 2021

    @seisman
    MemberAuthor

    Actually, on the master branch, the Figure.text() tests fail when running pytest pygmt/tests/test_text.py, but pass with make test.

  21. seisman commented on Apr 27, 2021

    @seisman
    MemberAuthor

    Here is a minimal example to reproduce the flaky tests we're having:

    from pygmt import Figure
    from pygmt.clib import Session
    from pygmt.session_management import begin, end
    
    # check the current value of MAP_FRAME_AXES
    with Session() as lib:
        lib.call_module("get", "MAP_FRAME_AXES")
    # plot the first image
    fig = Figure()
    fig.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
    fig.savefig("before.png")
    
    # end the global session
    end()
    # start a new global session
    begin()
    
    # check the current value of MAP_FRAME_AXES
    with Session() as lib:
        lib.call_module("get", "MAP_FRAME_AXES")
    # plot the second image
    fig = Figure()
    fig.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
    fig.savefig("after.png")
    

    Just in case you don't know it:

    • import pygmt calls the begin() function, which is just the wrapper of gmt begin pygmt-session
    • when the script exits, the end() function is called, which is the wrapper of gmt end

    The output of the two "gmt get" calls is:

    auto
    WESNZ
    

    The resulting images are:

    Before After
    before after

    Apparently, these two images diff due to the differences of MAP_FRAME_AXES settings (auto vs WESNZ). I think it's an upstream GMT bug. Please see if the minimal example can help you debug GMT. @PaulWessel @meghanrjones

  22. maxrjones commented on Apr 27, 2021

    @maxrjones
    Member

    Thanks for the the minimal example @seisman. I will see what I can find about this.

  23. maxrjones commented on Apr 28, 2021

    @maxrjones
    Member

    No solution yet but it seems to be an issue with GMT_keyword_updated that was implemented as part of GenericMappingTools/gmt#3344. At the start of the second global session, GMT_keyword_updated is set to true for the options that were updated in gmtinit_conf_modern_override() in the first global session, which leads to a session-level gmt.conf file being written that contains the classic versions of the theme dependent parameters.

  24. maxrjones commented on Apr 28, 2021

    @maxrjones
    Member

    GenericMappingTools/gmt#5178 fixes the minimal example and make these tests fail (some now in a proper way):

    FAILED ../pygmt/tests/test_basemap.py::test_basemap_polar
    FAILED ../pygmt/tests/test_makecpt.py::test_makecpt_categorical
    FAILED ../pygmt/tests/test_makecpt.py::test_makecpt_cyclic
    FAILED ../pygmt/tests/test_solar.py::test_solar_terminators
    FAILED ../pygmt/tests/test_solar.py::test_solar_set_terminator_datetime[terminator_datetime_string]
    FAILED ../pygmt/tests/test_solar.py::test_solar_set_terminator_datetime[terminator_datetime1]
    FAILED ../pygmt/tests/test_solar.py::test_solar_default_terminator
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_basic_frame
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_direct
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_autolabel_margins_title
    FAILED ../pygmt/tests/test_subplot.py::test_subplot_clearance_and_shared_xy_axis_layout
    FAILED ../pygmt/tests/test_text.py::test_text_single_line_of_text
    FAILED ../pygmt/tests/test_text.py::test_text_multiple_lines_of_text
    FAILED ../pygmt/tests/test_text.py::test_text_input_single_filename
    FAILED ../pygmt/tests/test_text.py::test_text_input_remote_filename
    FAILED ../pygmt/tests/test_text.py::test_text_input_multiple_filenames
    FAILED ../pygmt/tests/test_text.py::test_text_position
    FAILED ../pygmt/tests/test_text.py::test_text_position_offset_with_line
    FAILED ../pygmt/tests/test_text.py::test_text_angle_30
    FAILED ../pygmt/tests/test_text.py::test_text_font_bold
    FAILED ../pygmt/tests/test_text.py::test_text_fill
    FAILED ../pygmt/tests/test_text.py::test_text_pen
    FAILED ../pygmt/tests/test_text.py::test_text_round_clearance
    FAILED ../pygmt/tests/test_text.py::test_text_justify_bottom_right_and_top_left
    FAILED ../pygmt/tests/test_text.py::test_text_justify_parsed_from_textfile
    FAILED ../pygmt/tests/test_text.py::test_text_angle_font_justify_from_textfile
    FAILED ../pygmt/tests/test_text.py::test_text_transparency
    FAILED ../pygmt/tests/test_text.py::test_text_varying_transparency
    FAILED ../pygmt/tests/test_text.py::test_text_nonstr_text
    FAILED ../pygmt/tests/test_wiggle.py::test_wiggle
    

    But, the two makecpt() tests still fail and I get a fatal error on pygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarray. I will merge GenericMappingTools/gmt#5178 since it is a needed correction. Then it will be necessary to sort out the remaining problems.

  25. weiji14 commented on Apr 29, 2021

    @weiji14
    Member

    Thanks @seisman and @meghanrjones for tracking this down and fixing the bug. Sounds like we might need a GMT 6.2.0rc2? Let's put an xfail for the fig.solar tests at #1232 for now @seisman to get the tests passing (and close this issue). We can then track/fix the false positive passing tests (for subplot, text, and wiggle) later in a separate issue/PR.

  26. maxrjones commented on Apr 29, 2021

    @maxrjones
    Member

    I agree 6.2.0rc2 will be needed soon. Even though the gmt-dev CI tests are passing, I am still concerned about my local fatal error in pygmt/tests/test_grdtrack.py::test_grdtrack_input_dataframe_and_dataarray and would like to figure that out before releasing rc2. It would be helpful to know if anyone else gets a similar issue when testing using the gmt-dev branch. This is my setup:

    >>> pygmt.show_versions()
    PyGMT information:
      version: v0.3.2.dev123+gb855310b.d20210429
    System information:
      python: 3.9.2 | packaged by conda-forge | (default, Feb 21 2021, 05:02:20)  [Clang 11.0.1 ]
      executable: /Users/meghanj/Sandbox/anaconda-03/anaconda3/envs/pygmt-dev/bin/python
      machine: macOS-11.3-x86_64-i386-64bit
    Dependency information:
      numpy: 1.20.2
      pandas: 1.2.4
      xarray: 0.17.0
      netCDF4: 1.5.6
      packaging: 20.9
      ghostscript: 9.53.3
      gmt: 6.2.0_a6980cb_2021.04.28
    

    I plan to look into this more tomorrow, but in the meantime this is the specific error that I get when trying to run output = grdtrack(points=dataframe, grid=dataarray, newcolname="bathymetry"):
    python grdtrack-test.py Assertion failed: (node < G->header->size), function gmt_bcr_get_z_fast, file ../src/gmt_bcr.c, line 256. Abort trap: 6

  27. weiji14 commented on Apr 29, 2021

    @weiji14
    Member

    Agree on finding out what is causing the grdtrack fatal error before GMT 6.2.0rc2, I've just built the latest GMT from master (GenericMappingTools/gmt@a6980cb) and will try and see what's up. I'll probably work on it in the grdrack refactor PR at #1189.

    Edit: I can't reproduce the fatal error on Linux, and the 'macOS-11.0 - GMT master' test didn't seem to crash either at https://github.com/GenericMappingTools/pygmt/runs/2463360992?check_suite_focus=true#step:15:272.

  28. maxrjones commented on Apr 29, 2021

    @maxrjones
    Member

    Agree on finding out what is causing the grdtrack fatal error before GMT 6.2.0rc2, I've just built the latest GMT from master (GenericMappingTools/gmt@a6980cb) and will try and see what's up. I'll probably work on it in the grdrack refactor PR at #1189.

    Edit: I can't reproduce the fatal error on Linux, and the 'macOS-11.0 - GMT master' test didn't seem to crash either at https://github.com/GenericMappingTools/pygmt/runs/2463360992?check_suite_focus=true#step:15:272.

    Thanks for checking. It was a silly mistake on my part in continuing on in debug mode even after being done with debugging so I ran into an assert statement 🤦‍♀️

  29. weiji14 commented on Apr 30, 2021

    @weiji14
    Member

    With #1232 merged in, I think we can close this GMT 6.2.0rc1 issue. We should continue to track the test flakiness issue over at #1242, and open a separate "Bump to GMT 6.2.0rc2" issue later on to fix problematic tests.

  30. unpinned this issue on Apr 30, 2021
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

    help wantedmaintenance

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions