33 def __init__(self, command_argument):
34 """Init the stored databases and exp/run from the specified command argument"""
35
36 self._database = []
37
38 self._experiment = 99999
39
40 self._run = 99999
41
42
43 split_argument = command_argument.split(":")
44 if len(split_argument) == 2:
45 command_argument, exp_run = split_argument
46
47 if exp_run != "latest":
48 try:
49 self._experiment, self._run = map(int, exp_run.split("/"))
50 except BaseException:
51 raise argparse.ArgumentTypeError(
52 f"Do not understand the exp/run argument '{exp_run}'")
53
54 elif len(split_argument) != 1:
55 raise argparse.ArgumentTypeError(
56 f"Do not understand the database argument '{command_argument}'")
57
58
59 self._database = command_argument.split(",")
60
61
62 def normalize(database):
63
64 if os.path.exists(database):
65 if os.path.basename(database) != "database.txt":
66 database = os.path.join(database, "database.txt")
67
68 return database
69
70 self._database = list(map(normalize, self._database))
71