Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
03246d13
Commit
03246d13
authored
4 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
copy retrieve_constant to slurm and leave latest copy in out-folder
parent
e235e1e4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xfel_calibrate/finalize.py
+17
-14
17 additions, 14 deletions
xfel_calibrate/finalize.py
with
17 additions
and
14 deletions
xfel_calibrate/finalize.py
+
17
−
14
View file @
03246d13
...
@@ -186,8 +186,8 @@ def make_timing_summary(run_path, joblist, request_time, submission_time):
...
@@ -186,8 +186,8 @@ def make_timing_summary(run_path, joblist, request_time, submission_time):
time_table
=
time_table
.
split
(
'
\n
'
))))
time_table
=
time_table
.
split
(
'
\n
'
))))
def
make_report
(
run_path
,
tmp_path
,
out_path
,
project
,
author
,
version
,
def
make_report
(
run_path
:
str
,
tmp_path
:
str
,
out_path
:
str
,
project
:
str
,
report_to
):
author
:
str
,
version
:
str
,
report_to
:
str
):
"""
"""
Create calibration report (pdf file)
Create calibration report (pdf file)
...
@@ -201,12 +201,13 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
...
@@ -201,12 +201,13 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
:param project: Project title
:param project: Project title
:param author: Author of the notebook
:param author: Author of the notebook
:param version: Version of the notebook
:param version: Version of the notebook
:param report_to:
Name
or path
of
th
e
report
fil
e
:param report_to:
rep
or
t
path
tailed wi
th report
nam
e
"""
"""
run_path
=
path
.
abspath
(
run_path
)
run_path
=
path
.
abspath
(
run_path
)
report_path
,
report_name
=
path
.
split
(
report_to
)
report_path
,
report_name
=
path
.
split
(
report_to
)
if
report_path
!=
''
:
out_path
=
report_path
if
not
report_path
:
report_path
=
out_path
try
:
try
:
check_call
([
sys
.
executable
,
"
-m
"
,
"
sphinx.cmd.quickstart
"
,
check_call
([
sys
.
executable
,
"
-m
"
,
"
sphinx.cmd.quickstart
"
,
...
@@ -299,16 +300,18 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
...
@@ -299,16 +300,18 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
# finally call the make scripts
# finally call the make scripts
chdir
(
run_path
)
chdir
(
run_path
)
try
:
try
:
check_call
([
"
make
"
,
f
"
SPHINXBUILD=
{
sys
.
executable
}
-m sphinx
"
,
"
latexpdf
"
])
check_call
([
"
make
"
,
f
"
SPHINXBUILD=
{
sys
.
executable
}
-m sphinx
"
,
"
latexpdf
"
])
except
CalledProcessError
:
except
CalledProcessError
:
print
(
"
Failed to make pdf documentation
"
)
print
(
"
Failed to make pdf documentation
"
)
print
(
"
Temp files will not be deleted and
"
+
print
(
"
Temp files will not be deleted and
"
"
can be inspected at: {
}
"
.
format
(
run_path
)
)
f
"
can be inspected at:
{
run_path
}
"
)
return
return
print
(
"
Moving report to final location: {}
"
.
format
(
out_path
))
makedirs
(
out_path
,
exist_ok
=
True
)
print
(
f
"
Moving report to final location:
{
report_path
}
"
)
copy
(
'
{}/_build/latex/{}.pdf
'
.
format
(
run_path
,
report_name
),
out_path
)
makedirs
(
report_path
,
exist_ok
=
True
)
copy
(
f
'
{
run_path
}
/_build/latex/
{
report_name
}
.pdf
'
,
report_path
)
temp_dirs
=
glob
(
f
'
{
tmp_path
}
/*/
'
)
temp_dirs
=
glob
(
f
'
{
tmp_path
}
/*/
'
)
# Remove folders with figures and sphinx files.
# Remove folders with figures and sphinx files.
...
@@ -318,15 +321,15 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
...
@@ -318,15 +321,15 @@ def make_report(run_path, tmp_path, out_path, project, author, version,
# Archiving files in slurm_tmp
# Archiving files in slurm_tmp
if
os
.
path
.
isfile
(
f
'
{
out_path
}
/retrieved_constants.yml
'
):
if
os
.
path
.
isfile
(
f
'
{
out_path
}
/retrieved_constants.yml
'
):
move
(
f
'
{
out_path
}
/retrieved_constants.yml
'
,
copy
(
f
'
{
out_path
}
/retrieved_constants.yml
'
,
f
"
{
tmp_path
}
"
)
f
"
{
tmp_path
}
"
)
# Moving temporary files to out-folder after successful execution
# Moving temporary files to out-folder after successful execution
# This helps in keeping elements needed for re-producibility.
# This helps in keeping elements needed for re-producibility.
print
(
f
"
Moving temporary files to final location
"
print
(
f
"
Moving temporary files to final location
"
f
"
:
{
ou
t_path
}
/
{
os
.
path
.
basename
(
tmp_path
)
}
with name:
"
f
"
:
{
repor
t_path
}
/
{
os
.
path
.
basename
(
tmp_path
)
}
with name:
"
f
"
slurm_out_
{
report_name
}
"
)
f
"
slurm_out_
{
report_name
}
"
)
move
(
tmp_path
,
f
"
{
ou
t_path
}
/slurm_out_
{
report_name
}
"
)
move
(
tmp_path
,
f
"
{
repor
t_path
}
/slurm_out_
{
report_name
}
"
)
def
make_titlepage
(
sphinx_path
,
project
,
data_path
,
version
):
def
make_titlepage
(
sphinx_path
,
project
,
data_path
,
version
):
...
...
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