Skip to content
Snippets Groups Projects
Commit a47c191b authored by AxelCarayon's avatar AxelCarayon
Browse files

Ajout de la possibilité d'ajouter un fichier d'instruction

parent 257d91ca
Branches
Tags
1 merge request!20Amelioration execution
......@@ -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
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment