Skip to content

Commit

Permalink
move some changes from 8/n
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenKephart committed Jan 19, 2024
1 parent 6136249 commit 8d75339
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ def equivalent_to_stored_evaluation(self, other: Optional["AssetConditionEvaluat
)

def discarded_subset(self, condition: "AssetCondition") -> Optional[AssetSubset]:
"""Returns the AssetSubset representing asset partitions that were discarded during this
evaluation. Note that 'discarding' is a deprecated concept that is only used for backwards
compatibility.
"""
not_discard_condition = condition.not_discard_condition
if not not_discard_condition or len(self.child_evaluations) != 3:
return None
Expand All @@ -88,7 +92,8 @@ def get_requested_or_discarded_subset(self, condition: "AssetCondition") -> Asse
discarded_subset = self.discarded_subset(condition)
if discarded_subset is None:
return self.true_subset
return self.true_subset | discarded_subset
else:
return self.true_subset | discarded_subset

def for_child(self, child_condition: "AssetCondition") -> Optional["AssetConditionEvaluation"]:
"""Returns the evaluation of a given child condition by finding the child evaluation that
Expand Down

0 comments on commit 8d75339

Please sign in to comment.