Skip to content

Commit

Permalink
Log info about dryrun
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinAhlberg committed Mar 5, 2019
1 parent c9e5af5 commit 3b8f11a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/importer/data_importer/raw_data_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,14 @@ def _insert_coverage(self):
db.Coverage.insert_many(batch)
if self.counter['coverage'] != None:
self._tick(True)
logging.info("Inserted {} coverage records in {}".format(counter, self._time_since(start)))
if not self.settings.dry_run:
logging.info("Inserted {} coverage records in {}".format(counter, self._time_since(start)))

def _insert_variants(self):
"""
Insert variants from a VCF file
"""
logging.info("Inserting variants")
logging.info("Inserting variants%s", " (dry run)" if self.settings.dry_run else "")
header = [("chrom", str), ("pos", int), ("rsid", str), ("ref", str),
("alt", str), ("site_quality", float), ("filter_string", str)]
start = time.time()
Expand Down Expand Up @@ -440,7 +441,8 @@ def _insert_variants(self):
self.dataset_version.save()
if self.counter['variants'] != None:
self._tick(True)
logging.info("Inserted {} variant records in {}".format(counter, self._time_since(start)))
if not self.settings.dry_run:
logging.info("Inserted {} variant records in {}".format(counter, self._time_since(start)))

def count_entries(self):
start = time.time()
Expand Down
1 change: 1 addition & 0 deletions scripts/importer/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
importer.start_import()

if args.add_raw_data:
logging.info("Adding raw data %s", "(dry run)" if args.dry_run else '')
importer = RawDataImporter(args)
importer.prepare_data()
if not args.disable_progress:
Expand Down

0 comments on commit 3b8f11a

Please sign in to comment.