You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There has been a fair bit of discussion in issues ( #216 ), ( #156 ), and ( #244 ) about trying to store data that does not strictly have a JSON equivalent. There's a pretty good listing of interesting types in this comment specifically. Wanted to try to address this discussion at a higher level than specific failure modes observed.
Namely how do want to represent this non-JSON serializable data. Some suggestions are listed below. Others are certainly welcome.
Dump the data into strings with a label indicating extraction type
Store the metadata in Arrays and link them
Allow the use of codecs on these values (e.g. users specify how to make it JSON friendly)
Learn from and/or use other OSS libraries in this space (e.g. jsonpickle, json-tricks, etc.)
Thoughts?
Side Note: Raised issue ( numpy/numpy#12481 ) with NumPy to ask for a (blessed) way to export/import NumPy arrays to/from JSON as that seems to be at the core of this issue. It may not be solved before we address this issue ourselves, but hopefully getting involved in that discussion early will shape what we end up with and make it easier to migrate to anything NumPy may offer in the future.
The text was updated successfully, but these errors were encountered:
Thanks @jakirkham. FWIW it might be worth breaking down all the different use cases as it may be that different solutions are required. Here's the ones I'm aware of:
IIUC issue ( #156 ) was discussing storing NumPy scalars as attributes as opposed to dtype objects themselves. Is that your understanding as well or did I miss something?
As to the other use cases, they seem to always have been about storing NumPy values in JSON of various types. Whether these be NumPy scalars or perhaps NumPy arrays. Also whether they were in fill values or attributes. So that's probably the best set of cases for us to address first.
There has been a fair bit of discussion in issues ( #216 ), ( #156 ), and ( #244 ) about trying to store data that does not strictly have a JSON equivalent. There's a pretty good listing of interesting types in this comment specifically. Wanted to try to address this discussion at a higher level than specific failure modes observed.
Namely how do want to represent this non-JSON serializable data. Some suggestions are listed below. Others are certainly welcome.
Array
s and link themThoughts?
Side Note: Raised issue ( numpy/numpy#12481 ) with NumPy to ask for a (blessed) way to export/import NumPy arrays to/from JSON as that seems to be at the core of this issue. It may not be solved before we address this issue ourselves, but hopefully getting involved in that discussion early will shape what we end up with and make it easier to migrate to anything NumPy may offer in the future.
The text was updated successfully, but these errors were encountered: