pygmt.grd2xyz: Improve performance by storing output in virtual files#3097
pygmt.grd2xyz: Improve performance by storing output in virtual files#3097
Conversation
…et rid of temporary output files
CodSpeed Performance ReportMerging #3097 will degrade performances by 81.76%Falling back to comparing Summary
Benchmarks breakdown
|
| assert list(xyz_df.columns) == ["lon", "lat", "z"] | ||
|
|
||
|
|
||
| def test_grd2xyz_file_output(grid): |
There was a problem hiding this comment.
The four tests are not directly related to grd2xyz. test_grd2xyz_file_output is already covered by the doctest of the Session.virtualfile_out method. The other three tests will be covered by doctests in PR #3098.
Run the test locally: In the main branch: In this branch: So, for this small test, the new version is much slower, as suggested by the CodeSpeed benchmark report. For a larger grid data: In the main branch: In this branch: It's clear that for large output dataset, the new version is faster. |
Changes in this PR:
grd2xyzfunction using thevirtualfile_out/virtualfile_to_datasetmethods (address Consistent table-like output for PyGMT functions/methods #1318 and Get rid of temporary files from pygmt functions and plotting methods #2730)output_type/outfileparameters and return valuegrd2xyz(see pygmt.grd2xyz: Improve performance by storing output in virtual files #3097 (comment)).test_grd2xyzandtest_grd2xyz_formattests into a single onePreview: https://pygmt-dev--3097.org.readthedocs.build/en/3097/api/generated/pygmt.grd2xyz.html#pygmt.grd2xyz