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

clib: Wrap the GMT API function GMT_Read_VirtualFile #2993

Merged
merged 7 commits into from
Feb 19, 2024

Conversation

seisman
Copy link
Member

@seisman seisman commented Jan 12, 2024

Description of proposed changes

Wrap the GMT API function GMT_Read_VirtualFile which can read the data from a GMT virtual file and cast it into standard GMT data types (e.g., GMT_DATASET and GMT_GRID). This API function will be used in supporting GMT_DATASET/GMT_GRID data types in PR #2398 and #2729.

The same codes are already used in PR #2729 and #2398. This PR is created to make those two PRs smaller and easier to review.

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash command is:

  • /format: automatically format and lint the code

@seisman seisman changed the title Wrap GMT_Read_VirtualFile clib.Session: Wrap the GMT API function GMT_Read_VirtualFile Jan 12, 2024
@seisman seisman force-pushed the api/read_virtualfile branch from 0dbe930 to 6be1a10 Compare January 14, 2024 06:33
@seisman seisman force-pushed the api/read_virtualfile branch from 6be1a10 to 29702a6 Compare January 14, 2024 07:00
@seisman seisman marked this pull request as ready for review January 14, 2024 07:16
@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Jan 14, 2024
pygmt/clib/session.py Outdated Show resolved Hide resolved
pygmt/clib/session.py Outdated Show resolved Hide resolved
@seisman seisman added this to the 0.12.0 milestone Jan 14, 2024
@seisman seisman removed the needs review This PR has higher priority and needs review. label Jan 14, 2024
@seisman seisman added the needs review This PR has higher priority and needs review. label Feb 2, 2024
@seisman seisman requested a review from weiji14 February 18, 2024 10:26
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.

Looks good, just a tiny suggestion.

Comment on lines +4 to +5
from pygmt.datatypes.dataset import _GMT_DATASET
from pygmt.datatypes.grid import _GMT_GRID
Copy link
Member

Choose a reason for hiding this comment

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

In #2398 and #2729, you have the GMT_DATASET and GMT_GRID classes in one file, but here, you've separated them into two files. I think this is ok, since we'll need to wrap GMT_IMAGE and GMT_CUBE at some point.

pygmt/clib/session.py Outdated Show resolved Hide resolved
@seisman seisman added final review call This PR requires final review and approval from a second reviewer and removed needs review This PR has higher priority and needs review. labels Feb 19, 2024
@seisman seisman merged commit 2d78563 into main Feb 19, 2024
16 of 21 checks passed
@seisman seisman deleted the api/read_virtualfile branch February 19, 2024 10:48
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label Feb 19, 2024
@seisman seisman changed the title clib.Session: Wrap the GMT API function GMT_Read_VirtualFile clib: Wrap the GMT API function GMT_Read_VirtualFile Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants