Skip to content

Commit 8d3fc8e

Browse files
committed
fix bug
1 parent 14908b4 commit 8d3fc8e

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

smcpp/commands/command.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Base class; subclasses will automatically show up as subcommands
22
import argparse
33
import os
4+
import os.path
45
import sys
56

67
from .. import logging
@@ -25,10 +26,8 @@ def __init__(self, parser):
2526
add_common_estimation_args(parser)
2627

2728
def main(self, args):
28-
try:
29+
if not os.path.isdir(args.outdir):
2930
os.makedirs(args.outdir)
30-
except OSError:
31-
pass # directory exists
3231
# Initialize the logger
3332
# Do this before calling super().main() so that
3433
# any debugging output generated there gets logged

smcpp/commands/split.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,7 @@ def __init__(self, parser):
3333
help="data file(s) in SMC++ format")
3434

3535
def main(self, args):
36-
# Initialize the logger
37-
# Do this before calling super().main() so that
38-
# any debugging output generated there gets logged
39-
add_debug_log(os.path.join(args.outdir, ".debug.txt"))
40-
4136
command.EstimationCommand.main(self, args)
42-
# Create output directory
43-
try:
44-
os.makedirs(args.outdir)
45-
except OSError:
46-
pass # directory exists
47-
48-
# Save all the command line args and stuff
49-
logger.debug(sys.argv)
50-
logger.debug(args)
51-
5237
# Fill in some of the population-genetic parameters from previous model run
5338
# TODO ensure that these params agree in both models?
5439
d = json.load(open(args.pop1, "rt"))

0 commit comments

Comments
 (0)