-
Notifications
You must be signed in to change notification settings - Fork 218
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 minimum supported version to GMT>=6.4.0 #3450
Conversation
This reverts commit c6860b2.
I'm inclined to option 3. What do you think @GenericMappingTools/pygmt-maintainers? |
Ok with this in principle, but I'm thinking of the variable names. How about:
References:
Slightly off-topic, but I suppose we'll also set a requirement for |
I prefer to
It reads like we recommend 6.4.0 and don't recommend 6.5.0. What about
Yes, I agree. |
After thinking twice, maybe we should go for option 1 for now to reduce our maintenance burden and revisit option 3 when we release PyGMT v1.0. |
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.
In doc/install.md
, change this line:
Line 311 in f8db417
- Ghostscript 9.53-9.56 for GMT 6.3.0/6.4.0 |
to "- Ghostscript 9.53-9.56 for GMT 6.4.0 (or below)"
@@ -198,16 +197,9 @@ def info(self): | |||
"library path": self.get_default("API_LIBRARY"), | |||
"cores": self.get_default("API_CORES"), | |||
"grid layout": self.get_default("API_GRID_LAYOUT"), | |||
"image layout": self.get_default("API_IMAGE_LAYOUT"), |
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'm getting a blank value with this as mentioned at #3468 (comment). Are you getting any output?
import pygmt
with pygmt.clib.Session() as lib:
print(lib.info["image layout"]) # API_IMAGE_LAYOUT
output from lib.info
dict:
{'version': '6.5.0',
'padding': '2',
'share dir': '~/mambaforge/envs/pygmt/share/gmt',
'plugin dir': '~/mambaforge/envs/pygmt/lib/gmt/plugins',
'library path': '~/mambaforge/envs/pygmt/lib/libgmt.so',
'cores': '16',
'grid layout': 'rows',
'image layout': '',
'binary version': '6.5.0'}
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.
Thanks @seisman! There are some comments on this PR, but are more just questions that can be addressed separately.
# Can't access the cpt attribute using virtual files | ||
# if Version(__gmt_version__) >= Version("6.4.0"): | ||
# assert data.attrs["cpt"] == "@earth_age.cpt" | ||
# assert data.attrs["cpt"] == "@earth_age.cpt" |
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.
Is this something that could be obtained from the GMT_GRID
struct somehow?
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.
No, the cpt information is stored in the private, hidden structure GMT_GRID_HEADER_HIDDEN
:
We can't access it unless we decide to wrap the non-public GMT structure.
Description of proposed changes
In commit 539f3e8, I removed the codes for compatibility with GMT 6.3.0. After that, I manually triggered the "GMT Legacy Tests" workflow at https://github.com/GenericMappingTools/pygmt/actions/runs/11010826577. The CI job for GMT 6.3 no longer works because
API_BIN_VERSION
was added in GMT 6.4.0.The initial plan is to drop GMT 6.3 support in PyGMT v0.14.0, so we should remove any GMT 6.3 compatibility codes and GMT 6.3 from the CI matrix.
Then, the question is, do we want to revert changes in
pygmt/clib/session.py
so that most PyGMT functionality still works with GMT 6.3? In this case, GMT 6.3 is still allowed for future PyGMT versions, but there is no guarantee that all PyGMT functionalities work as expected. [Edit: Partially reverted in b0e6c69].In b0e6c69, I updated
pygmt/clib/session.py
so that PyGMT works for GMT 6.3-6.5 (also have to temporarily reverttest_grdfill.py
in c6860b2 because it's known to crash with GMT 6.3). In the CI runs at https://github.com/GenericMappingTools/pygmt/actions/runs/11013102550, most tests still pass, except a few that are expected to fail.In 33c1061, I removed GMT 6.3 for the testing CI matrix so GMT 6.3 is no longer tested, although PyGMT is still compatible with it. Then the question is whether we want to drop GMT 6.3 support completely. I think we have three options:
required_gmt_version
from6.3.0
to6.4.0
, which means that people who use GMT 6.3 will see the GMTVersionError exceptionrequired_gmt_version="6.3.0"
and add a note like "PyGMT requires GMT>=6.3.0 but only GMT 6.4-6.5 are fully tested" on the installation page.required_gmt_version="6.4.0"
andminimum_required_version="6.3.0"
, and raise the GMTVersionError for GMT<6.3.0 and raise an warning like "GMT 6.3.0 is not fully tested." for GMT=6.3.0.Thoughts?