From 703133129e1f3509a5730806e200170e1a3f8f95 Mon Sep 17 00:00:00 2001 From: rlx Date: Thu, 2 Nov 2017 11:12:56 +0000 Subject: [PATCH] update comments --- recommendation_engine.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/recommendation_engine.py b/recommendation_engine.py index 0a44163..cbfdd96 100644 --- a/recommendation_engine.py +++ b/recommendation_engine.py @@ -43,6 +43,7 @@ class Engine: score[playlist['name']] = random.random() for tag in playlist['tags']: score[playlist['name']] += count.get(tag, 0) + # Select 16 highest scoring playlists playlists = sorted( self.playlists, key=lambda playlist: -score[playlist['name']] @@ -106,11 +107,6 @@ class Engine: 'in': clip['in'], 'out': clip['out'] } for clip in clips if clip['value'] == storyline['name']] - #'clips': [ - # '{}_{:.3f}-{:.3f}'.format( - # clip['id'].split('/')[0], clip['in'], clip['out'] - # ) for clip in clips if clip['value'] == storyline['name'] - #] } for storyline in storylines] if playlist['clips']] with open(os.path.join(self.path, 'playlists.json'), 'w') as f: f.write(json.dumps(self.playlists, indent=4, sort_keys=True)) @@ -118,6 +114,8 @@ class Engine: class Pandora: + # pan.do/ra API wrapper + def __init__(self, url, username, password): self.api = ox.API(url) self.api.signin(username=username, password=password)