Skip to content
Snippets Groups Projects
Unverified Commit fc5c2f43 authored by AxelCarayon's avatar AxelCarayon Committed by GitHub
Browse files

Merge branch 'main' into gestionTags

parents 9dc99004 b0e29d2f
Branches gestionTags
No related tags found
1 merge request!12lors d'un enregistrement, vérifie que la branche de départ a un tag. …
...@@ -16,7 +16,7 @@ inputFiles = [] ...@@ -16,7 +16,7 @@ inputFiles = []
paramsFolder = None paramsFolder = None
commandsFile = None commandsFile = "commands.txt"
experimentName = None experimentName = None
...@@ -91,6 +91,24 @@ def askForCommandsFile() -> None: ...@@ -91,6 +91,24 @@ def askForCommandsFile() -> None:
if not fileExists(commandsFile): if not fileExists(commandsFile):
raise Exception(f"{commandsFile} file does not exist") raise Exception(f"{commandsFile} file does not exist")
def captureExperiment() -> None :
print("Capturing commands in terminal, when the experiment is done, type \"done\"")
inputs = []
userInput = input()
while (userInput != "done"):
inputs.append(userInput)
process = subprocess.run(userInput, shell=True)
process.check_returncode()
userInput = input()
print(f"Done recording the experiment, writing commands in a {commandsFile} file")
registeringExperimentInputs(inputs)
def registeringExperimentInputs(inputs) -> None:
with open(commandsFile, "w") as file:
for input in inputs:
file.write(input+"\n")
def runExperiment() -> None: def runExperiment() -> None:
print("Trying to run experiment") print("Trying to run experiment")
file = open(commandsFile, "r") file = open(commandsFile, "r")
...@@ -162,8 +180,12 @@ def run(folder) -> None : ...@@ -162,8 +180,12 @@ def run(folder) -> None :
searchForInputFolder() searchForInputFolder()
searchForOutputFolder() searchForOutputFolder()
searchForParamsFolder() searchForParamsFolder()
askForCommandsFile() userInput = input("Do you have a pre-recorded commands file? (y/n)")
runExperiment() if userInput == "y":
askForCommandsFile()
runExperiment()
else:
captureExperiment()
scanInputFiles() scanInputFiles()
scanOutputsGenerated() scanOutputsGenerated()
writeInYaml() writeInYaml()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment