Skip to content

Commit

Permalink
fix: add id reset function
Browse files Browse the repository at this point in the history
  • Loading branch information
glichtner committed Dec 10, 2024
1 parent 8b2958e commit f756b47
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions execution_engine/omop/cohort/recommendation.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,19 @@ def get_criterion(self, criterion_unique_name: str) -> Criterion:

raise NotImplementedError()

def reset_state(self) -> None:
"""
Reset the state of the recommendation.
Sets all _id attributes to None in the recommendation and all its population/intervention pairs and criteria.
"""
self._id = None

for pi_pair in self._pi_pairs:
pi_pair._id = None
for criterion in pi_pair.flatten():
criterion._id = None

def dict(self) -> dict:
"""
Get the combination as a dictionary.
Expand Down

0 comments on commit f756b47

Please sign in to comment.