From e8a211f63cae251e628546e683411b121e1935b9 Mon Sep 17 00:00:00 2001 From: Felix Burkhardt Date: Tue, 22 Feb 2022 13:03:07 +0100 Subject: [PATCH] update --- demos/my_experiment.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/demos/my_experiment.py b/demos/my_experiment.py index 8353ffe8..4cae10dc 100644 --- a/demos/my_experiment.py +++ b/demos/my_experiment.py @@ -2,16 +2,21 @@ # Demonstration code to use the ML-experiment framework import sys -sys.path.append("./src") +sys.path.append("../src") import experiment as exp import configparser from util import Util +import os.path def main(config_file): + util = Util() + # test if the configuration file exists + if not os.path.isfile(config_file): + util.error(f'no such file: {config_file}') + # load one configuration per experiment config = configparser.ConfigParser() config.read(config_file) - util = Util() # create a new experiment expr = exp.Experiment(config) @@ -37,5 +42,5 @@ def main(config_file): print('DONE') if __name__ == "__main__": - main('./demos/exp_emodb.ini') + main('./exp_emodb.ini') # main(sys.argv[1]) # use this if you want to state the config file path on command line