Fix parallel notebook#443
Draft
ChristopherMayes wants to merge 5 commits into
Draft
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes two Pydantic warnings that appeared when running Xopt on Python 3.14, and adds the missing
gest-apidependency to the conda environment.Changes
from pydantic.v1.json import custom_pydantic_encoderimport inxopt/pydantic.pywith a small, self-contained encoder. This removes the repeated "Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater" warning while preserving the original encoding behavior._loaded_populationand_toolboxasPrivateAttrinxopt/generators/ga/cnsga.py. These attributes were previously set in__init__without being declared, which caused Pydantic to emitPydanticSerializationUnexpectedValuewarnings during serialization.gest-apitoenvironment.ymlso the dependency is installed with the conda environment.Testing
docs/examples/basic/xopt_parallel.ipynb. The previously affected cells now run cleanly with no warnings.xopt.pydanticno longer raises the Pydantic v1 warning and that the custom encoder correctly serializes NumPy values.