Improve error reports for invalid config.yml file. #629
Labels
enhancement
New feature or request
good first issue
Good for newcomers
pipeline 3: preprocess
Issue related to preprocessing.
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.
The text was updated successfully, but these errors were encountered: