audeering / audobject

Generic Python interface for serializing objects to YAML
https://audeering.github.io/audobject/
Other
1 stars 0 forks source link

Add option to auto install missing packages #35

Closed frankenjoe closed 2 years ago

frankenjoe commented 2 years ago

image

codecov[bot] commented 2 years ago

Codecov Report

Merging #35 (11c3ca7) into master (1e131b3) will not change coverage. The diff coverage is 100.0%.

Impacted Files Coverage Δ
audobject/core/api.py 100.0% <100.0%> (ø)
audobject/core/utils.py 100.0% <100.0%> (ø)
frankenjoe commented 2 years ago

With the new option we only have to use auto_install=True in audonnx.load() and it will automatically install missing packages required by the model.

hagenw commented 2 years ago

Slightly unrelated to this pull request, but maybe we should also add the option to list which packages are needed / would be installed?

frankenjoe commented 2 years ago

Slightly unrelated to this pull request, but maybe we should also add the option to list which packages are needed / would be installed?

You mean a function audobject.dependencies(...) or something like that?

hagenw commented 2 years ago

Slightly unrelated to this pull request, but maybe we should also add the option to list which packages are needed / would be installed?

You mean a function audobject.dependencies(...) or something like that?

Yes, but I'm not completely sure yet where to put it. Something like dependencies() I would as a user more expect inside audonnx. We also have the problem in audobject that we have from_yaml and from_yaml_s. One solution would be to add it as another argument to them, like auto_install='show', but it's also not very nice.

frankenjoe commented 2 years ago

One solution would be to add it as another argument to them, like auto_install='show'

Currently, the user will see the output by pip when packages are installed.

hagenw commented 2 years ago

One solution would be to add it as another argument to them, like auto_install='show'

Currently, the user will see the output by pip when packages are installed.

Yes, but then it might be too late as it might install some package you don't want to have. But maybe I'm also too cautious here, because in reality I most likely will just use auto_install=True anyway ;)

frankenjoe commented 2 years ago

Yes, but then it might be too late as it might install some package you don't want to have. But maybe I'm also too cautious here, because in reality I most likely will just use auto_install=True anyway ;)

Yes, cause if you want to use the model you have to install those packages anyway :)