-
Notifications
You must be signed in to change notification settings - Fork 224
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
Set GMT_COMPATIBILITY to 6 when pygmt session starts #432
Conversation
To prevent users getting "pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6".
Prevents regression of pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6. Contains setup, test and teardown of a mock session where the user has a gmt.conf file with GMT_COMPATIBILITY = 5.
assert os.path.exists("gmt.conf") | ||
os.remove("gmt.conf") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is a "gmt.conf" file in the current directory. It should be in the temporary gmt session directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda agree, but wouldn't the assertion fail if there isn't a gmt.conf
file? 😕 Things got really confusing for me when I was designing this test with gmt.conf
files all over the place, one kept popping up in my pygmt
folder with GMT_COMPATIBILITY 5
for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, you're right, it's in "/home/.../pygmt/tmp-test-dir-with-unique-name/gmt.conf". I'll remove these lines once the tests on Windows pass in the other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand why the test works, but since the test pass, OK to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's a complicated test. but removing the line at
pygmt/pygmt/session_management.py
Line 19 in 8df13da
lib.call_module("set", "GMT_COMPATIBILITY 6") |
Co-authored-by: Dongdong Tian <[email protected]>
@MarkWieczorek, do you want to test this branch (using |
It works! |
Because it's in a temporary pygmt session folder anyway.
Description of proposed changes
To prevent users getting "pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6". Overrides GMT_COMPATIBILITY setting in users
gmt.conf
file.Fixes #428, #365
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.