Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add method to get index per split and table type of all tables

Open
#200 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start by reviewing the audformat.Database.index property and the existing table, split_id, and index_type usage shown in the issue. Determine an API that preserves existing property behavior while supporting split and index-type filtering, then verify that the requested combined index can be obtained without breaking compatibility.

Written by the indexing model from the issue text.

Description

enhancement

A user might be interested to get the index for all files or segments included in one split.

To get all segments involved in the a split called test you would need to do the following at the moment:

split = 'test'
type = 'segmented'
tables = [t for t in db.tables if db[t].split_id == split]
tables = [t for t in tables if audformat.index_type(db[t].index) == type]
index = audformat.utils.union([db[t].index for t in tables])

We could make this easier by converting the property audformat.Database.index into a method:

index = db.index(split='test', index_type='segmented')

The only problem is that Database.index is a property and we would break the API if we convert it to a method.
If we don't find a way to achieve this, we should maybe not target it or use another name (e.g. filter_index) for the proposed method.

/cc @phtephanx

Dominant language
Python
Stars
13
Forks
2
Avg merge
1d 3h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from audeering/audformat

All issues in audeering/audformat

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.