diff --git a/f8a_worker/graphutils.py b/f8a_worker/graphutils.py index f2f168af2..c0b11355d 100644 --- a/f8a_worker/graphutils.py +++ b/f8a_worker/graphutils.py @@ -223,6 +223,12 @@ def create_package_dict(graph_results, alt_dict=None): } if epv['pkg'].get('cooccurrence_probability'): pkg_dict['cooccurrence_probability'] = epv['pkg']['cooccurrence_probability'] + + # Add the co-occurence count as well. + if epv['pkg'].get('cooccurrence_count'): + pkg_dict['cooccurrence_count'] = epv[ + 'pkg']['cooccurrence_count'] + github_dict = { 'dependent_projects': epv['pkg'].get('libio_dependents_projects', [-1])[0], 'dependent_repos': epv['pkg'].get('libio_dependents_repos', [-1])[0], diff --git a/f8a_worker/workers/recommender.py b/f8a_worker/workers/recommender.py index f1936d597..fd7135c30 100644 --- a/f8a_worker/workers/recommender.py +++ b/f8a_worker/workers/recommender.py @@ -427,6 +427,8 @@ def get_topics_for_comp(self, comp_list, pgm_list): epv['pkg']['pgm_topics'] = pgm_epv.get('topic_list', []) epv['pkg']['cooccurrence_probability'] = pgm_epv.get( 'cooccurrence_probability', 0) + epv['pkg']['cooccurrence_count'] = pgm_epv.get( + 'cooccurrence_count', 0) return comp_list