Skip to content

Commit

Permalink
Fix bug caused by trying to iterate over a DictReader more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandypreiss committed Apr 17, 2024
1 parent 55312a0 commit 6c264ca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion crcsim/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def run(
out.open()

with open(cohort_file, mode="r") as input:
cohort = csv.DictReader(input)
cohort = list(csv.DictReader(input))

# Draw expected lifespans for everyone in the cohort prior to starting
# simulations. This is necessary to ensure that expected lifespans are
Expand Down
1 change: 0 additions & 1 deletion crcsim/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,6 @@ def is_false_positive(self, test: str):
# on_end_year is just a wrapper for update_value - not necessary as far as I can tell

def start_life_timer(self):
self.expected_lifespan = self.compute_lifespan()
self.scheduler.add_event(
message=PersonDiseaseMessage.OTHER_DEATH,
handler=self.handle_disease_message,
Expand Down

0 comments on commit 6c264ca

Please sign in to comment.