[Code scan] Reject parser root/prefix combinations that match no calculations
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
Research direction
Start with dftio/io/parse.py at lines 64-69 and inspect how parser initialization handles root/prefix combinations that produce no raw data. Run python -m compileall -q dftio before and after the change, then verify that an empty discovery raises the specified FileNotFoundError instead of continuing to later processing.
Written by the indexing model from the issue text.
Description
This issue comes from a Codex global repository scan.
Problem
Parser initialization intends to reject empty input discovery, but the assertion is written as a single tuple expression:
assert(len(self.raw_datas) != 0, "...") always asserts a non-empty tuple, so it never fails. Empty parser inputs then proceed and fail later with less useful errors.
python -m compileall -q dftio also reports:
SyntaxWarning: assertion is always true, perhaps remove parentheses?
Suggested fix
Use a real assertion or an explicit exception:
if len(self.raw_datas) == 0:
raise FileNotFoundError("There are no folders that meet the requirements in the directory!")
- Dominant language
- Jupyter Notebook
- Stars
- 16
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/dftio
-
Difficulty 2/5 1-2 days Newbie friendliness 78/100
deepmodeling/dftio#44 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
deepmodeling/dftio#43 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
deepmodeling/dftio#42 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/dftio#41 ·
-
Difficulty 2/5 Half a day Newbie friendliness 75/100
deepmodeling/dftio#40 ·
All issues in deepmodeling/dftio
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100