Skip to content
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

JSON-support for daytime and np.arrays #16

Open
Racopokemon opened this issue Nov 21, 2023 · 1 comment
Open

JSON-support for daytime and np.arrays #16

Racopokemon opened this issue Nov 21, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Racopokemon
Copy link
Collaborator

Suggestion from Michael: Extend the json compatibility to daytime objects and np.arrays. Might be easily realized by providing a decoder and functionality to the json converter.
Would this make for a useful addition?

@Racopokemon Racopokemon self-assigned this Nov 21, 2023
@d-krupke d-krupke added the enhancement New feature or request label Nov 21, 2023
@d-krupke
Copy link
Owner

Has my support. You may need to add an artificial entry with {"__type__": "Array"} or something similar for reading the data. Otherwise, you could of course just make a somehow easily readable type out of it. Currently, everything not in the right format will be converted to str.

I would recommend to implement this as a plugin in system, either with a register(type, DeEndcoder) or @encoder decorator. Do not just to a simple switch-case. This would also allow custom extensions.
Custom extensions could also automatically be stored in a Python-file in the benchmark folder. E.g., allow the folder to contain a magic file that will be loaded when the benchmark is loaded and potentially registers the extensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants