pyiron / pyiron/flowrep

Parser errors should be easier to track down

Open
#320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

You get basically no feedback right now where in the parsing process things went wrong, just what nature of node you're looking for. This is helpful, e.g. I can learn that I'm looking for an erroneous call. Even better would be to see the actual offending code.

One place I ran into this is here:

https://github.com/pyiron/flowrep/blob/5a55ab62d8a42d005a2df94bbb813d4511010dda/src/flowrep/parsers/parser_helpers.py#L165-L169

Where you can get a big leg up just adding {ast.unparse(node)} to the error message.

I don't know where else it crops up, but I imagine the ast.unparse trick will do what I'm hoping for in all cases.

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 with src/flowrep/parsers/parser_helpers.py around lines 165-169, where the issue identifies a parser error with insufficient context. Trace nearby parsing paths to find whether similar errors omit the offending code, then verify that the resulting messages identify both the expected node type and the relevant source expression.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.