Skip to content
Snippets Groups Projects
Commit 449a70c5 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Organized the --sub-directory option and automatically deleted the temp file

Put the temp files back

Organized the --sub-directories for the baselines
parent dec5fa81
No related branches found
No related tags found
1 merge request!155Write parameters in a temporary config file to enable chain loading
Pipeline #
...@@ -14,6 +14,7 @@ from bob.extension.scripts.click_helper import verbosity_option ...@@ -14,6 +14,7 @@ from bob.extension.scripts.click_helper import verbosity_option
import click import click
import tempfile import tempfile
import logging import logging
import os
logger = logging.getLogger("bob.bio.base") logger = logging.getLogger("bob.bio.base")
...@@ -59,6 +60,12 @@ def baseline(ctx, baseline, database): ...@@ -59,6 +60,12 @@ def baseline(ctx, baseline, database):
db = search_preprocessor(database, loaded_baseline.preprocessors.keys()) db = search_preprocessor(database, loaded_baseline.preprocessors.keys())
preprocessor = loaded_baseline.preprocessors[db] preprocessor = loaded_baseline.preprocessors[db]
# this is the default sub-directory that is used
if "-T" in ctx.args or "--temp-directory" in ctx.args:
sub_directory = os.path.join(database, baseline)
else:
sub_directory = baseline
logger.debug('Database groups are %s', database_data["groups"]) logger.debug('Database groups are %s', database_data["groups"])
# call verify with newly generated config file. We will create a new config # call verify with newly generated config file. We will create a new config
...@@ -77,7 +84,7 @@ verbose = {verbose} ...@@ -77,7 +84,7 @@ verbose = {verbose}
extractor=loaded_baseline.extractor, extractor=loaded_baseline.extractor,
algorithm=loaded_baseline.algorithm, algorithm=loaded_baseline.algorithm,
database=database, database=database,
sub_directory=baseline, sub_directory=sub_directory,
groups="', '".join(database_data["groups"]), groups="', '".join(database_data["groups"]),
verbose=ctx.meta['verbosity'], verbose=ctx.meta['verbosity'],
) )
...@@ -89,4 +96,5 @@ verbose = {verbose} ...@@ -89,4 +96,5 @@ verbose = {verbose}
f.seek(0) f.seek(0)
verify([f.name] + ctx.args) verify([f.name] + ctx.args)
click.echo("You may want to delete `{}' after the experiments are " click.echo("You may want to delete `{}' after the experiments are "
"finished running.".format(f.name)) "finished running.".format(f.name))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment