We need to provide multiple installation profiles, so that users of this library can have lighter installation of the project in case they don't need some dependency-heavy features, like classification or the dashboard. Also, a missing dependency should be notified gracefully when using the cli tool, a meaningful message should be printed so the user can know which actions to take to solve it.
Solution
Added "extra" dependencies as installation profles. Added profiles:
classification : to provide classification functionality, includes the following dependencies
transformers
transformers-interpret
torch
datasets
scikit-learn
scikit-multilearn
pandas
tensorflow : to provide tensorflow as a dependency
tensorflow
tensorflow_hub
tensorflow-probability
jupyter : To provide jupyter as a dev tool, which is quite useful
jupyter
ipykernel
ipython
all : Include all the previous versions
Also, as the microscope.Manager object is the main interface for the CLI tool, optional features were included as part of the functions and not the module itself. for example:
Note that imports in python won't run the entire python file twice when they are called more than once, so they are lazy by default.
Relevant files:
pyproject.toml = specified set up for additional dependencies
src/c4v/c4v_cli.py = added try/except statements when a import cannot be satisfied because of an optional dependency not being available.
src/c4v/microscope/manager.py = added local imports of possibly-missing dependencies, so that the entire module won't break when a lighter profile is installed
noxfile.py = added set up to install the complete version when running a test session
Problem
We need to provide multiple installation profiles, so that users of this library can have lighter installation of the project in case they don't need some dependency-heavy features, like classification or the dashboard. Also, a missing dependency should be notified gracefully when using the cli tool, a meaningful message should be printed so the user can know which actions to take to solve it.
Solution
Added "extra" dependencies as installation profles. Added profiles:
transformers
transformers-interpret
torch
datasets
scikit-learn
scikit-multilearn
pandas
tensorflow
tensorflow_hub
tensorflow-probability
jupyter
ipykernel
ipython
Also, as the
microscope.Manager
object is the main interface for the CLI tool, optional features were included as part of the functions and not the module itself. for example:Note that imports in python won't run the entire python file twice when they are called more than once, so they are lazy by default.
Relevant files:
pyproject.toml
= specified set up for additional dependenciessrc/c4v/c4v_cli.py
= added try/except statements when a import cannot be satisfied because of an optional dependency not being available.src/c4v/microscope/manager.py
= added local imports of possibly-missing dependencies, so that the entire module won't break when a lighter profile is installednoxfile.py
= added set up to install the complete version when running a test sessionFurther work