Skip to content

About

Python Workflow Definition - workflow interoperability for aiida, jobflow and pyiron

Topics

Resources

Stars

19 stars

Watchers

2 watching

Forks

Repository files navigation

<!DOCTYPE html>


<html lang="en" data-content_root="./" >

  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Python Workflow Definition &#8212; Python Workflow Definition</title>
  
  
  
  <script data-cfasync="false">
    document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
    document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
  </script>
  <!--
    this give us a css class that will be invisible only if js is disabled
  -->
  <noscript>
    <style>
      .pst-js-only { display: none !important; }

    </style>
  </noscript>
  
  <!-- Loaded before other Sphinx assets -->
  <link href="_static/styles/theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=8878045cc6db502f8baf" rel="stylesheet" />

    <link rel="stylesheet" type="text/css" href="_static/pygments.css?v=03e43079" />
    <link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=3c74b3bc" />
    <link rel="stylesheet" type="text/css" href="_static/togglebutton.css?v=13237357" />
    <link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
    <link rel="stylesheet" type="text/css" href="_static/mystnb.11b39860a7a0cbfd473a3ad8a317855267ff0bd372690045ca344a6b62be495e.css" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css?v=4fa983c6" />
    <link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
  
  <!-- So that users can add custom icons -->
  <script src="_static/scripts/fontawesome.js?digest=8878045cc6db502f8baf"></script>
  <!-- Pre-loaded scripts that we'll load fully later -->
  <link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf" />

    <script src="_static/documentation_options.js?v=9eb32ce0"></script>
    <script src="_static/doctools.js?v=9a2dae69"></script>
    <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
    <script src="_static/clipboard.min.js?v=a7894cd8"></script>
    <script src="_static/copybutton.js?v=f281be69"></script>
    <script src="_static/scripts/sphinx-book-theme.js?v=fab101a9"></script>
    <script>let toggleHintShow = 'Click to show';</script>
    <script>let toggleHintHide = 'Click to hide';</script>
    <script>let toggleOpenOnPrint = 'true';</script>
    <script src="_static/togglebutton.js?v=4a39c7ea"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script src="_static/design-tabs.js?v=f930bc37"></script>
    <script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
    <script async="async" src="_static/sphinx-thebe.js?v=c100c467"></script>
    <script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
    <script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
    <script>DOCUMENTATION_OPTIONS.pagename = 'README';</script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Definition" href="intro.html" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="docsearch:language" content="en"/>
  <meta name="docsearch:version" content="" />
  </head>
  
  
  <body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">

  
  
  <div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
  
  <div id="pst-scroll-pixel-helper"></div>
  
  <button type="button" class="btn rounded-pill" id="pst-back-to-top">
    <i class="fa-solid fa-arrow-up"></i>Back to top</button>

  
  <dialog id="pst-search-dialog">
    
<form class="bd-search d-flex align-items-center"
      action="search.html"
      method="get">
  <i class="fa-solid fa-magnifying-glass"></i>
  <input type="search"
         class="form-control"
         name="q"
         placeholder="Search this book..."
         aria-label="Search this book..."
         autocomplete="off"
         autocorrect="off"
         autocapitalize="off"
         spellcheck="false"/>
  <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form>
  </dialog>

  <div class="pst-async-banner-revealer d-none">
  <aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>

  
    <header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
    </header>
  

  <div class="bd-container">
    <div class="bd-container__inner bd-page-width">
      
      
      
        
      
      <dialog id="pst-primary-sidebar-modal"></dialog>
      <div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar">
        

  
  <div class="sidebar-header-items sidebar-primary__section">
    
    
    
    
  </div>
  
    <div class="sidebar-primary-items__start sidebar-primary__section">
        <div class="sidebar-primary-item">

  
    
  

<a class="navbar-brand logo" href="#">
  
  
  
  
  
    
    
      
    
    
    <img src="_static/logo.png" class="logo__image only-light" alt="Python Workflow Definition - Home"/>
    <img src="_static/logo.png" class="logo__image only-dark pst-js-only" alt="Python Workflow Definition - Home"/>
  
  
</a></div>
        <div class="sidebar-primary-item">

<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
 <i class="fa-solid fa-magnifying-glass"></i>
 <span class="search-button__default-text">Search</span>
 <span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button></div>
        <div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
    <div class="bd-toc-item navbar-nav active">
        
        <ul class="nav bd-sidenav bd-sidenav__home-link">
            <li class="toctree-l1 current active">
                <a class="reference internal" href="#">
                    Python Workflow Definition
                </a>
            </li>
        </ul>
        <ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="intro.html">Definition</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="arithmetic.html">Arithmetic Workflow</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/arithmetic/aiida.html">Aiida</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/arithmetic/jobflow.html">jobflow</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/arithmetic/pyiron_base.html">pyiron</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="evcurve.html">Energy Volume Curve</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/quantum_espresso/aiida.html">aiida-workgraph</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/quantum_espresso/jobflow.html">jobflow</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/quantum_espresso/pyiron_base.html">pyiron</a></li>
</ul>
</details></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="nfdi.html">NFDI4Ing Benchmark</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/nfdi/aiida.html">Aiida</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/nfdi/jobflow.html">jobflow</a></li>
<li class="toctree-l2"><a class="reference internal" href="example_workflows/nfdi/pyiron_base.html">pyiron</a></li>
</ul>
</details></li>
<li class="toctree-l1"><a class="reference internal" href="conclusion.html">Conclusion</a></li>
</ul>

    </div>
</nav></div>
    </div>
  
  
  <div class="sidebar-primary-items__end sidebar-primary__section">
      <div class="sidebar-primary-item">
<div id="ethical-ad-placement"
      class="flat"
      data-ea-publisher="readthedocs"
      data-ea-type="readthedocs-sidebar"
      data-ea-manual="true">
</div></div>
  </div>


      </div>
      
      <main id="main-content" class="bd-main" role="main">
        
        

<div class="sbt-scroll-pixel-helper"></div>

          <div class="bd-content">
            <div class="bd-article-container">
              
              <div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
  
    <div class="header-article-items__start">
      
        <div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
  <span class="fa-solid fa-bars"></span>
</button></div>
      
    </div>
  
  
    <div class="header-article-items__end">
      
        <div class="header-article-item">

<div class="article-header-buttons">





<div class="dropdown dropdown-download-buttons">
  <button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
    <i class="fas fa-download"></i>
  </button>
  <ul class="dropdown-menu">
      
      
      
      <li><a href="_sources/README.md" target="_blank"
   class="btn btn-sm btn-download-source-button dropdown-item"
   title="Download source file"
   data-bs-placement="left" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-file"></i>
  </span>
<span class="btn__text-container">.md</span>
</a>
</li>
      
      
      
      
      <li>
<button onclick="window.print()"
  class="btn btn-sm btn-download-pdf-button dropdown-item"
  title="Print to PDF"
  data-bs-placement="left" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-file-pdf"></i>
  </span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
      
  </ul>
</div>




<button onclick="toggleFullScreen()"
  class="btn btn-sm btn-fullscreen-button pst-navbar-icon"
  title="Fullscreen mode"
  data-bs-placement="bottom" data-bs-toggle="tooltip"
>
  

<span class="btn__icon-container">
  <i class="fas fa-expand"></i>
  </span>

</button>



<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button pst-js-only" aria-label="Color mode" data-bs-title="Color mode"  data-bs-placement="bottom" data-bs-toggle="tooltip">
  <i class="theme-switch fa-solid fa-sun                fa-lg" data-mode="light" title="Light"></i>
  <i class="theme-switch fa-solid fa-moon               fa-lg" data-mode="dark"  title="Dark"></i>
  <i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"  title="System Settings"></i>
</button>


<button class="btn btn-sm pst-navbar-icon search-button search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
<button class="sidebar-toggle secondary-toggle btn btn-sm pst-navbar-icon" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
    <span class="fa-solid fa-list"></span>
</button>
</div></div>
      
    </div>
  
</div>
</div>
              
              

<div id="jb-print-docs-body" class="onlyprint">
    <h1>Python Workflow Definition</h1>
    <!-- Table of contents -->
    <div id="print-main-content">
        <div id="jb-print-toc">
            
            <div>
                <h2> Contents </h2>
            </div>
            <nav aria-label="Page">
                <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#definition">Definition</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#format">Format</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installation">Installation</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#examples">Examples</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#simple-example">Simple Example</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#quantum-espresso-workflow">Quantum Espresso Workflow</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#nfdi4ing-scientific-workflow-requirements">NFDI4Ing Scientific Workflow Requirements</a></li>
</ul>
</li>
</ul>
            </nav>
        </div>
    </div>
</div>

              
                
<div id="searchbox"></div>
                <article class="bd-article">
                  
  <section class="tex2jax_ignore mathjax_ignore" id="python-workflow-definition">
<h1>Python Workflow Definition<a class="headerlink" href="#python-workflow-definition" title="Link to this heading">#</a></h1>
<p><a class="reference external" href="https://github.com/pythonworkflow/python-workflow-definition/actions/workflows/pipeline.yml"><img alt="Pipeline" src="https://github.com/pythonworkflow/python-workflow-definition/actions/workflows/pipeline.yml/badge.svg" /></a>
<a class="reference external" href="https://codecov.io/github/pythonworkflow/python-workflow-definition"><img alt="codecov" src="https://codecov.io/github/pythonworkflow/python-workflow-definition/graph/badge.svg?token=3JXD1GN8LG" /></a>
<a class="reference external" href="https://mybinder.org/v2/gh/pythonworkflow/python-workflow-definition/HEAD"><img alt="Binder" src="https://mybinder.org/badge_logo.svg" /></a>
<a class="reference external" href="https://doi.org/10.5281/zenodo.15516179"><img alt="DOI" src="https://zenodo.org/badge/945869529.svg" /></a></p>
<section id="definition">
<h2>Definition<a class="headerlink" href="#definition" title="Link to this heading">#</a></h2>
<p>In the Python Workflow Definition (PWD) each node represents a Python function, with the edges defining the connection
between input and output of the different Python functions.</p>
<p>Published in: <a class="reference external" href="https://doi.org/10.1039/D5DD00231A">J. Janssen, J. George, J. Geiger, M. Bercx, X. Wang, C. Ertural, J. Schaarschmidt, A.M. Ganose, G. Pizzi, T. Hickel and J. Neugebauer. A python workflow definition for computational materials design. Digital Discovery, 2025</a></p>
</section>
<section id="format">
<h2>Format<a class="headerlink" href="#format" title="Link to this heading">#</a></h2>
<p>Each workflow consists of three files, a Python module which defines the individual Pythons, a JSON file which defines
the connections between the different Python functions and a conda environment file to define the software dependencies.
The files are not intended to be human readable, but rather interact as a machine readable exchange format between the
different workflow engines to enable interoperability.</p>
</section>
<section id="installation">
<h2>Installation<a class="headerlink" href="#installation" title="Link to this heading">#</a></h2>
<p>The Python Workflow Definition can either be installed via pypi or via conda. For the <a class="reference external" href="https://pypi.org/project/python-workflow-definition/">pypi installation</a> use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">pip</span> <span class="n">install</span> <span class="n">python</span><span class="o">-</span><span class="n">workflow</span><span class="o">-</span><span class="n">definition</span>
</pre></div>
</div>
<p>For the conda installation via the <a class="reference external" href="https://anaconda.org/conda-forge/python-workflow-definition">conda-forge community channel</a> use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">conda</span> <span class="n">install</span> <span class="n">conda</span><span class="o">-</span><span class="n">forge</span><span class="p">::</span><span class="n">python</span><span class="o">-</span><span class="n">workflow</span><span class="o">-</span><span class="n">definition</span>
</pre></div>
</div>
</section>
<section id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Link to this heading">#</a></h2>
<section id="simple-example">
<h3>Simple Example<a class="headerlink" href="#simple-example" title="Link to this heading">#</a></h3>
<p>As a first example we define two Python functions which add multiple inputs:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">get_sum</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
    <span class="k">return</span> <span class="n">x</span> <span class="o">+</span> <span class="n">y</span>


<span class="k">def</span><span class="w"> </span><span class="nf">get_prod_and_div</span><span class="p">(</span><span class="n">x</span><span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">y</span><span class="p">:</span> <span class="nb">float</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="nb">dict</span><span class="p">:</span>
    <span class="k">return</span> <span class="p">{</span><span class="s2">"prod"</span><span class="p">:</span> <span class="n">x</span> <span class="o">*</span> <span class="n">y</span><span class="p">,</span> <span class="s2">"div"</span><span class="p">:</span> <span class="n">x</span> <span class="o">/</span> <span class="n">y</span><span class="p">}</span>
</pre></div>
</div>
<p>These two Python functions are combined in the following example workflow:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">def</span><span class="w"> </span><span class="nf">combined_workflow</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
    <span class="n">tmp_dict</span> <span class="o">=</span> <span class="n">get_prod_and_div</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">)</span>
    <span class="k">return</span> <span class="n">get_sum</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">tmp_dict</span><span class="p">[</span><span class="s2">"prod"</span><span class="p">],</span> <span class="n">y</span><span class="o">=</span><span class="n">tmp_dict</span><span class="p">[</span><span class="s2">"div"</span><span class="p">])</span>
</pre></div>
</div>
<p>For the workflow representation of these Python functions the Python functions are stored in the <a class="reference download internal" download="" href="_downloads/d4b6ab1210e71ac0cfa700589f3eda0c/workflow.py"><span class="xref download myst">example_workflows/arithmetic/workflow.py</span></a>
Python module. The connection of the Python functions are stored in the <a class="reference download internal" download="" href="_downloads/b85b54c725e4538522e7eabb629474c5/workflow.json"><span class="xref download myst">example_workflows/arithmetic/workflow.json</span></a>
JSON file:</p>
<div class="highlight-JSON notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="w">  </span><span class="nt">"nodes"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"function"</span><span class="p">,</span><span class="w"> </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"workflow.get_prod_and_div"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"function"</span><span class="p">,</span><span class="w"> </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="s2">"workflow.get_sum"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"x"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"input"</span><span class="p">,</span><span class="w"> </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"y"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w"> </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"output"</span><span class="p">,</span><span class="w"> </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"result"</span><span class="p">}</span>
<span class="w">  </span><span class="p">],</span>
<span class="w">  </span><span class="nt">"edges"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nt">"targetPort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"x"</span><span class="p">,</span><span class="w"> </span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="nt">"sourcePort"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nt">"targetPort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"y"</span><span class="p">,</span><span class="w"> </span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="p">,</span><span class="w"> </span><span class="nt">"sourcePort"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">"targetPort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"x"</span><span class="p">,</span><span class="w"> </span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nt">"sourcePort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"prod"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">"targetPort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"y"</span><span class="p">,</span><span class="w"> </span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="mi">0</span><span class="p">,</span><span class="w"> </span><span class="nt">"sourcePort"</span><span class="p">:</span><span class="w"> </span><span class="s2">"div"</span><span class="p">},</span>
<span class="w">    </span><span class="p">{</span><span class="nt">"target"</span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span><span class="w"> </span><span class="nt">"targetPort"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">,</span><span class="w"> </span><span class="nt">"source"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="nt">"sourcePort"</span><span class="p">:</span><span class="w"> </span><span class="kc">null</span><span class="p">}</span>
<span class="w">  </span><span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The abbreviations in the definition of the edges are:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">target</span></code> - target node</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">targetPort</span></code> - target port - for a node with multiple input parameters the target port specifies which input parameter to use.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">source</span></code> - source node</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">sourcePort</span></code> - source port - for a node with multiple output parameters the source port specifies which output parameter to use.</p></li>
</ul>
<p>As the workflow does not require any additional resources, as it is only using built-in functionality of the Python standard
library.</p>
<p>The corresponding Jupyter notebooks demonstrate this functionality:</p>
<div class="pst-scrollable-table-container"><table class="table">
<thead>
<tr class="row-odd"><th class="head"><p>Example</p></th>
<th class="head"><p>Explanation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/arithmetic/aiida.html"><span class="std std-doc">example_workflows/arithmetic/aiida.ipynb</span></a></p></td>
<td><p>Define Workflow with aiida and execute it with jobflow and pyiron_base.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/arithmetic/jobflow.html"><span class="std std-doc">example_workflows/arithmetic/jobflow.ipynb</span></a></p></td>
<td><p>Define Workflow with jobflow and execute it with aiida and pyiron_base.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/arithmetic/pyiron_base.html"><span class="std std-doc">example_workflows/arithmetic/pyiron_base.ipynb</span></a></p></td>
<td><p>Define Workflow with pyiron_base and execute it with aiida and jobflow.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/arithmetic/universal_workflow.html"><span class="std std-doc">example_workflows/arithmetic/universal_workflow.ipynb</span></a></p></td>
<td><p>Execute workflow defined in the Python Workflow Definition with aiida, executorlib, jobflow, pyiron_base and pure Python.</p></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="quantum-espresso-workflow">
<h3>Quantum Espresso Workflow<a class="headerlink" href="#quantum-espresso-workflow" title="Link to this heading">#</a></h3>
<p>The second workflow example is the calculation of an energy volume curve with Quantum Espresso. In the first step the
initial structure is relaxed, afterward it is strained and the total energy is calculated.</p>
<ul class="simple">
<li><p><a class="reference download internal" download="" href="_downloads/0d09bdc32538ec374fdfcc8b206a84a1/workflow.py"><span class="xref download myst">example_workflows/quantum_espresso/workflow.py</span></a> Python functions</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/074c18a527b229dcf1aceecb3ceb2862/workflow.json"><span class="xref download myst">example_workflows/quantum_espresso/workflow.json</span></a> Workflow definition in the Python Workflow Definition.</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/d87a46985e2e587030c68d49ffa4528b/environment.yml"><span class="xref download myst">example_workflows/quantum_espresso/environment.yml</span></a> Conda environment</p></li>
</ul>
<div class="pst-scrollable-table-container"><table class="table">
<thead>
<tr class="row-odd"><th class="head"><p>Example</p></th>
<th class="head"><p>Explanation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/quantum_espresso/aiida.html"><span class="std std-doc">example_workflows/quantum_espresso/aiida.ipynb</span></a></p></td>
<td><p>Define Workflow with aiida and execute it with jobflow and pyiron_base.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/quantum_espresso/jobflow.html"><span class="std std-doc">example_workflows/quantum_espresso/jobflow.ipynb</span></a></p></td>
<td><p>Define Workflow with jobflow and execute it with aiida and pyiron_base.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/quantum_espresso/pyiron_base.html"><span class="std std-doc">example_workflows/quantum_espresso/pyiron_base.ipynb</span></a></p></td>
<td><p>Define Workflow with pyiron_base and execute it with aiida and jobflow.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/quantum_espresso/universal_workflow.html"><span class="std std-doc">example_workflows/quantum_espresso/universal_workflow.ipynb</span></a></p></td>
<td><p>Execute workflow defined in the Python Workflow Definition with aiida, executorlib, jobflow, pyiron_base and pure Python.</p></td>
</tr>
</tbody>
</table>
</div>
</section>
<section id="nfdi4ing-scientific-workflow-requirements">
<h3>NFDI4Ing Scientific Workflow Requirements<a class="headerlink" href="#nfdi4ing-scientific-workflow-requirements" title="Link to this heading">#</a></h3>
<p>To demonstrate the compatibility of the Python Workflow Definition to file based workflows, the workflow benchmark developed as part of <a class="reference external" href="https://github.com/BAMresearch/NFDI4IngScientificWorkflowRequirements">NFDI4Ing</a>
is implemented for all three simulation codes based on a shared workflow definition.</p>
<ul class="simple">
<li><p><a class="reference download internal" download="" href="_downloads/7849111caddeecc1f84b6e10d30bdd5e/workflow.py"><span class="xref download myst">example_workflows/nfdi/workflow.py</span></a> Python functions</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/4fce43a14fb0221048f87bf1c5f7507a/workflow.json"><span class="xref download myst">example_workflows/nfdi/workflow.json</span></a> Workflow definition in the Python Workflow Definition.</p></li>
</ul>
<p>Additional source files provided with the workflow benchmark:</p>
<ul class="simple">
<li><p><a class="reference download internal" download="" href="_downloads/2b431daa5d8516cd4586feb00ce63187/preprocessing.yaml"><span class="xref download myst">example_workflows/nfdi/source/envs/preprocessing.yaml</span></a> Conda environment for preprocessing</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/b2eedcb0ddeefda5c51d1584979258ad/processing.yaml"><span class="xref download myst">example_workflows/nfdi/source/envs/processing.yaml</span></a> Conda environment for processing</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/cdf93d425e6df529ed97c8b502821274/postprocessing.yaml"><span class="xref download myst">example_workflows/nfdi/source/envs/postprocessing.yaml</span></a> Conda environment for postprocessing</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/f2b741fba3a65a1b1eecdff88867e31c/macros.tex.template"><span class="xref download myst">example_workflows/nfdi/source/macros.tex.template</span></a> LaTeX module template</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/331c5bde05983f9e76ce2cf65cfde073/paper.tex"><span class="xref download myst">example_workflows/nfdi/source/paper.tex</span></a> LaTeX paper template</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/56e68093fdf308cb11075a58fe57fb60/poisson.py"><span class="xref download myst">example_workflows/nfdi/source/poisson.py</span></a> Poisson Python script</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/4437283df7255c07a78686ad14ce4902/postprocessing.py"><span class="xref download myst">example_workflows/nfdi/source/postprocessing.py</span></a> Postprocessing Python script</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/c16ba0969d10490ef2a46641272562b4/prepare_paper_macros.py"><span class="xref download myst">example_workflows/nfdi/source/prepare_paper_macros.py</span></a> LaTeX preprocessing Python script</p></li>
<li><p><a class="reference download internal" download="" href="_downloads/cdcd3d8b8608feb76c8d22665a4ae8ae/unit_square.geo"><span class="xref download myst">example_workflows/nfdi/source/unit_square.geo</span></a> Input structure</p></li>
</ul>
<div class="pst-scrollable-table-container"><table class="table">
<thead>
<tr class="row-odd"><th class="head"><p>Example</p></th>
<th class="head"><p>Explanation</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/nfdi/aiida.html"><span class="std std-doc">example_workflows/nfdi/aiida.ipynb</span></a></p></td>
<td><p>Define Workflow with aiida and execute it with jobflow and pyiron_base.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/nfdi/jobflow.html"><span class="std std-doc">example_workflows/nfdi/jobflow.ipynb</span></a></p></td>
<td><p>Define Workflow with jobflow and execute it with aiida and pyiron_base.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="example_workflows/nfdi/pyiron_base.html"><span class="std std-doc">example_workflows/nfdi/pyiron_base.ipynb</span></a></p></td>
<td><p>Define Workflow with pyiron_base and execute it with aiida and jobflow.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="example_workflows/nfdi/universal_workflow.html"><span class="std std-doc">example_workflows/nfdi/universal_workflow.ipynb</span></a></p></td>
<td><p>Execute workflow defined in the Python Workflow Definition with aiida, executorlib, jobflow, pyiron_base and pure Python.</p></td>
</tr>
</tbody>
</table>
</div>
</section>
</section>
<div class="toctree-wrapper compound">
</div>
</section>

    <script type="text/x-thebe-config">
    {
        requestKernel: true,
        binderOptions: {
            repo: "binder-examples/jupyter-stacks-datascience",
            ref: "master",
        },
        codeMirrorConfig: {
            theme: "abcdef",
            mode: "python"
        },
        kernelOptions: {
            name: "python3",
            path: "./."
        },
        predefinedOutput: true
    }
    </script>
    <script>kernelName = 'python3'</script>

                </article>
              

              
              
              
              
                <footer class="prev-next-footer d-print-none">
                  
<div class="prev-next-area">
    <a class="right-next"
       href="intro.html"
       title="next page">
      <div class="prev-next-info">
        <p class="prev-next-subtitle">next</p>
        <p class="prev-next-title">Definition</p>
      </div>
      <i class="fa-solid fa-angle-right"></i>
    </a>
</div>
                </footer>
              
            </div>
            
            
              
                <dialog id="pst-secondary-sidebar-modal"></dialog>
                <div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">


  <div class="sidebar-secondary-item"><div
    id="pst-page-navigation-heading-2"
    class="page-toc tocsection onthispage">
    <i class="fa-solid fa-list"></i> Contents
  </div>
  <nav id="pst-page-toc-nav" class="page-toc" aria-labelledby="pst-page-navigation-heading-2">
    <ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#definition">Definition</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#format">Format</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#installation">Installation</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#examples">Examples</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#simple-example">Simple Example</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#quantum-espresso-workflow">Quantum Espresso Workflow</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#nfdi4ing-scientific-workflow-requirements">NFDI4Ing Scientific Workflow Requirements</a></li>
</ul>
</li>
</ul>
  </nav></div>

</div></div>
              
            
          </div>
          <footer class="bd-footer-content">
            
<div class="bd-footer-content__inner container">
  
  <div class="footer-item">
    
<p class="component-author">
By Jan Janssen
</p>

  </div>
  
  <div class="footer-item">
    

  <p class="copyright">
    
      © Copyright 2026.
      <br/>
    
  </p>

  </div>
  
  <div class="footer-item">
    
  </div>
  
  <div class="footer-item">
    
  </div>
  
</div>
          </footer>
        

      </main>
    </div>
  </div>
  
  <!-- Scripts loaded after <body> so the DOM is not blocked -->
  <script defer src="_static/scripts/bootstrap.js?digest=8878045cc6db502f8baf"></script>
<script defer src="_static/scripts/pydata-sphinx-theme.js?digest=8878045cc6db502f8baf"></script>

  <footer class="bd-footer">
  </footer>
  </body>
</html>

About

Python Workflow Definition - workflow interoperability for aiida, jobflow and pyiron

Topics

Resources

Stars

19 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages