From 02849aea0752560f116fc4fd476b383d382933ae Mon Sep 17 00:00:00 2001 From: Eduardo Mucelli Rezende Oliveira Date: Mon, 7 Sep 2015 17:47:05 +0200 Subject: [PATCH 1/2] Fix: hash issue --- pybikes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybikes/base.py b/pybikes/base.py index b98e636ac..2c120d4e9 100644 --- a/pybikes/base.py +++ b/pybikes/base.py @@ -66,7 +66,7 @@ def get_hash(self): reliable information about an station that defines the difference between one and another """ - str_rep = "%d,%d" % (int(self.latitude * 1E6), int(self.longitude * 1E6)) + str_rep = "%s,%d,%d" % (self.name, int(self.latitude * 1E6), int(self.longitude * 1E6)) h = hashlib.md5() h.update(str_rep.encode('utf-8')) return h.hexdigest() From 708ca9ea3607991cb2432c654f5ba998914bd2d8 Mon Sep 17 00:00:00 2001 From: Eduardo Mucelli Rezende Oliveira Date: Mon, 7 Sep 2015 17:50:02 +0200 Subject: [PATCH 2/2] Fix: update comment --- pybikes/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pybikes/base.py b/pybikes/base.py index 2c120d4e9..b0f94c0fb 100644 --- a/pybikes/base.py +++ b/pybikes/base.py @@ -62,8 +62,8 @@ def to_json(self, **args): def get_hash(self): """ Return a unique hash representing this station, usually with - latitude and longitude, since it's the only globally ready and - reliable information about an station that defines the + name, latitude and longitude, since it's the only globally ready + and reliable information about an station that defines the difference between one and another """ str_rep = "%s,%d,%d" % (self.name, int(self.latitude * 1E6), int(self.longitude * 1E6))