Skip to content

Commit

Permalink
adjust integration tests to use grant database
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Aug 29, 2013
1 parent 4fcaec8 commit f2f07a7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -3,5 +3,5 @@ clean:
rm -rf *~ *.pyc *.log

spotless: clean
rm -rf *.sqlite3 tmp alchemy.db *-journal disambiguator.csv
rm -rf *.sqlite3 tmp grant.db application.db *-journal disambiguator.csv

6 changes: 3 additions & 3 deletions integration/clean_integration.sh
Expand Up @@ -13,7 +13,7 @@ mkdir -p tmp/integration/ipg120327.one
for table in assignee lawyer location
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.one/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.one/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.one/${table}.csv
diff test/integration/clean/ipg120327.one/${table}.csv tmp/integration/ipg120327.one/${table}.csv
Expand All @@ -28,7 +28,7 @@ mkdir -p tmp/integration/ipg120327.two
for table in assignee lawyer location
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.two/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.two/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.two/${table}.csv
diff test/integration/clean/ipg120327.two/${table}.csv tmp/integration/ipg120327.two/${table}.csv
Expand All @@ -42,7 +42,7 @@ mkdir -p tmp/integration/ipg120327.18
for table in assignee lawyer location
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.18/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.18/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.18/${table}.csv
diff test/integration/clean/ipg120327.18/${table}.csv tmp/integration/ipg120327.18/${table}.csv
Expand Down
6 changes: 3 additions & 3 deletions integration/parse_integration.sh
Expand Up @@ -10,7 +10,7 @@ mkdir -p tmp/integration/ipg120327.one
for table in application uspatentcitation usapplicationcitation foreigncitation ipcr mainclass otherreference patent rawassignee rawinventor rawlawyer rawlocation subclass uspc usreldoc claim
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.one/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.one/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.one/${table}.csv
diff test/integration/parse/ipg120327.one/${table}.csv tmp/integration/ipg120327.one/${table}.csv
Expand All @@ -24,7 +24,7 @@ mkdir -p tmp/integration/ipg120327.two
for table in application uspatentcitation usapplicationcitation foreigncitation ipcr mainclass otherreference patent rawassignee rawinventor rawlawyer rawlocation subclass uspc usreldoc claim
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.two/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.two/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.two/${table}.csv
diff test/integration/parse/ipg120327.two/${table}.csv tmp/integration/ipg120327.two/${table}.csv
Expand All @@ -37,7 +37,7 @@ mkdir -p tmp/integration/ipg120327.18
for table in application uspatentcitation usapplicationcitation foreigncitation ipcr mainclass otherreference patent rawassignee rawinventor rawlawyer rawlocation subclass uspc usreldoc claim
do
echo $table 'diffs...'
sqlite3 -csv alchemy.db "select * from ${table}" > tmp/integration/ipg120327.18/${table}.csv
sqlite3 -csv grant.db "select * from ${table}" > tmp/integration/ipg120327.18/${table}.csv
# remove UUIDs from database dump because these change each time
perl -pi -e 's/^[a-z0-9]{8}-([a-z0-9]{4}-){3}[a-z0-9]{12},//' tmp/integration/ipg120327.18/${table}.csv
diff test/integration/parse/ipg120327.18/${table}.csv tmp/integration/ipg120327.18/${table}.csv
Expand Down
2 changes: 1 addition & 1 deletion lib/geoalchemy.py
Expand Up @@ -307,4 +307,4 @@ def find_difficult_locations_from_file(inputfilename, outputfilename):
most_similar_city = geoalchemy_util.get_closest_match_leven(city, all_japan_cities, 0.8)
if most_similar_city!='':
outputfile.write('{0}|{1}\n'.format(city.encode('utf8'), most_similar_city.encode('utf8')))
print datetime.datetime.now()-t
print datetime.datetime.now()-t

0 comments on commit f2f07a7

Please sign in to comment.