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
6adc6b7a
Commit
6adc6b7a
authored
3 years ago
by
Philipp Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Add warning to xfel-calibrate if configuration may cause result to not be reproducible
parent
85ddd210
No related branches found
No related tags found
1 merge request
!588
Add warning if xfel-calibrate may not be reproducible
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xfel_calibrate/calibrate.py
+29
-0
29 additions, 0 deletions
src/xfel_calibrate/calibrate.py
with
29 additions
and
0 deletions
src/xfel_calibrate/calibrate.py
+
29
−
0
View file @
6adc6b7a
...
...
@@ -985,6 +985,34 @@ def run():
caltype
=
args
[
"
type
"
].
upper
()
sequential
=
args
[
"
no_cluster_job
"
]
# Pick out any arguments that may prevent reproducibility from
# working, sorted alphabetically and converted back to their
# canonical representation.
not_reproducible_args
=
sorted
(
(
'
--
'
+
x
.
replace
(
'
_
'
,
'
-
'
)
for
x
in
[
'
skip_report
'
,
'
skip_env_freeze
'
]
if
args
[
x
]))
# If any of these arguments are set, present a warning.
if
not_reproducible_args
:
print
(
'
WARNING: One or more command line arguments ({}) may prevent
'
'
this specific correction result from being reproducible based
'
'
on its metadata. It may not be possible to restore identical
'
'
output data files when they have been deleted or lost. Please
'
'
ensure that the data retention policy of the chosen storage
'
'
location is sufficient for your
'
'
needs.
'
.
format
(
'
,
'
.
join
(
not_reproducible_args
)))
try
:
input
(
'
Press ENTER to continue or CTRL+C to abort...
'
)
except
KeyboardInterrupt
:
# Catch the interrupt and silently exit.
sys
.
exit
(
0
)
reproducible
=
False
else
:
reproducible
=
True
try
:
nb_info
=
notebooks
[
detector
][
caltype
]
except
KeyError
:
...
...
@@ -1100,6 +1128,7 @@ def run():
metadata
[
"
pycalibration-version
"
]
=
version
metadata
[
"
report-path
"
]
=
f
"
{
report_to
}
.pdf
"
if
report_to
\
else
'
# REPORT SKIPPED #
'
metadata
[
'
reproducible
'
]
=
reproducible
metadata
[
"
concurrency
"
]
=
{
'
parameter
'
:
concurrency_par
,
'
default
'
:
concurrency_defval
,
...
...
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