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

Upgrade gmt from 6.0.0rc1 to 6.0.0rc4 #327

Merged
merged 6 commits into from
Oct 1, 2019

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Sep 19, 2019

Description of proposed changes

Testing out the new patched GMT 6.0.0rc4 release (see upstream GenericMappingTools/gmt#1471) for PyGMT, a step towards readying it for the GMT6 release coming soon. Full list of changes at GenericMappingTools/gmt@6.0.0rc1...6.0.0rc4 in addition to the patch at conda-forge/gmt-feedstock#85.

Builds upon #311. Might also be a good time to add GMT back to our conda installation (i.e. revert some aspects of #261).

Noticed some tests were breaking on my local instance when developing on GMT 6.0.0rc4, specifically test_session_management.py and test_sphinx_gallery.py. Has something to do with modern/classic mode incompatibility, possibly because of GenericMappingTools/gmt#1142. Tracking and resolving it here in this pull request.

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

@weiji14
Copy link
Member Author

weiji14 commented Sep 23, 2019

It appears that there's a flaky issue with our tests relying on a global GMT modern session, because we don't do proper setup/teardown of the GMT modern session for each test in PyGMT. With GMT==6.0.0rc4, one of the tests finally broke (see https://travis-ci.org/GenericMappingTools/pygmt/jobs/587246410#L1820-L1823):

def test_begin_end():
""""
Run a command inside a begin-end modern mode block.
First, end the global session. When finished, restart it.
"""
end() # Kill the global session

results in:

E           pygmt.exceptions.GMTCLibError: Module 'end' failed with status code 78:
E           psconvert [ERROR]: Syntax error: Modern GMT mode requires the -F option
E           end [ERROR]: Failed to call psconvert
E           end [ERROR]: process_figures returned error 71

Specifically, calling end() tries to finalize the plots from the previous test (test_psconvert.py). Actually, I think it tries to finalize all of the preceding plots... Running the tests in parallel using several subprocesses with pytest-xdist results in a dramatic amount of test failures 😨

I can do a quickfix to make the test pass ✔️, but we'll need to sort out this test flakiness at some point.

Workaround for flaky test where ending the 'global' GMT session calls `psconvert` which fails due to not having some '-F' argument. See also GenericMappingTools#327 (comment).
Change minimum required GMT version from 6.0.0rc1 to 6.0.0rc4. Also switched to using modern mode `basemap` instead of `psbasemap`, and `coast` instead of `pscoast`.
@seisman
Copy link
Member

seisman commented Sep 24, 2019

@weiji14 The psconvert errors may be a bug of GMT 6.0.0rc4. See GenericMappingTools/gmt#1636 for discussions.

@weiji14
Copy link
Member Author

weiji14 commented Sep 24, 2019

Good spotting. That '-' thing was definitely easy to miss. I'll wait to see how it gets resolved upstream.

Still feel that each of our unit test files should run in their own separate GMT session (so that it can be paralleled when we have lots of tests to run in the future) but that can be raised in a separate issue.

@weiji14
Copy link
Member Author

weiji14 commented Sep 29, 2019

GenericMappingTools/gmt#1638 is merged in, now awaiting conda-forge/gmt-feedstock#85. Note to self: revert 57efa55 and see if the patched gmt==6.0.0rc4 works.

@seisman
Copy link
Member

seisman commented Sep 30, 2019

@weiji14 FYI, conda-forge/gmt-feedstock#85 has been merged.

Bringing back the conda-forge way of installing GMT binaries as we anticipate the release of GMT 6. Note though that PyGMT still isn't tested to work on Windows. Switched to using `conda activate` instead of `source activate` which is cross-platform and available for conda>=4.6. Also updated some http links to use https if possible, pointing some anaconda ones to new locations.
@weiji14 weiji14 marked this pull request as ready for review October 1, 2019 00:07
@weiji14
Copy link
Member Author

weiji14 commented Oct 1, 2019

Ready to review @seisman. I've reinstated some of the conda-forge installation instructions from https://github.com/GenericMappingTools/pygmt/pull/261/files#diff-b50754a7065a1dece18f634c6b5b2633 (with some minor edits).

Also on my university Windows machine trying to get things to work, but will wait for this 6.0.0rc4 branch to be merged first 😄

Copy link
Member

@seisman seisman 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.

@seisman seisman merged commit c5c332c into GenericMappingTools:master Oct 1, 2019
@weiji14 weiji14 deleted the gmt6.0.0rc4 branch October 1, 2019 01:31
@weiji14 weiji14 added this to the 0.1.0 milestone Oct 4, 2019
@leouieda
Copy link
Member

Still feel that each of our unit test files should run in their own separate GMT session (so that it can be paralleled when we have lots of tests to run in the future) but that can be raised in a separate issue.

This was something I debated a lot in the beginning. The truth is that our users will be relying on there being a single modern mode session that can survive making several plots. So testing in isolation doesn't really tell us if the package works as expected.

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 this pull request may close these issues.

None yet

3 participants