Skip to content

Commit

Permalink
Merge pull request #143 from chicago-justice-project/v1.2.3
Browse files Browse the repository at this point in the history
up to 1.2.3
  • Loading branch information
jlherzberg authored Oct 9, 2019
2 parents 3e55e11 + 5890789 commit d897020
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ install:
f = open('Boundaries - Community Areas (current).geojson', 'w');\
f.write(r.text)"
mv "Boundaries - Community Areas (current).geojson" lib/tagnews/data/
wget http://nlp.stanford.edu/data/glove.6B.zip
wget http://nlp.stanford.edu/data/glove.6B.zip --no-check-certificate
python -c "import zipfile; myzip = zipfile.ZipFile('glove.6B.zip'); myzip.extract('glove.6B.50d.txt')"
mv glove.6B.50d.txt lib/tagnews/data/
rm glove.6B.zip
Expand Down
2 changes: 1 addition & 1 deletion lib/tagnews/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
__all__ = [utils, crimetype, CrimeTags, GeoCoder,
get_lat_longs_from_geostrings, load_data, load_glove]

__version__ = '1.2.2'
__version__ = '1.2.4'
2 changes: 1 addition & 1 deletion lib/tagnews/geoloc/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,5 @@ def best_geostring(self, extracted_strs_and_probs: tuple):
max_index = avgs.index(max(avgs))
return consider[0][max_index]
else:
return None
return ''

8 changes: 4 additions & 4 deletions lib/tagnews/tests/test_geocoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def test_best_geostring(self):
)
output1 = ["1700", "block", "of", "S.", "Halsted", "Ave."]
# Empty geostring example
input2, output2 = [(), ()], None
for input, expected_output in zip([input1, input2], [output1, output2]):
actual_output = self.model.best_geostring(input)
input2, output2 = [(), ()], ''
for inpt, expected_output in zip([input1, input2], [output1, output2]):
actual_output = self.model.best_geostring(inpt)
assert (
actual_output == expected_output
), "ERROR: expected output != actual output for input {}/n {} != {}".format(
input, actual_output, expected_output
inpt, actual_output, expected_output
)

0 comments on commit d897020

Please sign in to comment.