GeezerVison is showing github.com — Wrap GMT's standard data type GMT_DATASET for table inputs by seisman · Pull Request #2729 · GenericMappingTools/pygmt
Conversation
seisman
commented
Oct 9, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Description of proposed changes
Similar to #2398, this PR contains some experimental codes to support GMT's standard data type GMT_DATASET for table inputs.
Here are some technical background. In GMT, table inputs are stored in a GMT_DATASET object. A GMT_DATASET object can contain several table files (stored in GMT_DATATABLE) and each table can contain several segments (stored in GMT_DATASEGMENT), and each data segment have M rows and N columns.
References: https://docs.generic-mapping-tools.org/latest/devdocs/api.html#struct-dataset
The ultimate goals are:
Currently, I'm doing too much work in this PR, for example:
Wrapping the GMT C API GMT_Read_Virtualfile Merged to main in clib: Wrap the GMT API function GMT_Read_VirtualFile #2993
Provide a new session method virtualfile_to_data to allow GMT modules write output into a virtual file. Merged to main in clib: Add the virtualfile_out method for creating output virtualfile #3057
- Wrapping the GMT_DATASET data type and related
GMT_DATATABLE and GMT_DATASEGMENT
- Refactor many modules (e.g.,
grd2xyz, grdtrack) to show how this PR will change the way we handle table-like outputs.
Thus, we need to split this PR into a few smaller PRs if this PR is proven to be working.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
weiji14 reacted with heart emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
seisman
commented
Feb 28, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
In commit a21b2df, I've reverted all changes that I made to the module wrappers so that we can focus on wrapping GMT_DATASET in this PR.
The reverted changes will be included in PR #3083.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
seisman
commented
Feb 28, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging #2729 will degrade performances by 90.44%
Comparing datatypes/gmtdataset (76a09f0) with main (ab39616)
Summary
⚡ 1 improvements ❌ 12 regressions ✅ 85 untouched benchmarks
⚠️ Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
Benchmark main datatypes/gmtdataset Change
⚡ test_blockmean_input_xyz 412.7 ms 366.8 ms +12.54%
❌ test_contour_matrix[DataFrame] 90.8 ms 281.6 ms -67.76%
❌ test_contour_matrix[Dataset] 103.9 ms 294.7 ms -64.74%
❌ test_contour_matrix[array] 88.6 ms 279.3 ms -68.3%
❌ test_filter1d_format 199.6 ms 518.8 ms -61.52%
❌ test_grd2xyz 43.1 ms 229.9 ms -81.28%
❌ test_grdtrack_input_dataframe_and_dataarray 43.9 ms 233.8 ms -81.22%
❌ test_grdvolume_no_outgrid 41.7 ms 294.9 ms -85.86%
❌ test_project_input_matrix[DataFrame] 41.6 ms 422.7 ms -90.16%
❌ test_project_input_matrix[Dataset] 50.7 ms 431.8 ms -88.25%
❌ test_project_input_matrix[array] 40.3 ms 421.3 ms -90.44%
❌ test_select_input_dataframe 184.5 ms 371.8 ms -50.37%
❌ test_delaunay_triples_input_xyz 169.3 ms 357.8 ms -52.67%
This benchmark report looks scary, but it doesn't match my test in #2730 (comment). I guess it's because codspeed doesn't count the I/O time (via pd.read_csv).
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Ping @GenericMappingTools/pygmt-maintainers for review on this PR. There are so many pending changes/PRs that rely on the changes in this PR.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Super big thank you for pushing this through @seisman, especially in cherry-picking many of the changes into separate PRs to make this easier to review! I'm still a little unsure about the triple-nested classes as mentioned at #2729 (comment), but we can always un-nest them later if needed (since they're marked as private classes).
Won't hold this PR up any longer, excited to have PyGMT not store intermediate CSV files in the next release 🚀
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
weiji14
weiji14 approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|