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
e9bdc837
Commit
e9bdc837
authored
3 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Copy bash script to run notebook to working directory
parent
cd10351a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!544
Reproducibility, step 1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/slurm_calibrate.sh
+2
-0
2 additions, 0 deletions
bin/slurm_calibrate.sh
src/xfel_calibrate/calibrate.py
+9
-4
9 additions, 4 deletions
src/xfel_calibrate/calibrate.py
with
11 additions
and
4 deletions
bin/slurm_calibrate.sh
+
2
−
0
View file @
e9bdc837
#!/bin/bash
# This script is used to run a parameterised copy of a Jupyter notebook. It is
# typically run through Slurm with the sbatch command.
set
-euo
pipefail
...
...
This diff is collapsed.
Click to expand it.
src/xfel_calibrate/calibrate.py
+
9
−
4
View file @
e9bdc837
...
...
@@ -8,6 +8,7 @@ import math
import
os
import
pprint
import
re
import
shutil
import
stat
import
string
import
sys
...
...
@@ -771,7 +772,7 @@ def prepare_job(
nbformat
.
write
(
new_nb
,
nbpath
)
return
JobArgs
([
"
{pkg_dir}/bin/slurm_calibrate
.sh
"
,
"
pycalib-run-nb
.sh
"
,
new_name
,
"
{python}
"
,
cluster_profile
,
...
...
@@ -793,9 +794,7 @@ class JobArgs:
return
isinstance
(
other
,
JobArgs
)
and
(
self
.
args
==
other
.
args
)
def
format_cmd
(
self
,
python
):
return
[
a
.
format
(
python
=
python
,
pkg_dir
=
PKG_DIR
)
for
a
in
self
.
args
]
return
[
a
.
format
(
python
=
python
)
for
a
in
self
.
args
]
def
run_direct
(
self
,
work_dir
,
python
)
->
int
:
return
call
(
self
.
format_cmd
(
python
),
cwd
=
work_dir
)
...
...
@@ -1014,6 +1013,12 @@ def run():
# And save the invocation of this script itself
save_executed_command
(
run_tmp_path
,
version
)
# Copy the bash script which will be used to run notebooks
shutil
.
copy2
(
os
.
path
.
join
(
PKG_DIR
,
"
bin
"
,
"
slurm_calibrate.sh
"
),
os
.
path
.
join
(
run_tmp_path
,
"
pycalib-run-nb.sh
"
)
)
# wait on all jobs to run and then finalize the run by creating a report from the notebooks
out_path
=
Path
(
default_report_path
)
/
detector
.
upper
()
/
caltype
.
upper
()
/
datetime
.
now
().
isoformat
()
if
try_report_to_output
:
...
...
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