diff --git a/loadExperiment.py b/loadExperiment.py index 3d753fa3ff54d85de035ac412130161e1138ae0b..e8bb82ea2393ddf27a64862784e16ca4a5504f9f 100644 --- a/loadExperiment.py +++ b/loadExperiment.py @@ -47,6 +47,7 @@ def getParameters() -> None : inputFiles = parameters.get('inputs') beforeHash = parameters.get('checksums') + def runExperiment() -> None : file = open(commandsFile, "r") for line in file.read().splitlines(): @@ -92,6 +93,4 @@ def run(repository, branch) -> None : if (compareChecksums()) : print("The exepriment was reproduced with succes but some output files are differents.") else : - print("The exepriment was reproduced with succes !") - -#TODO : laisser à l'utilisateur le temps de reproduire l'experience \ No newline at end of file + print("The exepriment was reproduced with succes !") \ No newline at end of file diff --git a/registerExperiment.py b/registerExperiment.py index df348cf080c19aa2edee11e41248fc3969dc7c46..f667035d04578e58789989dc876cec380c60cc71 100644 --- a/registerExperiment.py +++ b/registerExperiment.py @@ -17,7 +17,8 @@ inputFiles = [] paramsFolder = None paramsFiles = [] -commandsFile = "commands.txt" +commandsFile = None +instructionFile = None experimentName = None @@ -111,11 +112,19 @@ def searchForParamsFolder() -> None: def askForCommandsFile() -> None: global commandsFile commandsFile = input("Enter the name of the commands file: ") - if commandsFile == "": - raise Exception("No commands file given") if not fileExists(commandsFile): raise Exception(f"{commandsFile} file does not exist") +def askForInstructionFile() -> None : + global instructionFile + print("If you have an instruction file, enter its name, otherwise press enter") + instructionFile = input() + if instructionFile == "": + warnings.warn("No instruction file given, make sure you give instructions to reproduce the experiment along with it") + else: + if not fileExists(instructionFile): + raise Exception(f"{instructionFile} file does not exist") + def registeringExperimentInputs(inputs) -> None: with open(commandsFile, "w") as file: for input in inputs: @@ -224,6 +233,7 @@ def run(folder) -> None : askForCommandsFile() runExperiment() else: + askForInstructionFile() done = "" while(done != "done"): done = input("Run your experiment and then type 'done' when you are done : ") @@ -235,4 +245,4 @@ def run(folder) -> None : scanParameters() checkGeneratedFiles() writeInYaml() - pushBranch() + #pushBranch()