Skip to content

Conversation

jlnav
Copy link
Member

@jlnav jlnav commented Sep 6, 2024

Pydantic v2 and v1.10.17 have a pydantic.v1 compatibility namespace/module that we can import everything we need from. This means that we only need a single interface (unfortunately, the old one) to be compatible with both versions.

This is much cleaner, but I wouldn't be surprised if there's a slight performance drawback if the validation in the v1 module only occurs in python instead of rust.

… in favor of those in pydantic.v1, which is a module that is present in both pydantic 2 and 1.10.17\
@codecov
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 77.14%. Comparing base (ee4d4fc) to head (ed9ed21).
Report is 99 commits behind head on develop.

Files with missing lines Patch % Lines
libensemble/utils/validators.py 94.44% 2 Missing and 2 partials ⚠️
libensemble/utils/pydantic_modules.py 50.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (ee4d4fc) and HEAD (ed9ed21). Click for more details.

HEAD has 28 uploads less than BASE
Flag BASE (ee4d4fc) HEAD (ed9ed21)
40 12
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #1424       +/-   ##
============================================
- Coverage    92.75%   77.14%   -15.61%     
============================================
  Files           85       86        +1     
  Lines         7973     7873      -100     
  Branches      1425     1399       -26     
============================================
- Hits          7395     6074     -1321     
- Misses         383     1584     +1201     
- Partials       195      215       +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jlnav
Copy link
Member Author

jlnav commented Sep 6, 2024

TODO: fix docs

@jlnav
Copy link
Member Author

jlnav commented Sep 10, 2024

The docs issue may be related to autodoc_pydantic not supporting the BaseModel in pydantic.v1 ? I opened an issue here to investigate: mansenfranzen/autodoc_pydantic#302

@jlnav jlnav marked this pull request as draft September 11, 2024 13:37
@jlnav
Copy link
Member Author

jlnav commented Sep 17, 2024

This may be blocked until autodoc_pydantic has an update. Thankfully these improvements aren't critical; closing for now.

@jlnav jlnav closed this Sep 17, 2024
@jlnav jlnav deleted the refactor/pydantic_adjusts branch December 4, 2024 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant