Skip to content

Improve error reports for invalid config.yml file. #629

Open
@davidbaines

Description

@davidbaines

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions