Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
bliss
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
483
Issues
483
List
Boards
Labels
Service Desk
Milestones
Jira
Jira
Merge Requests
126
Merge Requests
126
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Bliss
bliss
Commits
dffa2df3
Commit
dffa2df3
authored
Feb 07, 2018
by
Vincent Michel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix PEPU scans after hardware tests
parent
c3302228
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
5 deletions
+22
-5
bliss/controllers/pepu.py
bliss/controllers/pepu.py
+6
-1
bliss/scanning/acquisition/pepu.py
bliss/scanning/acquisition/pepu.py
+1
-1
tests/controllers_hw/pepu.py
tests/controllers_hw/pepu.py
+13
-2
tests/scans/test_pepu_scans.py
tests/scans/test_pepu_scans.py
+2
-1
No files found.
bliss/controllers/pepu.py
View file @
dffa2df3
...
...
@@ -537,7 +537,9 @@ class Stream(object):
array
.
dtype
=
[(
source
,
array
.
dtype
)
for
source
in
self
.
info
.
sources
]
return
array
def
idata
(
self
,
n
):
def
idata
(
self
,
n
=
None
):
if
n
is
None
:
n
=
self
.
nb_points
while
n
>
0
:
data
=
self
.
read
()
n
-=
data
.
shape
[
0
]
...
...
@@ -657,6 +659,9 @@ class PEPU(object):
self
.
remove_stream
(
name
)
elif
name
in
self
.
streams
:
raise
ValueError
(
'Stream {0!r} already exists'
.
format
(
name
))
# Hack: the PEPU does NOT preserve the source order
if
sources
:
sources
=
sorted
(
sources
)
info
=
StreamInfo
(
name
,
active
,
scope
,
trigger
,
frequency
,
nb_points
,
sources
)
return
self
.
_create_stream
(
info
)
...
...
bliss/scanning/acquisition/pepu.py
View file @
dffa2df3
...
...
@@ -116,7 +116,7 @@ class PepuAcquisitionDevice(AcquisitionDevice):
def
reading
(
self
):
"""Spawn by the chain."""
for
data
in
self
.
stream
.
idata
():
for
data
in
self
.
stream
.
idata
(
self
.
npoints
):
if
data
:
self
.
publish
(
data
)
...
...
tests/controllers_hw/pepu.py
View file @
dffa2df3
...
...
@@ -8,6 +8,8 @@ Run with:
"""
import
pytest
from
bliss.common
import
scans
from
bliss.controllers.pepu
import
PEPU
,
Signal
,
Trigger
pytestmark
=
pytest
.
mark
.
pepu
...
...
@@ -89,5 +91,14 @@ def test_streams_acquisition(pepu, acquisitions, blocks, block_size):
# Read block
assert
stream
.
nb_points_ready
==
block_size
data
=
stream
.
read
(
n
=
block_size
)
expected
=
[[
1.5
,
-
1.5
]]
*
block_size
assert
data
.
tolist
()
==
expected
assert
data
[
'CALC1'
].
tolist
()
==
[
1.5
]
*
block_size
assert
data
[
'CALC2'
].
tolist
()
==
[
-
1.5
]
*
block_size
def
test_timescan
(
pepu
):
scan
=
scans
.
timescan
(
0.1
,
pepu
.
counters
.
CALC1
,
pepu
.
counters
.
CALC2
,
npoints
=
3
,
return_scan
=
True
,
save
=
False
)
data
=
scans
.
get_data
(
scan
)
assert
data
[
'CALC1'
].
tolist
()
==
[
1.5
]
*
3
assert
data
[
'CALC2'
].
tolist
()
==
[
-
1.5
]
*
3
tests/scans/test_pepu_scans.py
View file @
dffa2df3
...
...
@@ -24,7 +24,8 @@ def pepu():
trigger
=
gevent
.
queue
.
Queue
()
def
idata
():
def
idata
(
n
):
assert
n
==
len
(
pepu
.
mock_points
)
for
point
in
pepu
.
mock_points
:
data
=
np
.
array
(
point
)
data
.
dtype
=
[(
counter
.
name
,
float
)
for
counter
in
pepu
.
counters
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment