Skip to content

Commit

Permalink
Autoformat with black
Browse files Browse the repository at this point in the history
  • Loading branch information
brainless-bot[bot] committed Jan 31, 2025
1 parent 5ff97f1 commit b3182c3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions panoptica/panoptica_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def __init__(
if isinstance(output_file, str):
output_file = Path(output_file)
# uses tsv
assert output_file.parent.exists(), f"Directory {str(output_file.parent)} does not exist"
assert (
output_file.parent.exists()
), f"Directory {str(output_file.parent)} does not exist"

out_file_path = str(output_file)

Expand All @@ -85,13 +87,19 @@ def __init__(
# buffer_file = tempfile.NamedTemporaryFile()
# out_buffer_file: Path = Path(out_file_path).parent.joinpath("panoptica_aggregator_tmp.tsv")
# self.tmpfile =
self.__output_buffer_file = tempfile.NamedTemporaryFile(delete=False).name # out_buffer_file
self.__output_buffer_file = tempfile.NamedTemporaryFile(
delete=False
).name # out_buffer_file
# print(self.__output_buffer_file)

Path(out_file_path).parent.mkdir(parents=False, exist_ok=True)
self.__output_file = out_file_path

header = ["subject_name"] + [f"{g}-{m}" for g in self.__class_group_names for m in self.__evaluation_metrics]
header = ["subject_name"] + [
f"{g}-{m}"
for g in self.__class_group_names
for m in self.__evaluation_metrics
]
header_hash = hash("+".join(header))

if not output_file.exists():
Expand All @@ -105,7 +113,9 @@ def __init__(
continue_file = True
else:
# TODO should also hash panoptica_evaluator just to make sure! and then save into header of file
assert header_hash == hash("+".join(header_list)), "Hash of header not the same! You are using a different setup!"
assert header_hash == hash(
"+".join(header_list)
), "Hash of header not the same! You are using a different setup!"

if continue_file:
with inevalfilelock:
Expand Down

0 comments on commit b3182c3

Please sign in to comment.