audeering / audb

Manage audio and video databases
https://audeering.github.io/audb/
Other
23 stars 1 forks source link

Column locator sequence input #415

Closed ChristianGeng closed 1 month ago

ChristianGeng commented 1 month ago

Goal

close #407: Typing provided squence type input to Dependencies._column_loc but it wasn't implemented.

Solution

There was a mismatch between the type hints suggesting that it is possible to use sequence input and output. We have chosen to update the type hints as the suggested vectorized implenentation did not provide large benefits.

Therefore this corrects the type hints allowing only scalar in- and putput.

hagenw commented 1 month ago

Thanks for updating the code. Can you also update the description of the pull request, so it's easy to see later on, what was added here.

hagenw commented 1 month ago

BTW, I checked how we avoid calling [deps.bit_depth(file) for file in files] when we want to get the information for all files in audb.info.bit_depth(), and the trick is to just get the column from the dependency table:

https://github.com/audeering/audb/blob/075b27969ffff57699a9faf9773ad14da631fe15/audb/core/info.py#L109

ChristianGeng commented 1 month ago

As stated in #415 (comment) this is ready to merge, but would be nice to first update the description.

I have updated the PR description above. Merging.