Skip to content

Example for experimental workflows #38

@SteffenBrinckmann

Description

@SteffenBrinckmann

Joerg and Sarath introduced me to the workflow engine. Very nice work and useful. Below are some feedback that you might consider along with my example

  • I find the requirements a little much: if I only install workflows, I don't understand why I need e.g. SQL stuff
  • can the workflow.run parameters become easier
wf.step.inputs.name  = 'sem'              #step 3
wf.step.inputs.param = {'voltage':'30'}
out = wf.run()

could become one line:

out = wf.run( {'step':{name:'sem', 'param':{'voltage':30}}}) 
  • the out is also not beautiful (see below) because I need to return 3 values, ... have to pack them into a list, ...
print('Output filename',out['step__[sample, fileName, metadata]'][1])
  • a draw function that is build on matplotlib as I don't use jupyter but a conventional python script.

Full example (I can supply the Storage and Sample classes on request)

from pathlib import Path
from pyiron_workflow.workflow import Workflow
from experimental_workflows.storage import Storage, step
from experimental_workflows.sample import Sample

wf = Workflow('example_workflow')         #name
folder = Path(__file__).parent.parent/'procedures'
wf.step = step(storage=Storage(folder))   #define step and link to storage for procedures

sample = Sample('FeAl')
wf.step.inputs.sample = sample            #since only use one sample, define only once

wf.step.inputs.name  = 'polish'           #step 1
out = wf.run()

wf.step.inputs.name  = 'light microscopy' #step 2
out = wf.run()
print('Output filename',out['step__[sample, fileName, metadata]'][1])

wf.step.inputs.name  = 'sem'              #step 3
wf.step.inputs.param = {'voltage':'30'}
out = wf.run()
print('Output filename',out['step__[sample, fileName, metadata]'][1])

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions