Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reproductionTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SMAC
Reproductibilité des recherches dans SMAC
reproductionTool
Commits
314492c2
Commit
314492c2
authored
3 years ago
by
AxelCarayon
Browse files
Options
Downloads
Patches
Plain Diff
Permet à l'utilisateur d'enregistrer un fichier de paramétrage (ou aucun)
parent
0b6d9680
No related branches found
No related tags found
1 merge request
!17
Permet à l'utilisateur d'enregistrer un fichier de paramétrage (ou au…
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
registerExperiment.py
+19
-4
19 additions, 4 deletions
registerExperiment.py
with
19 additions
and
4 deletions
registerExperiment.py
+
19
−
4
View file @
314492c2
...
...
@@ -16,6 +16,7 @@ inputFolder = None
inputFiles
=
[]
paramsFolder
=
None
paramsFiles
=
[]
commandsFile
=
"
commands.txt
"
...
...
@@ -75,7 +76,7 @@ def searchForInputFolder() -> None:
if
answer
==
""
:
warnings
.
warn
(
"
No input folder given, no input files will be registered
"
)
else
:
if
not
folderExists
(
"
inputs
"
):
if
not
folderExists
(
answer
):
raise
Exception
(
f
"
{
path
}
/
{
answer
}
folder does not exist
"
)
else
:
if
not
answer
.
endswith
(
"
/
"
):
...
...
@@ -97,10 +98,16 @@ def searchForOutputFolder() -> None:
def
searchForParamsFolder
()
->
None
:
global
paramsFolder
if
folderExists
(
"
params
"
):
paramsFolder
=
"
params
"
answer
=
input
(
"
In which folder do you store your parameters ? Give the path from the root of the repository :
"
)
if
answer
==
""
:
warnings
.
warn
(
"
No parameters folder given, no parameters will be registered
"
)
else
:
raise
Exception
(
f
"
{
path
}
/params folder does not exist
"
)
if
not
folderExists
(
answer
):
raise
Exception
(
f
"
{
path
}
/
{
answer
}
folder does not exist
"
)
else
:
if
not
answer
.
endswith
(
"
/
"
):
answer
+=
"
/
"
paramsFolder
=
answer
def
askForCommandsFile
()
->
None
:
global
commandsFile
...
...
@@ -147,6 +154,11 @@ def scanOutputsGenerated() -> None:
if
not
file
.
endswith
(
"
.gitkeep
"
):
outputFiles
.
append
(
f
"
{
outputFolder
}{
file
}
"
)
def
scanParameters
()
->
None
:
for
file
in
os
.
listdir
(
paramsFolder
):
if
not
file
.
endswith
(
"
.gitkeep
"
):
paramsFiles
.
append
(
f
"
{
paramsFolder
}{
file
}
"
)
def
checkGeneratedFiles
()
->
None
:
changesNotAdded
=
[
item
.
a_path
for
item
in
repository
.
index
.
diff
(
None
)
]
untrackedFiles
=
repository
.
untracked_files
...
...
@@ -160,6 +172,7 @@ def writeInYaml() -> None:
cur_yaml
.
update
({
"
commands
"
:
commandsFile
})
cur_yaml
.
update
({
"
inputs
"
:
inputFiles
})
cur_yaml
.
update
({
"
outputs
"
:
outputFiles
})
cur_yaml
.
update
({
"
params
"
:
paramsFiles
})
checksums
=
{
"
checksums
"
:
genChecksums
()}
cur_yaml
.
update
(
checksums
)
with
open
(
'
experimentResume.yaml
'
,
'
w
'
)
as
yamlFile
:
...
...
@@ -215,6 +228,8 @@ def run(folder) -> None :
scanInputFiles
()
if
outputFolder
!=
None
:
scanOutputsGenerated
()
if
paramsFolder
!=
None
:
scanParameters
()
checkGeneratedFiles
()
writeInYaml
()
pushBranch
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment