GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — clib: Wrap the GMT API function GMT_Read_VirtualFile by seisman · Pull Request #2993 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented Jan 12, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

  • API documentation: https://docs.generic-mapping-tools.org/dev/devdocs/api.html#gmt-read-virtualfile
  • C source code: https://github.com/GenericMappingTools/gmt/blob/14a9350341846b9b1d21bb01dfcbcee593d30896/src/gmt_api.c#L9389

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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
Wrap GMT_Read_VirtualFile
29702a6
@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
seisman
seisman commented Jan 14, 2024
View reviewed changes
Comment thread pygmt/clib/session.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread pygmt/clib/session.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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 added 3 commits February 2, 2024 15:03
@seisman
Apply suggestions from code review
225433c
@seisman
Merge branch 'main' into api/read_virtualfile
aecf86d
@seisman
Update doctest
87814d7
@seisman seisman added the needs review This PR has higher priority and needs review. label Feb 2, 2024
@seisman
Merge branch 'main' into api/read_virtualfile
034ef2c
@seisman
seisman requested a review from weiji14 February 18, 2024 10:26
weiji14
weiji14 approved these changes Feb 18, 2024
View reviewed changes

@weiji14 weiji14 left a comment

Copy link
Copy Markdown
Member

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.

Looks good, just a tiny suggestion.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pygmt/datatypes/__init__.py
Comment on lines +4 to +5
from pygmt.datatypes.dataset import _GMT_DATASET
from pygmt.datatypes.grid import _GMT_GRID

@weiji14 weiji14 Feb 18, 2024

Copy link
Copy Markdown
Member

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 #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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pygmt/clib/session.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

seisman and others added 2 commits February 19, 2024 02:16
@seisman @weiji14
Update pygmt/clib/session.py
8ffa4cc
Co-authored-by: Wei Ji <[email protected]>
@seisman
Merge branch 'main' into api/read_virtualfile
06a4425
@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
@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 mentioned this pull request Feb 28, 2024
Wrap GMT's standard data type GMT_DATASET for table inputs #2729
Merged
2 tasks
@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

Reviewers

@weiji14 weiji14 weiji14 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

enhancement Improving an existing feature

Projects

None yet

Milestone

0.12.0

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@seisman @weiji14
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.