Improve error reports for invalid config.yml file.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39
- Forks
- 7
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 5
Description
There are several items in the config.yml file that require an argument.
corpus_pairs requires at least one pair.
corpus_books requires at least one book.
src and trg require at least one (and sometimes exactly one) text. etc.
Currently if I omit any books from the corpus_books line the error is:
''' File "F:\GitHub\silnlp\silnlp\nmt\config.py", line 223, in parse_corpus_pairs
corpus_books = get_chapters(pair.get("corpus_books", []))
File "C:\Users\David\AppData\Local\pypoetry\Cache\virtualenvs\silnlp-X71j0jgb-py3.10\lib\site-packages\machine\scripture\parse.py", line 139, in get_chapters
for selection in selections:
TypeError: 'NoneType' object is not iterable
It would be helpful to have a quick check of the config.yml file and ensure that it is valid so that we can give informative error messages.
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start in silnlp/nmt/config.py around line 223 and trace how config.yml values reach parse_corpus_pairs and machine.scripture.parse.get_chapters. Check how missing corpus_pairs, corpus_books, src, and trg arguments are handled. Done means invalid configurations produce informative validation errors instead of the shown NoneType traceback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100