Skip to content

Commit

Permalink
deduplicate image_list_removals
Browse files Browse the repository at this point in the history
  • Loading branch information
ychiucco committed Jan 15, 2025
1 parent ca2aba1 commit ef05293
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions fractal_server/app/runner/v2/merge_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def merge_outputs(task_outputs: list[TaskOutput]) -> TaskOutput:
)

final_image_list_updates = deduplicate_list(final_image_list_updates)
final_image_list_removals = list(set(final_image_list_removals))

final_output = TaskOutput(
image_list_updates=final_image_list_updates,
Expand Down
9 changes: 5 additions & 4 deletions tests/v2/04_runner/test_unit_aux_functions_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,17 @@ def test_merge_outputs():
SingleImageTaskOutput(zarr_url="/c"),
SingleImageTaskOutput(zarr_url="/a"),
],
image_list_removals=["/x", "/y", "/z"],
image_list_removals=["/x", "/w", "/z"],
),
]
merged = merge_outputs(task_outputs)
assert merged.image_list_updates == [
for output in (
SingleImageTaskOutput(zarr_url="/a"),
SingleImageTaskOutput(zarr_url="/b"),
SingleImageTaskOutput(zarr_url="/c"),
]
assert merged.image_list_removals == ["/x", "/y", "/z", "/x", "/y", "/z"]
):
assert output in merged.image_list_updates
assert set(merged.image_list_removals) == set(["/x", "/y", "/z", "/w"])


def test_update_legacy_filters():
Expand Down

0 comments on commit ef05293

Please sign in to comment.