-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
POC: Add private function _to_ndarray #3513
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The CI tests pass with Python 3.12 + pandas 2.2 but fail with Python 3.10 + panda 2.0:
There are likely some changes between pandas 2.0 and 2.2 (or in NumPy). Anyway, it means we need to maintain the mapping from |
…mpy array The new function is extracted from `vectors_to_arrays` without any changes.
seisman
changed the title
POC: Add the private/unused _array_dtypes function to test dtype conversions
POC: Add private function _to_ndarray
Nov 1, 2024
seisman
force-pushed
the
array_dtypes
branch
3 times, most recently
from
November 2, 2024 15:05
ad61cc6
to
319880c
Compare
seisman
force-pushed
the
array_dtypes
branch
2 times, most recently
from
November 2, 2024 16:29
d7dc5ff
to
0ef7d52
Compare
seisman
force-pushed
the
array_dtypes
branch
2 times, most recently
from
November 3, 2024 09:32
6358b8c
to
e4807e2
Compare
This was referenced Nov 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of proposed changes
Inspired by the discussions in #3507 (comment), I think it's necessary to understand the string representation of different dtypes and what dtype they are converted to by NumPy. This PR adds a private_array_dtypes
function topygmt/clib/conversion.py
. Please refer to the detailed docstrings for what the function does.I think we should include the function in PyGMT although it's not used anywhere, similar to thearray_to_datetime
function which will no longer be used in PyGMT after #3507. I'm open to comments and more array-like objects should be added for testing.