Open Racopokemon opened 10 months ago
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.
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?