Skip to content

Labtech inconsistently hangs on Windows when using "spawn" backend via notebook #45

@nathanjmcdougall

Description

@nathanjmcdougall

I've tried using an if __name__ == "__main__": block.

It starts the tqdm progress bar and displays no errors, but just hangs:

Image

"thread" works fine.

The frustrating thing is that it's consistent. I haven't yet managed to reproduce it consistently. This sometimes fails (on both my and a colleague's machine):

import labtech


@labtech.task
class ExampleTask:
    """Task to calculate fragility for a given PGA value."""

    x: float

    def run(self) -> float:
        """Calculate fragility for the given parameters."""
        return 0


tasks = [ExampleTask(x=0.2)]

# Run the tasks in parallel
if __name__ == "__main__":
    results = labtech.Lab(storage=None, runner_backend="spawn").run_tasks(tasks)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions