Skip to content

Consider switching attrs -> pydantic #282

@wpbonelli

Description

@wpbonelli

As @mwtoews has suggested we can use JSON schema for the DFN specifications (also forthcoming MF6 NetCDF spec and any other schema-related needs). A big benefit of pydantic is built-in JSON schema support . If we continue using attrs we will have to roll our own schema generation.

I think it would be a pretty clean migration from attrs to plain dataclasses. We don't have much structural validation implemented at the moment, so it should be straightforward to start using pydantic's dataclass support for that. But migrating cattrs to pydantic might be more of a chore since we have built some things around the cattrs.Converter.

This came up in recent discussions with @mjreno in the context of an MF6 NetCDF specification and related tooling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRelated to the in-memory data model/storedfnDFN specification-relatedmetaPlanning, strategy, developer tooling, etcrequirementCore requirement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions