vocalpy / crowsetta

A tool to work with any format for annotating vocalizations
https://crowsetta.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
49 stars 3 forks source link

rename `crowsetta.validation._parse_file` -> `validate_extension` #123

Closed NickleDave closed 2 years ago

NickleDave commented 2 years ago

This function is not clearly named and may not be working correctly in all cases: https://github.com/NickleDave/crowsetta/blob/a6ec84fa93762a8ab9b4b063b65a51933e010892/src/crowsetta/validation.py#L67

NickleDave commented 2 years ago

I am renaming this function but I'm not going to bother making it work across all formats because I will probably just factor out what it's doing anyway

The key issue here is that the function has side effects that are not explicit; it converts a list of paths to str, and the functions that currently call it depend on this behavior for other stuff they do, i.e. to iterate over the list and be able to treat each item in it as a str

But if I'm going to represent single annotation files as classes then there won't be any need for this kind of impenetrable special-cased control flow anyway