urbansim_templates
urbansim_templates copied to clipboard
Strategy for template-specific dependencies
We are starting to accumulate template-specific dependencies, like PyLogit for Small MNL and Scikit-learn for Random Forest. At the moment, many of these model types are not used very often.
Conferring with @janowicz, I think a good strategy to avoid dependency bloat would be to not require these packages when installing urbansim_templates
, but instead raise a helpful error if someone tries to use a template without having its particular dependencies installed.
This seems to be a fairly common design pattern for large libraries, e.g. Pandas requiring pytables
to read HDFS files but not installing it automatically. It also extends well to future use cases where templates themselves are defined across multiple packages.
If we're generally using project-level Conda environments, it will be easy to include specific template requirements as needed.
Implementation
We'll need to update the setup files and add package import checks to the appropriate templates.