raymondxyy / pyaudlib

A speech signal processing library in Python with emphasis on deep learning.
MIT License
31 stars 6 forks source link

Refactor cfg structure #16

Closed andrewwuan closed 4 years ago

andrewwuan commented 5 years ago

Refactoring our configuration structure. Currently we have a cfg/ folder that sits in parallel with audlib/. We won't be able to package the folder like this because everything needs to be under audlib/ to be released. We have several options:

Please let me know which of the cfg refactor method you think is the best.

raymondxyy commented 5 years ago

audlib.cfg definitely needs a revamp. @andrewwuan can you elaborate on your second suggestion? Did you mean having audlib.sig.cfg, audlib.nn.cfg, etc. and having a common interface to control each of them?

andrewwuan commented 5 years ago

Actually, I meant instead of having external configurations, we pass these configurations as parameters while instantiating class instances or calling methods. For example, in function asnr (https://github.com/raymondxyy/pyaudlib/blob/master/audlib/enhance.py#L146) we read _asnr_alpha from cfg. Can we pass it as a parameter to asnr function instead? Or, can we make the file a class, and pass _asnr_alpha as a class instantiation parameter? This way, we don't need an external configuration and everything will be self-contained.

raymondxyy commented 5 years ago

I see what the problem is. I wanted to have a number of utilities in bin/ where users call them using unix-like syntax. The utilities call functions from audlib to accomplish what users ask for. @andrewwuan what's' the best way to do this without leaving the bin/ and cfg/ out? Would simply moving them inside audlib/ work?

raymondxyy commented 4 years ago

We removed cfg/ and cfgaudlib completely in the latest version.