From 5c1b90cb88e2a23541a0ce5280bb8d8978c2b453 Mon Sep 17 00:00:00 2001 From: Andrea Roncoli <115221482+DreRnc@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:50:15 +0100 Subject: [PATCH] Fix: set local context to avoid errors resetting global start method (#92) * Fix: set local context to avoid errors resetting global start method * Fixing trailing whitespace for code checks --- .github/workflows/docs.yaml | 2 +- src/plinder/eval/docking/write_scores.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index b27156df..2644e6ed 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -4,7 +4,7 @@ on: tags: - 'v[0-9]+.[0-9]+.[0-9]+' workflow_dispatch: - + permissions: id-token: write contents: read diff --git a/src/plinder/eval/docking/write_scores.py b/src/plinder/eval/docking/write_scores.py index 3c54d015..74c4d06b 100644 --- a/src/plinder/eval/docking/write_scores.py +++ b/src/plinder/eval/docking/write_scores.py @@ -212,8 +212,8 @@ def score_test_set( ) predictions = predictions[~predictions["exists"]] LOG.info(f"Running evaluation on {predictions.shape[0]} cases") - multiprocessing.set_start_method("spawn") - with multiprocessing.Pool(num_processes) as p: + ctx = multiprocessing.get_context("spawn") + with ctx.Pool(num_processes) as p: p.starmap( write_scores_as_json, [