Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle future resource #710

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyiron_contrib/generic/coscineIo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import io
import warnings

from concurrent.futures import Future
import pyiron_base
from pyiron_base import state, ProjectHDFio
from pyiron_base.interfaces.has_groups import HasGroups
Expand Down Expand Up @@ -220,6 +221,8 @@ def __init__(
self._resource = resource._resource
self._path = resource._path
return
elif isinstance(resource, Future):
self._resource = resource.result(timeout=15)
else:
raise TypeError(f"Unknown resource type {type(resource)}!")

Expand Down