malariagen / malariagen-data-python

Analyse MalariaGEN data from Python
https://malariagen.github.io/malariagen-data-python/latest/
MIT License
13 stars 23 forks source link

Migrate to pydantic validate_call() for public API parameter type validation #484

Open alimanfoo opened 8 months ago

alimanfoo commented 8 months ago

Pydantic v2 has the validate_call() decorator which provides support for validating types of input parameters, we could use this instead of the home-grown check_types() decorator.

While we're at it, we could also make use of pydantic's Field to express some additional constraints on parameters, e.g., numeric constraints.