Use Transformations instead of GufeKeys for StrategyResults#23
Open
ianmkenney wants to merge 1 commit intomainfrom
Open
Use Transformations instead of GufeKeys for StrategyResults#23ianmkenney wants to merge 1 commit intomainfrom
ianmkenney wants to merge 1 commit intomainfrom
Conversation
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.
Related Issues
Fixes #15
Description
This PR changes how Transformations and their weights are represented within a StrategyResult instance. Previously, the
_weightsattribute was a dictionary with GufeKeys as keys and Optional[float] as values. Since we should not assume GufeKeys are stable, we should keep track of Transformations directly instead.However, since Transformations cannot be used as dictionary keys (see OpenFreeEnergy/gufe#714), the mapping needs to be internally represented in a compatible format. Instead of
dict[Transformation | NonTransformation, float | None], we'll instead uselist[list[Transformation | NonTransformation, float | None]].Inputs to
initand outputs ofresolveare still dictionaries, though their keys are nowTransformations, notGufeKeysChanges
Transformation | NonTransformationStrategyResultthat checks types of keys and values of input mapping. Failure to validate raisesStrategyResultValidationError.weightsparameter andresolvereturn are now of typedict[Transformation | NonTransformation, float | None].Checklist