Skip to content

Add non-modal execution of future objects #1806

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Conversation

jan-janssen
Copy link
Member

Example Workflow:

from pyiron_base import job, Project

@job
def get_sum(x, y):
    return x + y

@job(output_key_lst=["prod", "div"])
def get_prod_and_div(x, y):
    return {"prod": x * y, "div": x / y}

@job
def get_square(x):
    return x ** 2

pr = Project("test")
prod_and_div = get_prod_and_div(x=1, y=2, pyiron_project=pr)
tmp_sum = get_sum(x=prod_and_div.output.prod, y=prod_and_div.output.div, pyiron_project=pr)
result = get_square(x=tmp_sum, pyiron_project=pr)
prod_and_div.server.run_mode.non_modal = True
tmp_sum.server.run_mode.non_modal = True
result.server.run_mode.non_modal = True
future = result.pull()

df = pr.job_table()
for job_name in df[df.status=="submitted"].job.values:
    pr.load(job_name).run()

pr.job_table()

@jan-janssen jan-janssen marked this pull request as draft May 22, 2025 20:54
jan-janssen and others added 3 commits May 22, 2025 23:00
Copy link

codecov bot commented May 22, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 72.46%. Comparing base (7095631) to head (c76ea4e).

Files with missing lines Patch % Lines
pyiron_base/jobs/flex/pythonfunctioncontainer.py 70.58% 10 Missing ⚠️
pyiron_base/project/delayed.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1806      +/-   ##
==========================================
- Coverage   72.48%   72.46%   -0.03%     
==========================================
  Files          80       80              
  Lines       10414    10443      +29     
==========================================
+ Hits         7549     7567      +18     
- Misses       2865     2876      +11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant