Skip to content

Commit 3da4897

Browse files
committed
Curate outputs and logging
1 parent b69b009 commit 3da4897

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
input/
2+
input_dir/
23
output/
34
docs/
45
tests/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ENV/
105105
# vim
106106
.*.swp
107107

108-
input
108+
input*
109109
output/
110110
notebooks/
111111
templates.bak/

run_docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# docker build -t mit-d3m-ta2 .
44

5+
rm -r output
56
mkdir -p output
67
chown $USER output
78

ta2/__main__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ def process_dataset(dataset_name, dataset_root, problem, args):
153153

154154
def _ta2_test(args):
155155

156+
# Cleanup output dir
157+
shutil.rmtree(os.path.join(args.output, 'pipelines_ranked'), ignore_errors=True)
158+
shutil.rmtree(os.path.join(args.output, 'pipelines_scored'), ignore_errors=True)
159+
shutil.rmtree(os.path.join(args.output, 'pipelines_searched'), ignore_errors=True)
160+
shutil.rmtree(os.path.join(args.output, 'predictions'), ignore_errors=True)
161+
156162
results = list()
157163
if args.all:
158164
args.dataset = os.listdir(args.input)
@@ -365,12 +371,12 @@ def parse_args():
365371

366372
args = parser.parse_args()
367373

368-
# Cleanup output dir
369-
shutil.rmtree(args.output)
370374
os.makedirs(args.output, exist_ok=True)
371375

372-
if not args.logfile:
376+
if args.mode is _ta2_test and not args.logfile:
373377
args.logfile = os.path.join(args.output, 'ta2.log')
378+
if os.path.exists(args.logfile):
379+
os.remove(args.logfile)
374380

375381
logging_setup(args.verbose, args.logfile, stdout=args.stdout)
376382
logging.getLogger("d3m.metadata.pipeline_run").setLevel(logging.ERROR)

0 commit comments

Comments
 (0)