audeering / audbcards

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

Add file argument to audbcards.Datacard.save() #67

Closed hagenw closed 7 months ago

hagenw commented 7 months ago

This adds the file argument to audbcards.Datacard.save() to provide the user with more choice how to store a datacard.

image

It also allows us to move all the stdout print messages when running the sphinx extension to audbcards/sphinx/__init__.py.

It also changes the stdout from

Parse air-1.4.2... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/air.rst                                                                
done                                       
Parse cough-speech-sneeze-2.0.1... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/cough-speech-sneeze.rst
done                                                                                                                                                                          
Parse crema-d-1.2.0... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/crema-d.rst
done                                                                                   
Parse emodb-1.4.1... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/emodb.rst                                                            
done                                                                                                                                                                          
Parse micirp-1.0.0... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/micirp.rst                                                          
done                                                                                                                                                                          
Parse musan-1.0.0... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/musan.rst
done                                                                                   
Parse vadtoolkit-1.1.0... ... wrote /home/hwierstorf@audeering.local/git/audeering/audbcards/docs/data-public/vadtoolkit.rst                                                  
done   

to

Parse air-1.4.2... wrote docs/data-public/air.rst
Parse cough-speech-sneeze-2.0.1... wrote docs/data-public/cough-speech-sneeze.rst
Parse crema-d-1.2.0... wrote docs/data-public/crema-d.rst                         
Parse emodb-1.4.1... wrote docs/data-public/emodb.rst
Parse micirp-1.0.0... wrote docs/data-public/micirp.rst
Parse musan-1.0.0... wrote docs/data-public/musan.rst              
Parse vadtoolkit-1.1.0... wrote docs/data-public/vadtoolkit.rst
hagenw commented 7 months ago

There is a slight downside of moving the print statement to audbcards/sphinx/__init__.py as we then no longer have a single value of truth for the name under which the file is stored. One way around might be that we add a return value to audbcards.Datacard.save(), but I'm not sure if this is really necessary.

hagenw commented 7 months ago

Another solution might be, to add a file argument to audbcards.Datacard.save(). Then we can define the filename directly inside audbcards/sphinx/__init__.py as single source of truth, and also a user of the API would have the opportunity to store the RST at a custom path.

hagenw commented 7 months ago

I updated the code and the title and description of this pull request by adding a file argument to audbcards.Datacard.save().

ChristianGeng commented 7 months ago

I updated the code and the title and description of this pull request by adding a file argument to audbcards.Datacard.save().

Looks good. For me this is ready to be merged.