Skip to content

Commit

Permalink
Merge pull request #479 from sara-02/companion_reasoning
Browse files Browse the repository at this point in the history
[WIP]: Add key-value for component companion count
  • Loading branch information
miteshvp authored Dec 18, 2017
2 parents 631afc3 + d585b59 commit f22d9b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions f8a_worker/graphutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 2 additions & 0 deletions f8a_worker/workers/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f22d9b4

Please sign in to comment.