From d7f9135704d21794479e5e60e9ef16026929d74e Mon Sep 17 00:00:00 2001 From: Sam Zhang Date: Thu, 18 May 2017 00:05:35 +0200 Subject: [PATCH 1/3] Fix packaging --- lshash/__init__.py | 2 +- lshash/lshash.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lshash/__init__.py b/lshash/__init__.py index e805896..e4424c7 100644 --- a/lshash/__init__.py +++ b/lshash/__init__.py @@ -9,4 +9,4 @@ __license__ = 'MIT' __version__ = '0.0.4dev' -from lshash import LSHash +from .lshash import LSHash diff --git a/lshash/lshash.py b/lshash/lshash.py index 5c895a6..5c8694c 100644 --- a/lshash/lshash.py +++ b/lshash/lshash.py @@ -8,7 +8,7 @@ import json import numpy as np -from storage import storage +from .storage import storage try: from bitarray import bitarray From 739dd86a44e074771af4bafd09360275fa6d05c8 Mon Sep 17 00:00:00 2001 From: Sam Zhang Date: Thu, 18 May 2017 00:28:35 +0200 Subject: [PATCH 2/3] xrange -> range --- lshash/lshash.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lshash/lshash.py b/lshash/lshash.py index 5c8694c..50e4132 100644 --- a/lshash/lshash.py +++ b/lshash/lshash.py @@ -92,7 +92,7 @@ def _init_uniform_planes(self): self.uniform_planes = [t[1] for t in npzfiles] else: self.uniform_planes = [self._generate_uniform_planes() - for _ in xrange(self.num_hashtables)] + for _ in range(self.num_hashtables)] try: np.savez_compressed(self.matrices_filename, *self.uniform_planes) @@ -101,14 +101,14 @@ def _init_uniform_planes(self): raise else: self.uniform_planes = [self._generate_uniform_planes() - for _ in xrange(self.num_hashtables)] + for _ in range(self.num_hashtables)] def _init_hashtables(self): """ Initialize the hash tables such that each record will be in the form of "[storage1, storage2, ...]" """ self.hash_tables = [storage(self.storage_config, i) - for i in xrange(self.num_hashtables)] + for i in range(self.num_hashtables)] def _generate_uniform_planes(self): """ Generate uniformly distributed hyperplanes and return it as a 2D From d4c263de06a92345a1bc82b3f4f80c21e9fa5c5f Mon Sep 17 00:00:00 2001 From: Sam Zhang Date: Thu, 18 May 2017 00:29:49 +0200 Subject: [PATCH 3/3] Add Python 3 to setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index b0a98e5..0dcb52c 100644 --- a/setup.py +++ b/setup.py @@ -37,6 +37,7 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 3', 'Topic :: Software Development :: Libraries', ], )