Skip to content

Commit

Permalink
fix small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jabbawukis committed Jan 2, 2025
1 parent ef31f00 commit 8724694
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/utility/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ def count_increasing_occurrences_in_slices(path_to_files: str) -> dict:
"occurrences_increase": [],
"obj_id": fact["obj_id"],
}
increase = sum(
count["occurrences"]
for count in increasing_occurrences_in_slices[relation_id][entity_id]["occurrences_increase"]
)
try:
total = increasing_occurrences_in_slices[relation_id][entity_id]["occurrences_increase"][-1][
"total"
]
total = total + fact["occurrences"]
except IndexError:
total = fact["occurrences"]
increasing_occurrences_in_slices[relation_id][entity_id]["occurrences_increase"].append(
{"Slice": files.index(file), "occurrences": fact["occurrences"], "total": increase}
{"Slice": files.index(file), "occurrences": fact["occurrences"], "total": total}
)
return increasing_occurrences_in_slices

Expand Down

0 comments on commit 8724694

Please sign in to comment.