Skip to content

Commit a7adee2

Browse files
committed
Bump fractal-web v1.19.1 and adapted create_tasks_data.py
1 parent db3244e commit a7adee2

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

fractal-web-reference.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.13.1
1+
v1.19.1

tasks_data_retrieval/create_tasks_data.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _get_task_type(
238238
sources = f.read().splitlines()
239239
sources = [source for source in sources if not (source.startswith("#") or source == "")]
240240

241-
TASK_GROUPS = []
241+
task_groups = []
242242
for source in sources:
243243
t_start = time.perf_counter()
244244
print(f"START processing {source=}")
@@ -274,7 +274,7 @@ def _get_task_type(
274274

275275
TaskGroupReadV2(**task_group)
276276

277-
TASK_GROUPS.append(task_group)
277+
task_groups.append(task_group)
278278

279279
t_end = time.perf_counter()
280280
print(
@@ -285,8 +285,20 @@ def _get_task_type(
285285
)
286286
print()
287287

288+
# grouping results
289+
GROUPED_RESULT = []
290+
291+
for task_group in task_groups:
292+
if any(existing_pkg_name == task_group["pkg_name"] for existing_pkg_name, _ in GROUPED_RESULT):
293+
raise ValueError(f"Duplicate package name found: {task_group['pkg_name']}")
294+
295+
GROUPED_RESULT.append((task_group["pkg_name"], [task_group]))
296+
297+
# sort by package name
298+
GROUPED_RESULT.sort(key=lambda x: x[0].lower())
299+
288300
output_file = Path(__file__).parent / "tasks.json"
289301
with output_file.open("w") as f:
290-
json.dump(TASK_GROUPS, f, indent=2)
302+
json.dump(GROUPED_RESULT, f, indent=2)
291303

292304
DOWNLOAD_FOLDER.rmdir()

0 commit comments

Comments
 (0)