pygmt
pygmt copied to clipboard
pyarrow: Check compatibility of pyarrow.array and pyarrow.table with numeric and timestamp types
Description of proposed changes
Check that pyarrow.array
and pyarrow.table
objects of various types (uint/int/timestamp) can be passed to PyGMT modules/functions.
TODO:
- [x] Initial compatibility check of
pyarrow.array
by adding parametrized tests topygmt.info
- [x] Add
pyarrow.table
to unit tests that already have the@pytest.mark.parametrize("array_func", ...)
- [ ] Document that
pyarrow.array
objects can be used in place ofnumpy.array
- [x] Allow
solar
's terminator_datetime parameter to accept apyarrow.TimestampScalar
input - [ ] etc
Addresses https://github.com/GenericMappingTools/pygmt/issues/2800#issuecomment-1844400954, part of #2800.
Reminders
- [ ] Run
make format
andmake 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 commands are:
-
/format
: automatically format and lint the code -
/test-gmt-dev
: run full tests on the latest GMT development version
/format
CodSpeed Performance Report
Merging #2864 will degrade performances by 6.62%
:warning: No base runs were found
Falling back to comparing pyarrow/array-compat
(8bf81ff) with main
(21a8722)
Summary
❌ 1
regressions
✅ 56
untouched benchmarks
🆕 8
new benchmarks
⁉️ 7
dropped benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
Benchmark | main |
pyarrow/array-compat |
Change | |
---|---|---|---|---|
❌ | test_grdsample_dataarray_out |
105.6 ms | 113.1 ms | -6.62% |
🆕 | test_project_input_table_matrix[array] |
N/A | 40.5 ms | N/A |
🆕 | test_solar_set_terminator_datetime[Timestamp] |
N/A | 139.9 ms | N/A |
🆕 | test_solar_set_terminator_datetime[fromisoformat] |
N/A | 139.8 ms | N/A |
🆕 | test_project_input_table_matrix[DataFrame] |
N/A | 41.8 ms | N/A |
🆕 | test_solar_set_terminator_datetime[str] |
N/A | 139.7 ms | N/A |
🆕 | test_project_input_table_matrix[Dataset] |
N/A | 51 ms | N/A |
🆕 | test_xyz2grd_input_table_matrix[Dataset] |
N/A | 245.9 ms | N/A |
🆕 | test_xyz2grd_input_table_matrix[array] |
N/A | 249 ms | N/A |
⁉️ | test_project_input_matrix[array] |
40.4 ms | N/A | N/A |
⁉️ | test_project_input_matrix[Dataset] |
50.9 ms | N/A | N/A |
⁉️ | test_project_input_matrix[DataFrame] |
41.7 ms | N/A | N/A |
⁉️ | test_solar_set_terminator_datetime[terminator_datetime_string] |
139.5 ms | N/A | N/A |
⁉️ | test_solar_set_terminator_datetime[terminator_datetime1] |
135.7 ms | N/A | N/A |
⁉️ | test_xyz2grd_input_array[array] |
248.9 ms | N/A | N/A |
⁉️ | test_xyz2grd_input_array[Dataset] |
245.7 ms | N/A | N/A |