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
Refactor/ support both Pydantic 1 and 2 #1135
Conversation
…dict. lock to >= current pydantic
…ut issues with "del"ing attributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work well with Pydantic 2. Are you going to support 1 and 2 through a import test? How much effort is it?
… on detected pydantic version. Other model ops are performed based on pydantic version
…ction for dumping specs based on pydantic version
…ins validators for both pydantic versions. pydantic_bindings.py binds validators and other configs to their corresponding classes. only one specs_checkers, utility functions to get/set attributes of pydantic objects
… retain field defaults and aliases
…etting validator attributes directly didn't work since they didn't get bound to fields. various other cross-version fixes and improvements
…ts erroring and displaying multiple?
…ed soon? debugging strings
A thought I just had was maybe we keep this current implementation through v1, then maybe if we ever do a libE 2.0, we drop pydantic 1 support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup.py "docs" lists "autodoc_pydantic<2",
Should this be changed?
Yeah it should. Thanks! |
@@ -60,6 +61,7 @@ | |||
# from libensemble import logger | |||
# logger.set_level("DEBUG") # For testing the test | |||
|
|||
warnings.filterwarnings("ignore", category=UserWarning) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What warning do we get here?
Addresses #1132