ModECI / modelspec

Functionality for specifying models & enabling automatic serialization - will be used by MDF & NeuroMLlite
https://modeci.github.io/modelspec/
Apache License 2.0
3 stars 9 forks source link

Check overlap with pydantic #23

Open pgleeson opened 1 year ago

pgleeson commented 1 year ago

What's done here that modelspec doesn't currently do? https://github.com/pydantic/pydantic

davidt0x commented 1 year ago

I took a look at pydantic when I did the conversion to attrs/cattrs. This article gives some of the reasoning behind why I decided against using it. Overall though, both libraries implement similar functionality. The main difference between modelspec and these libraries is the non-conventional way we are representing lists of objects that have ids as dicts in JSON. Most of the code that I wrote for modelspec handles overriding default JSON serialization and deserialization of a list of objects with ids so that that ids are not serialized with other attributes in the object but instead as keys in a dictionary that contains the underlying object.