audeering / audb

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

Header as returned by audb.info.header() fails for __eq__() #391

Open hagenw opened 2 months ago

hagenw commented 2 months ago

When loading the header in an empty cache, and check if the object is equal to another header object (in this case the same)

import audb

header = audb.info.header("emodb", version="1.4.1", cache_root="./cache")
header == header

it fails with

...
RuntimeError: No file found for table with path '.../emodb/1.4.1/db.emotion.{pkl|csv}'

The reason is that the header is a audformat.Database object, but not all parts of the database are loaded, so we cannot call __eq__(). As a workaround we can do:

str(header) == str(header)