Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aiida-workgraph

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aiida-workgraph

Design flexible node-based workflow for AiiDA calculation.

  • 0.4.5
  • Source
  • PyPI
  • Socket score

Maintainers
2

AiiDA-WorkGraph

PyPI version Unit test codecov Docs status

Efficiently design and manage flexible workflows with AiiDA, featuring an interactive GUI, checkpoints, provenance tracking, error-resistant, and remote execution capabilities.

Installation

    pip install aiida-workgraph[widget]

To install the latest version from source, first clone the repository and then install using pip:

git clone https://github.com/aiidateam/aiida-workgraph
cd aiida-workgraph
pip install -e .

To install the jupyter widget support you need to in addition build the JavaScript packages:

pip install .[widget]
# build widget
cd aiida_workgraph/widget/
npm install
npm run build
# build web frontend
cd ../../aiida_workgraph/web/frontend/
npm install
npm run build

Documentation

Explore the comprehensive documentation to discover all the features and capabilities of AiiDA Workgraph.

Demo

Visit the Workgraph Collections repository to see demonstrations of how to utilize AiiDA Workgraph for different computational codes.

Examples

Suppose we want to calculate (x + y) * z in two steps. First, add x and y, then multiply the result with z.

from aiida_workgraph import WorkGraph, task

# define add task
@task.calcfunction
def add(x, y):
    return x + y

# define multiply task
@task.calcfunction
def multiply(x, y):
    return x*y

# Create a workgraph to link the tasks.
wg = WorkGraph("test_add_multiply")
wg.add_task(add, name="add1")
wg.add_task(multiply, name="multiply1")
wg.add_link(wg.tasks["add1"].outputs["result"], wg.tasks["multiply1"].inputs["x"])

Prepare inputs and submit the workflow:

from aiida import load_profile

load_profile()

wg.submit(inputs = {"add1": {"x": 2, "y": 3}, "multiply1": {"y": 4}}, wait=True)
print("Result of multiply1 is", wg.tasks["multiply1"].outputs[0].value)

Start the web app, open a terminal and run:

workgraph web start

Then visit the page http://127.0.0.1:8000/workgraph, you should find a first_workflow WorkGraph, click the pk and view the WorkGraph.

One can also generate the node graph from the process:

verdi node generate pk

Development

Pre-commit and Tests

To contribute to this repository, please enable pre-commit so the code in commits are conform to the standards.

pip install -e .[tests,pre-commit]
pre-commit install

Widget

See the README.md

Web app

See the README.md

License

MIT

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc