Skip to content

Instantly share code, notes, and snippets.

@sanbales
Last active October 22, 2024 15:32
Show Gist options
  • Save sanbales/07206a7a7b88fa0bda8df524fd364895 to your computer and use it in GitHub Desktop.
Save sanbales/07206a7a7b88fa0bda8df524fd364895 to your computer and use it in GitHub Desktop.
Integrating Pint into Pydantic
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mattwthompson
Copy link

Hey @sanbales I have something similar to this that I'm working on upgrading to v2 - any chance you've done something similar? My setup unfortunately has quite a bit more stuff going on so bump-pydantic didn't work, don't know if you've tried it on this code.

https://github.com/pydantic/bump-pydantic

@sanbales
Copy link
Author

sanbales commented Apr 8, 2024

Hey @sanbales I have something similar to this that I'm working on upgrading to v2 - any chance you've done something similar? My setup unfortunately has quite a bit more stuff going on so bump-pydantic didn't work, don't know if you've tried it on this code.

https://github.com/pydantic/bump-pydantic

@mattwthompson thanks for reaching out, I have not looked at upgrading to pydantic=2 but now that I saw your message I'll give it a try as soon as I get a chance (probably not for another 2 weeks)

@mattwthompson
Copy link

Thanks, no pressure at all from my end - just wanted to see if anybody else had done the work previously

Last week I got a version of the changes I need to be mostly working. It's a little bit more involved than here because of some funky stuff we were doing with v1. In case it's useful for your purposes, here's the big, messy diff: https://github.com/openforcefield/openff-models/pull/42/files

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