pyiron / pyiron/flowrep

QoL: if parser should accept known symbols for its case

Open
#267 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
3
Forks
0
Avg merge
1h 19m
Merged PRs (30d)
5

Description

Like

import flowrep as fr

def identity(x):
    return x

@fr.workflow
def macro(x, y, z):
    if x:
        w = identity(y)
    else:
        w = identity(z)
    return w

Currently you need an identity wrapper like if identity(x).

Under the hood, the recipe still expects an operation for the case, and I can tolerate that, I'd be content if it just auto-inserted the identity operation at parsing time so I can write more straightforward python.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the parser used by the @fr.workflow decorator and the handling of if cases. Reproduce the example without the identity wrapper, then trace how the recipe represents the case operation. Done means the parser accepts known symbols directly while preserving the expected operation in the recipe; add or update parser tests if the project has them.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.