summaryrefslogtreecommitdiff
path: root/scripts/database
diff options
context:
space:
mode:
authorCNugteren <web@cedricnugteren.nl>2016-02-06 13:11:36 +0100
committerCNugteren <web@cedricnugteren.nl>2016-02-06 13:11:36 +0100
commit704a729f5cbcf5b319fe9ce6e0436554d8b5d9b0 (patch)
tree808fee11bb78e262c992a51b027ac1f035148045 /scripts/database
parentb7900652b2e4b4ed887b259e29ef5e660815c6f7 (diff)
Made the database script compatible with Python 3
Diffstat (limited to 'scripts/database')
-rw-r--r--scripts/database/database.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/database/database.py b/scripts/database/database.py
index 01662a4b..66169121 100644
--- a/scripts/database/database.py
+++ b/scripts/database/database.py
@@ -200,7 +200,7 @@ def PrintData(df, outputdir):
# Checks for the number of command-line arguments
if len(sys.argv) != 3:
- print "[ERROR] Usage: database.py <folder_with_json_files> <root_of_clblast>"
+ print("[ERROR] Usage: database.py <folder_with_json_files> <root_of_clblast>")
sys.exit()
# Parses the command-line arguments
@@ -212,10 +212,10 @@ glob_json = os.path.join(path_json, "*.json")
# Checks whether the command-line arguments are valid; exists otherwise
clblast_h = os.path.join(path_clblast, "include", "clblast.h") # Not used but just for validation
if not os.path.isfile(clblast_h):
- print "[ERROR] The path '"+path_clblast+"' does not point to the root of the CLBlast library"
+ print("[ERROR] The path '"+path_clblast+"' does not point to the root of the CLBlast library")
sys.exit()
if len(glob.glob(glob_json)) < 1:
- print "## The path '"+path_json+"' does not contain any JSON files"
+ print("## The path '"+path_json+"' does not contain any JSON files")
# ==================================================================================================
# The main body of the script
@@ -229,7 +229,7 @@ database = LoadDatabase(file_db) if db_exists else pd.DataFrame()
for file_json in glob.glob(glob_json):
# Loads the newly imported data
- print "## Processing '"+file_json+"'",
+ sys.stdout.write("## Processing '"+file_json+"'")
imported_data = ImportDataFromFile(file_json)
# Adds the new data to the database
@@ -237,7 +237,7 @@ for file_json in glob.glob(glob_json):
database = ConcatenateData(database, imported_data)
database = RemoveDuplicates(database)
new_size = len(database.index)
- print "with "+str(new_size-old_size)+" new items"
+ print("with "+str(new_size-old_size)+" new items")
# Stores the new database back to disk
SaveDatabase(database, file_db)
@@ -251,7 +251,7 @@ bests = ConcatenateData(bests, defaults)
# Outputs the data as a C++ database
path_cpp_database = os.path.join(path_clblast, "include", "internal", "database")
-print "## Producing a C++ database in '"+path_cpp_database+"'"
+print("## Producing a C++ database in '"+path_cpp_database+"'")
PrintData(bests, path_cpp_database)
# ==================================================================================================