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

Rename API function Session.open_virtual_file to Session.open_virtualfile (remove in v0.15.0) #2996

Merged
merged 5 commits into from
Jan 17, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 14, 2024

Description of proposed changes

The GMT API function name is GMT_Open_VirtualFile, so the Python wrapper should be open_virtualfile rather than open_virtual_file. We also use virtualfile_from_vectors/matrix/grid rather than virtual_file_from_vectors/matrix/grid.

The API function Session.open_virtual_file has been renamed to Session.open_virtualfile in a backward-compatible way and will be fully removed in v0.15.0 (four minor releases which is about one year). A warning will be raised if anyone uses the old function name.

xref: https://docs.generic-mapping-tools.org/dev/devdocs/api.html#list-of-api-functions

@seisman seisman added deprecation Deprecating a feature needs review This PR has higher priority and needs review. labels Jan 14, 2024
@seisman seisman added this to the 0.11.0 milestone Jan 14, 2024
@seisman seisman changed the title Rename API function Session.open_virtual_file to Session_virtualfile (will be removed in v0.15.0) Rename API function Session.open_virtual_file to Session.open_virtualfile (will be removed in v0.15.0) Jan 14, 2024
@seisman seisman changed the title Rename API function Session.open_virtual_file to Session.open_virtualfile (will be removed in v0.15.0) Rename API function Session.open_virtual_file to Session.open_virtualfile (remove in v0.15.0) Jan 16, 2024
Copy link
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only a couple of minor suggestions.

pygmt/clib/session.py Outdated Show resolved Hide resolved
Comment on lines 1200 to 1201
Examples
--------
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a doctest actually needed for the old open_virtual_file method? Or can we just omit it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to make sure that the old function name still works as expected. But I'm OK with removing it, since it's a very simple wrapper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 9fcff9c.

@seisman seisman merged commit 6d5c466 into main Jan 17, 2024
14 of 18 checks passed
@seisman seisman deleted the api/open-virtualfile branch January 17, 2024 03:23
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation Deprecating a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants