-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DataArray to_dict() without converting with numpy tolist() #1599
Comments
We could add a keyword argument to control this, e.g., |
Yeah, my thoughts exactly. I am almost done with this in my fork... numpy might be confusing for those who will see the module name when they look at it. How does a kwarg:
sound? |
I'll let others chime in on the API design here but yes that sounds pretty reasonable, too. |
Could have a callable |
@chrisbarber Maybe a method to_byte_dict that (in implementation) takes the output from numpy=True and walks the dict with tobytes? |
@nicain, for sure. Probably best for the API's sake to stick to the simplicity of a flag. |
Here is my example implementation: https://github.com/nicain/xarray/blob/fa86e3d38ebf4e641cafd963a5b69a77539b931d/xarray/core/dataarray.py#L1388 @shoyer Can you point me to where to edit documentation and unit test best practices? |
We need to write a contributing guide! But in brief:
See also: https://github.com/pydata/xarray/pull/1485/files |
Sweet, this is exactly what I am used to! Ill give a shot to writing a few tests later today, and make a PR. Can you suggest some core devs I can ping for a PR review? Ill ask @chrisbarber (we work together) to review, but I'd like more eyeballs on it. |
@nicain myself, @jhamman and/or @MaximilianR are good choices for reviewers, thanks! |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the |
I'd be interested in reviving this, this is exactly what I want to achieve. It's not clear if there was some reason this never went ahead. I looked around but didnt find anything. LMK if it there's some reason not to pursue it. THanks |
@jmccreight - I don't think there is any specific reason this didn't get done. Still open to contributions here if you are interested. |
The PR #7739 is available for review. @jhamman @dcherian would be my choices. i think this is pretty straight forward. I suppose the name of the kwarg being |
Perhaps we should have Then the user could do |
Enhancement:
Following #432 and #917, I need to convert my DataArray to a dictionary, but do not need to fully-jsonize the data. In fact, I would much prefer to get the data without using "decode_numpy_dict_values" to convert numpy to lists using tolist.
Is this feature requested elsewhere, or was it intentionally not considered as a use-case? If not, happy to contribute code.
The text was updated successfully, but these errors were encountered: