materialsvirtuallab/monty

[Feature Request]: yaml serialization in dumpfn/loadfn for non-standard classes and types

kirill-push opened this issue · 0 comments

Problem

Hi! dumpfn/loadfn functions work excellent with any class and type when it comes to json. But your part with yaml has no additional processing (like json part) and with some deviations from standard types and classes, dumpfn/loadfn give an error.
For example, I tried to save an element of class Solution (link to repo) in yaml, but unlike json, which did it perfect and only in one line of code, it doesn't work that way here.

Proposed Solution

The only thing that helped me with class Solution was writing custom representators and constructors.
Hence the question - is it possible to fit universal representators and constructors for yaml files into your functions?
I understand that it's easier to say than to do, and I don't have any ideas now how to implement it, but maybe you will succeed

Alternatives

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct