Permalink
Browse files

more logs + ensure dataset build is always run

  • Loading branch information...
1 parent dcf813a commit 5c37ee70d48d649f55c51a940576793f4cd274c2 @ogrisel committed May 11, 2012
Showing with 4 additions and 5 deletions.
  1. +1 −0 dbpediakit/postgres.py
  2. +3 −5 examples/topics/build_taxonomy.py
View
@@ -67,6 +67,7 @@
def run_file(filename, database=DATABASE):
+ logging.info("Running '%s'", filename)
return sp.call([PSQL, database, "-f", filename])
@@ -67,14 +67,13 @@ def grow_taxonomy(max_depth=1):
# with wikipedia articles
pg.check_run_if_undef(join(SQL_SCRIPTS_FOLDER,
"build_grounded_categories.sql"))
- pg.check_run_if_undef(join(SQL_SCRIPTS_FOLDER, "init_taxonomy.sql"))
+ pg.run_file(join(SQL_SCRIPTS_FOLDER, "init_taxonomy.sql"))
current_depth = int(pg.select("SELECT max(depth) from taxonomy_dag"))
if current_depth < max_depth:
for depth in range(current_depth + 1, max_depth + 1):
logging.info("Growing taxonomy to depth=%d", depth)
- pg.check_run_if_undef(join(SQL_SCRIPTS_FOLDER,
- "grow_taxonomy.sql"))
+ pg.run_file(join(SQL_SCRIPTS_FOLDER, "grow_taxonomy.sql"))
def dump_taxonomy(filename):
@@ -149,8 +148,7 @@ def dump_examples(filename, format='tsv'):
grow_taxonomy(args.max_depth)
elif operation == 'build_examples':
check_load_examples_data(args.max_items)
- pg.check_run_if_undef(
- join(SQL_SCRIPTS_FOLDER, "build_dataset.sql"))
+ pg.run_file(join(SQL_SCRIPTS_FOLDER, "build_dataset.sql"))
elif operation == 'dump_taxonomy':
dump_taxonomy(args.taxonomy_file)
elif operation == 'dump_examples':

0 comments on commit 5c37ee7

Please sign in to comment.