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
179713a0
Commit
179713a0
authored
2 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Add script for testing repeat mechanism in webservice
parent
852ac9e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!695
[webservice] Support requests to repeat correction from myMdC
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/request_repeat.py
+32
-0
32 additions, 0 deletions
webservice/request_repeat.py
with
32 additions
and
0 deletions
webservice/request_repeat.py
0 → 100644
+
32
−
0
View file @
179713a0
"""
Send a request to repeat previous corrections.
The repeat mechanism is meant for if corrected data has been deleted,
but this script can also be used for testing.
"""
import
argparse
from
glob
import
glob
import
zmq
parser
=
argparse
.
ArgumentParser
(
description
=
'
Request repeat correction.
'
)
parser
.
add_argument
(
'
proposal
'
,
type
=
int
,
help
=
'
The proposal number
'
)
parser
.
add_argument
(
'
run
'
,
type
=
int
,
help
=
'
The run number
'
)
parser
.
add_argument
(
'
--endpoint
'
,
default
=
'
tcp://max-exfl016:5555
'
,
help
=
"
The ZMQ endpoint to connect to (max-exfl017 for testing)
"
)
args
=
parser
.
parse_args
()
prop_dir
=
glob
(
'
/gpfs/exfel/exp/*/*/p{:06d}
'
.
format
(
args
.
proposal
))[
0
]
instrument
,
cycle
=
prop_dir
.
split
(
'
/
'
)[
4
:
6
]
con
=
zmq
.
Context
()
socket
=
con
.
socket
(
zmq
.
REQ
)
con
=
socket
.
connect
(
args
.
endpoint
)
parm_list
=
[
"
repeat
"
,
"
0
"
,
instrument
,
cycle
,
f
'
{
args
.
proposal
:
06
d
}
'
,
str
(
args
.
run
)]
socket
.
send
(
repr
(
parm_list
).
encode
())
resp
=
socket
.
recv
()
print
(
resp
.
decode
())
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