-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MiscTable.type #300
Comments
If you loop over |
Yes, but if you a lot of other stuff in the loop and some should affect tables and misc tables it becomes cumbersome to first loop tables and afterwards loop misc tables. |
Ok, so the idea is that your example above can be simplified to: if table.type != 'misc':
if table.is_filewise:
count += 1 ? |
No, it would simplify to: if table.type == 'filewise':
count += 1 |
Hehe, of course :) So yes, I agree this seems like a useful extensions. |
Ah wait, now I get it. You want to introduce |
I changed the title of this issue to better track what we want to have. It's indeed not completely straightforward as before we always derived the table type from the index, compare the current documentation of My proposal would be the following for
I guess that's more complicated from a consistency/documentation point of view, but would made writing code easier. But I'm also not 100% sure we should add this change. |
Yes, I am not sure if it is a good idea to mix up table type and index type in one field. That's why I intuitively expected that if table.type == 'misc' and table.is_filewise:
count += 1 |
Yes, but So yes, maybe we don't do anything here and propose to use code like if isinstance(table, audformat.Table) and table.is_filewise:
count += 1 |
Then you also have the option if you want to count misc tables using a filewise index as well, e.g. if audformat.is_filewise_index(table.index):
count += 1 |
Agree |
When looping through all tables of a database it might become easier if
MiscTable
would have a few more properties fromTable
.For example, if you would like to gather some metadata in a single loop over all tables, and you would like to store how many filewise tables you have, you would need a check like:
First I thought it would be good to have
is_filewise
is_segmented
and set both to
False
, but I we could then have the following inconsitency:So, I would maybe only thing about adding
type
and setting it to'misc'
?The text was updated successfully, but these errors were encountered: