Closed free-soellingeraj closed 4 years ago
Just a little trick here. Instead of specifying each key for the config, you can just:
config = AudioConfig(**audio_config)
Also python dataclasses can be turned into dict with the method from the dataclass module:
from dataclasses import asdict
asdict(config)
So this isn't really necessary and won't add anything you can't already do but thank you for the suggestion.
Added the
__iter__
functions to the configs.Please review and let me know if I need to go further. I was thinking that I could add a test that checked that the output from the
dict(config)
is correct for the default configuration.The only thing that gave me pause was that it relies on keeping the
SpectrogramConfig
attribute in theAudioConfig
namedsg_cfg
Here's an example of what happens for me:
Let me know