Skip to content

Commit b1c1fab

Browse files
committed
remove all from __future__ import unicode_literals due to the staggering amount of warnings
i don't know why i thought that using unicode_literals might be a good idea, but judging by the times this caused headaches: NOPE!
1 parent 3b31664 commit b1c1fab

17 files changed

+9
-20
lines changed

cluster.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65

76
from collections import Counter
87
from collections import OrderedDict

config/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65
"""Config for graph_learner.
76
87
The actual config values can be found in defaults.py, the rest are helpers which

config/defaults.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65

76
from os import path
87

@@ -35,7 +34,7 @@
3534
OVERFITTING_PUNISHMENT = 0.25 # multiplier for single ?source or ?target match
3635

3736
# SPARQL query:
38-
SPARQL_ENDPOINT = b'http://dbpedia.org/sparql'
37+
SPARQL_ENDPOINT = 'http://dbpedia.org/sparql'
3938
BATCH_SIZE = 384 # tested to rarely result in error recursions
4039
QUERY_TIMEOUT_FACTOR = 32 # timeout factor compared to a simplistic query
4140
QUERY_TIMEOUT_MIN = 2 # minimum query timeout in seconds

config/helpers.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65

76
from collections import OrderedDict
87
import logging

eval/data_generator.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
import random
98
from uuid import uuid4

eval/data_loader.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
import urllib2
98

eval/enumerate.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
from copy import deepcopy
98
from itertools import combinations

gp_learner.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
import sys
98
if __name__ == '__main__':
@@ -1521,9 +1520,11 @@ def main(
15211520
tests=False,
15221521
**kwds
15231522
):
1524-
logging.info('encoding check: äöüß\U0001F385')
1525-
logging.info('encoding check: äöüß\U0001F385'.encode('utf-8'))
1526-
print('encoding check: äöüß\U0001F385')
1523+
logging.info('encoding check: äöüß🎅') # logging utf-8 byte string
1524+
logging.info(u'encoding check: äöüß\U0001F385') # logging unicode string
1525+
logging.info(u'encoding check: äöüß\U0001F385'.encode('utf-8')) # convert
1526+
print('encoding check: äöüß🎅') # printing utf-8 byte string
1527+
print(u'encoding check: äöüß\U0001F385') # printing unicode string
15271528

15281529
main_start = datetime.utcnow()
15291530

gp_query.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
from collections import defaultdict
98
from collections import Counter

graph_pattern.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
from collections import Counter
98
from collections import Iterable

ground_truth_tools.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
import csv
98
import gzip

gtp_scores.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65

76
from collections import OrderedDict
87

logging_config.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# encoding: utf-8
2+
from __future__ import absolute_import
3+
from __future__ import division
4+
from __future__ import print_function
25

36
import os
47
import glob

prediction_baselines.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
from SPARQLWrapper import SPARQLWrapper
98
from rdflib import URIRef

run.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
from __future__ import unicode_literals
65

76
import logging
87
logger = logging.getLogger(__name__)

serialization.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import absolute_import
44
from __future__ import division
55
from __future__ import print_function
6-
from __future__ import unicode_literals
76

87
import atexit
98
from collections import Counter

utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from __future__ import absolute_import
33
from __future__ import division
44
from __future__ import print_function
5-
# from __future__ import unicode_literals
65

76
import sys
87
from functools import wraps

0 commit comments

Comments
 (0)