audeering / audbcards

Data cards for audio datasets
https://audeering.github.io/audbcards/
Other
0 stars 0 forks source link

Improve readability of configuration #80

Open hagenw opened 2 months ago

hagenw commented 2 months ago

At the moment, the configuration is specified in a list of complicated tuples, e.g.

audbcards_datasets = [ 
    (   
        "data-public",
        "data-public",
        audb.Repository(
            name="data-public",
            host="https://audeering.jfrog.io/artifactory",
            backend="artifactory",
        ),
        True,
    ),  
]

This has the disadvantage that it is hard to understand. Usually, I add some comments to mitigate this:

audbcards_datasets = [ 
    (   
        "data-public",  # folder name
        "data-public",  # datasets overview page header
        audb.Repository(
            name="data-public",
            host="https://audeering.jfrog.io/artifactory",
            backend="artifactory",
        ),  # repositories
        True,  # include audio examples?
    ),  
]

Should we maybe switch from a tuple to a dictionary to make it more obvious? Another solution might be to switch to a config file, and provide the path to the config file here in docs/conf.py?

/cc @ChristianGeng

ChristianGeng commented 2 months ago

Yes, I think that this would make sense in order to get it more tidy. As this is configuration, one could even go a step further and separate the audbcards_datasets into a config file.

With regard to the how: not that I have a strong oppinion, but you suggests to leave audbcards_datasets a list, and to transform an individual tuple into a dictionary - as opposed to audbcards_datasets itself becoming a dictionary too.