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 — Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' for pandas output by seisman · Pull Request #3140 · GenericMappingTools/pygmt

Conversation

@seisman

@seisman seisman commented Mar 26, 2024 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Address #3131 (comment).

Changes in this PR:

  • GMT_DATASET.to_dataframe: Add new parameters names/dtype/index_col
  • Session.virtualfile_to_dataset: AAdd new parameter dtype/index_col and rename column_names to names
  • Simplify some wrappers

The parameter names names/dtype/index_col are very close to the ones in the pd.read_csv function.

Sorry, something went wrong.

Uh oh!

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

All reactions
@seisman
GMT_DATASET.to_dataframe: Add the parameter 'names' for specifying th…
96e68b4
…e column names
seisman
seisman commented Mar 26, 2024
View reviewed changes
Comment thread pygmt/clib/session.py
@@ -1747,6 +1747,8 @@ def virtualfile_to_dataset(
vfname: str,
output_type: Literal["pandas", "numpy", "file"] = "pandas",
column_names: list[str] | None = None,

@seisman seisman Mar 26, 2024

Copy link
Copy Markdown
Member Author

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 Session.virtualfile_to_dataset, do we want to rename column_names to names?

Sorry, something went wrong.

Uh oh!

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

All reactions

@seisman seisman Mar 26, 2024

Copy link
Copy Markdown
Member Author

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.

Done in f211b7d.

Sorry, something went wrong.

Uh oh!

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

All reactions

@weiji14 weiji14 Mar 26, 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.

I kinda prefer column_names, we don't necessarily need to follow pd.read_csv here.

Sorry, something went wrong.

Uh oh!

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

All reactions

@seisman seisman Mar 27, 2024

Copy link
Copy Markdown
Member Author

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.

Do you mean using column_names in both GMT_DATASET.to_dataframe and Session.virtualfile_to_dataset?

Sorry, something went wrong.

Uh oh!

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

All reactions

@weiji14 weiji14 Mar 27, 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.

Yes, i.e. revert f211b7d

Sorry, something went wrong.

Uh oh!

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

All reactions
@seisman seisman changed the title GMT_DATASET.to_dataframe: Add the parameter 'names' for specifying the column names GMT_DATASET.to_dataframe: Add the parameter 'names'/'dtype'/'index_col' Mar 26, 2024
@seisman
seisman marked this pull request as ready for review March 26, 2024 06:55
@seisman seisman added enhancement Improving an existing feature needs review This PR has higher priority and needs review. labels Mar 26, 2024
@seisman seisman added this to the 0.12.0 milestone Mar 26, 2024
@seisman seisman changed the title GMT_DATASET.to_dataframe: Add the parameter 'names'/'dtype'/'index_col' GMT_DATASET.to_dataframe: Add new parameters 'names'/'dtype'/'index_col' Mar 26, 2024
@seisman
Add parameter dtype and index_col
4554e63
@seisman
seisman force-pushed the dataset/to_dataframe branch from 9f67844 to 4554e63 Compare March 26, 2024 07:03
@seisman seisman changed the title GMT_DATASET.to_dataframe: Add new parameters 'names'/'dtype'/'index_col' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' and rename 'column_names' to 'names' Mar 26, 2024
@seisman
Session.virtualfile_to_dataset: Rename parameter 'column_names' to 'n…
a3d7768
…ames'
@seisman
seisman force-pushed the dataset/to_dataframe branch from f211b7d to a3d7768 Compare March 26, 2024 09:07
@seisman seisman mentioned this pull request Mar 26, 2024
GMT_DATASET.to_dataframe: Return an empty DataFrame if a file contains no data #3131
Merged
yvonnefroehlich
yvonnefroehlich reviewed Mar 26, 2024
View reviewed changes
Comment thread pygmt/datatypes/dataset.py Resolved

Uh oh!

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

seisman and others added 4 commits March 26, 2024 21:35
@seisman @yvonnefroehlich
Apply suggestions from code review
11d29f1
Co-authored-by: Yvonne Fröhlich <[email protected]>
@seisman
Revert "Session.virtualfile_to_dataset: Rename parameter 'column_name…
2b0e7ba
…s' to 'names'"

This reverts commit a3d7768.
@seisman
Merge branch 'main' into dataset/to_dataframe
7880a68
@seisman
Rename names to column_names
abda146
@seisman
seisman force-pushed the dataset/to_dataframe branch from f11dc89 to abda146 Compare March 27, 2024 02:02
@seisman seisman changed the title Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' and rename 'column_names' to 'names' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' Mar 27, 2024
@seisman seisman changed the title Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' Session.virtualfile_to_dataset: Add new parameters 'dtype'/'index_col' for pandas output Mar 27, 2024
weiji14
weiji14 approved these changes Mar 27, 2024
View reviewed changes
@seisman
seisman merged commit f0d4d21 into main Mar 27, 2024
@seisman
seisman deleted the dataset/to_dataframe branch March 27, 2024 02:27
@seisman seisman removed the needs review This PR has higher priority and needs review. label Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@yvonnefroehlich yvonnefroehlich yvonnefroehlich left review comments
@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.

3 participants

@seisman @weiji14 @yvonnefroehlich
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 01402775 — 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.