-
Notifications
You must be signed in to change notification settings - Fork 13
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
Implement Parameter
s as Pydantic BaseModel
s and improve exploration diagnostics
#120
Conversation
This file contains 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
for more information, see https://pre-commit.ci
ax3l
approved these changes
Oct 13, 2023
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.
This is very cool, thank you! 🎉
Do you want to add a bit of docs on the JSON file to the manual to finalize?
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
This PR implements a solution to the lack of parameter metadata in the history file. As proposed by @ax3l a couple of months ago, this solution is based on taking advantage of Pydantic's
BaseModel
to be able to serialize and save the exploration parameters to a JSON file. In this way, we can later recover these parameters and all their attributes for analyzing the output of an exploration.Main changes
All
Parameter
s (i.e., varying parameters, objectives, analyzed parameters, etc.) are now PydanticBaseModel
s. This allows for a few nice things:dtype
of the parameters.libE
history file about which parameters were inputs, objectives, etc. The complete information of these parameters is now contained in the JSON file.A new
ExplorationDiagnostics
class has been implemented that allows for easily analyzing the output of an optimasExploration
. This class takes care of reading and processing the history file as well as the JSON file so that the user does not need to interact with them directly. TheExplorationDiagnostics
replaces the oldPostProcOptimization
class, which was by now outdated (it was the last remnant oflibE_opt
).Added new section to documentation with example usage of
ExplorationDiagnostics
. This requires installingmpi4py
, for which the RTD environment had to be changed tomamba
.Notes
develop
branch oflibEnsemble
untilv1.2
is released (Refactor/ support both Pydantic 1 and 2 Libensemble/libensemble#1135).Example use of
ExplorationDiagnostics
Since all information about the history and the parameters is included in the diagnostics, we can now use it for fully automated post-processing, for example: