ColtAllen / btyd

Buy Till You Die and Customer Lifetime Value statistical models in Python.
https://btyd.readthedocs.io/
Apache License 2.0
114 stars 9 forks source link

Added Deprecation warning and conftest, remove call dict from PredictMixin #34

Closed ColtAllen closed 2 years ago

ColtAllen commented 2 years ago

Just incorporating a few best practices at the end of the Alpha development stage.

I've added a Deprecation warning reminding users the legacy Lifetimes fitters module will be deprecated during Beta development and also moved the cdnow_summary pytest fixture to conftest.py so that it may be shared among all testing scripts.

Lastly, after scratching my head for a while over the DRY (Don't Repeat Yourself) development principle and Python object inheritance, I've opted to remove the _quantities_of_interest predictive method call dictionary from the PredictMixin abstract model primitive. It adds a small amount of code redundancy as this dict must now be defined in all model subclasses, but there will nonetheless be variations in the items this dict contains depending on the model. This is the most pythonic solution for this code smell and way more maintainable than alternatives involving complexities like super().predict().