mozilla / taar-lite

A lightweight version of the TAAR service intended for specific deployments with reduced feature visibility.
Mozilla Public License 2.0
2 stars 6 forks source link

Follow-up with review comments #46

Open birdsarah opened 6 years ago

birdsarah commented 6 years ago

@crankycoder merged #41 which helped moved things along, but I still need to take care of the review comments.

In setup.cfg:

> @@ -0,0 +1,12 @@
+[aliases]
+test=pytest
+
+[flake8]
+max-line-length = 120
+
+[tool:pytest]
+addopts = --flake8 -rw

I'd like to make sure that travis, python setup.py test run the same things. We should probalby have addopts = --flake8 -rw --cov taar_lite --cov-report term-missing here and just run python setup.py test in Travis.

In .travis.yml:

>  
 script:
-- flake8  --max-line-length=120 taar_lite tests || exit 1  # Fail if flake8 fails
-- py.test --cov taar_lite tests
+- py.test --cov taar_lite --cov-report term-missing

This should probably be updated to python setup.py test in the script target so that we are running pytest, flake8 and coverage reports all the time in both travis and local development.

In taar_lite/recommenders/guidguid.py:

>  
     @property
-    def treatment_graph(self):
+    def tie_breaker_dict(self):
+        """Returns a dict used for tie-breaking.
+
+        The values are used to order items in the case where the treated
+        values are the same.
+
+        The keys will typically match the keys of the raw_coinstall_graph, but
+        this is not validated, and missing keys are assinged a ranking value of 0
+        in self._build_sorted_result_list.
+        """
+        return self._tie_breaker_dict
+
+    @property
+    def treated_graph(self):

Nit: typo in docstring should read "..the recommendation graph"