maggma icon indicating copy to clipboard operation
maggma copied to clipboard

FEATURE: Upgraded MSONable

Open shyamd opened this issue 4 years ago • 2 comments

MSONable is great but has a couple flaws:

  • support pydantic BaseModel for defining the data model
  • better handling of serializing components
  • Better encapsulation of serialization methods. This is particularly a problem where some classes completely break their as_dict and from_dict.

We should start thinking about a new MSONable defined here and then later if desired moved back into monty.

shyamd avatar Sep 23 '20 22:09 shyamd

Better integration with pandas would be nice too.

I've been enjoying using a dataclass that also subclasses MSONable recently, very powerful. Not sure how pydantic would works with data classes currently.

mkhorton avatar Sep 23 '20 22:09 mkhorton

Someone doing a review of MP-critical classes and if/why they have custom as_dict/from_dicts would be helpful too, I'm not convinced these are necessary in a majority of cases.

mkhorton avatar Sep 23 '20 22:09 mkhorton