Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of pydantic for PyData prototype? #28

Open
hammer opened this issue May 2, 2020 · 3 comments
Open

Use of pydantic for PyData prototype? #28

hammer opened this issue May 2, 2020 · 3 comments

Comments

@hammer
Copy link

hammer commented May 2, 2020

Hey @eric-czech do you think pydantic would be useful for our IO and configuration approach?

@eric-czech
Copy link
Collaborator

That looks great, good find! I was playing around with it and found a few reasonable ways to attach documentation for more interactive configuration.

I've been wondering what the closest python equivalent to pureconfig is (which I loved) -- looks like that's pretty close.

@hammer
Copy link
Author

hammer commented May 3, 2020

Nice! What do you think about using it for providing schema-specific diagnostics for failed IO? I did not look closely at it but that use case is the one that jumped out at me given how often bioinformatics scripts fail on badly formatted inputs.

@eric-czech
Copy link
Collaborator

Hm maybe? Some thoughts:

  • It could make sense for VCF variant and INFO fields if we wanted to assert some things like:
    • Can't set variant id as "."
    • AF must be in INFO
    • ALT alleles must be bi-allelic
  • I could see it being useful for genomic feature tables since formats for those vary much more and picking a target schema for us or a user to hit would be helpful
  • Importing sample info could be another use case though I bet most users would rather import directly to arrays/dataframes (to attach to our xr.Datasets) than use some single record factory method

If it doesn't JIT compile, then it's probably a nonstarter for IO though. My guess is that it won't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants