BergelsonLab / BergelsonLab/blabpy

allow user to ignore missing Seedlings files

Open
#1 0 comments 0 reactions 1 assignee Claimed by @kalenkovich View on GitHub
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Right now, all the `get_xxx(child, month)` functions in `blabpy.seedlings.paths` throw an error when a file is missing. This causes the functions that operate on multiple files to fail a bit too early sometimes: the user will know that a single file is missing while it would be more useful to have a list of all the files that are missing. For example, `blabpy.seedlings.pipeline.merge_all_annotations_with_basic_level` operates on all csv files exported from cha/opf files that it finds in the given folder. For each of them, it finds a corresponding file with basic levels already filled. If such a file is missing, there will be a single FileNotFound exception thrown. Wrapping in try-except is verbous and the actual paths would have to be extracted from the error messages. A better option would be to have an extra argument `ignore_file_not_found` that would default to `False`. To avoid repetition, both adding this argument and checking that the file exists can be relegated to a decorator function.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.