Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EW control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
whuie2
EW control
Commits
677a5c3a
Commit
677a5c3a
authored
3 years ago
by
whooie
Browse files
Options
Downloads
Patches
Plain Diff
rearrange arg order for Sequence.*c_data; add a __iadd__ method for Sequence
parent
00cc796e
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
lib/structures.py
+21
-10
21 additions, 10 deletions
lib/structures.py
with
21 additions
and
10 deletions
lib/structures.py
+
21
−
10
View file @
677a5c3a
...
@@ -433,8 +433,8 @@ class Sequence:
...
@@ -433,8 +433,8 @@ class Sequence:
return
self
return
self
@staticmethod
@staticmethod
def
from_digital_data
(
T
:
list
[
float
],
S
:
list
[
int
]
,
board
:
int
,
def
from_digital_data
(
board
:
int
,
connector
:
int
,
mask
:
int
,
connector
:
int
,
mask
:
int
)
->
Sequence
:
T
:
list
[
float
],
S
:
list
[
int
]
)
->
Sequence
:
"""
"""
Construct a Sequence of digital events on `board`, `connector` with
Construct a Sequence of digital events on `board`, `connector` with
`mask` from lists of times and states. `mask` is applied globally to all
`mask` from lists of times and states. `mask` is applied globally to all
...
@@ -464,8 +464,8 @@ class Sequence:
...
@@ -464,8 +464,8 @@ class Sequence:
])
])
@staticmethod
@staticmethod
def
from_digital1_data
(
T
:
list
[
float
],
S
:
list
[
int
]
,
board
:
int
,
def
from_digital1_data
(
board
:
int
,
connector
:
int
,
channel
:
int
,
connector
:
int
,
channel
:
int
)
->
Sequence
:
T
:
list
[
float
],
S
:
list
[
int
]
)
->
Sequence
:
"""
"""
Construct a Sequence of digital events on `board`, `connector`,
Construct a Sequence of digital events on `board`, `connector`,
`channel` from lists of times and states.
`channel` from lists of times and states.
...
@@ -490,8 +490,8 @@ class Sequence:
...
@@ -490,8 +490,8 @@ class Sequence:
])
])
@staticmethod
@staticmethod
def
from_digitalc_data
(
T
:
list
[
float
],
S
:
list
[
int
]
,
def
from_digitalc_data
(
conn
:
DigitalConnection
,
conn
:
DigitalConnection
,
with_delay
:
bool
=
True
)
->
Sequence
:
T
:
list
[
float
],
S
:
list
[
int
]
,
with_delay
:
bool
=
True
)
->
Sequence
:
"""
"""
Construct a Sequence of digital events on `conn` from lists of times and
Construct a Sequence of digital events on `conn` from lists of times and
states, optionally using delay information from `conn`.
states, optionally using delay information from `conn`.
...
@@ -514,8 +514,8 @@ class Sequence:
...
@@ -514,8 +514,8 @@ class Sequence:
)
)
@staticmethod
@staticmethod
def
from_analog_data
(
T
:
list
[
float
],
V
:
list
[
float
],
board
:
int
,
def
from_analog_data
(
board
:
int
,
channel
:
int
,
channel
:
int
)
->
Sequence
:
T
:
list
[
float
],
V
:
list
[
float
]
)
->
Sequence
:
"""
"""
Construct a Sequence of analog events on `board`, `channel` from lists
Construct a Sequence of analog events on `board`, `channel` from lists
of times and voltages.
of times and voltages.
...
@@ -541,8 +541,8 @@ class Sequence:
...
@@ -541,8 +541,8 @@ class Sequence:
])
])
@staticmethod
@staticmethod
def
from_analogc_data
(
T
:
list
[
float
],
V
:
list
[
float
]
,
def
from_analogc_data
(
conn
:
AnalogConnection
,
conn
:
AnalogConnection
,
with_delay
:
bool
=
True
)
->
Sequence
:
T
:
list
[
float
],
V
:
list
[
float
]
,
with_delay
:
bool
=
True
)
->
Sequence
:
"""
"""
Construct a Sequence of analog events on `conn` from lists of times and
Construct a Sequence of analog events on `conn` from lists of times and
voltages, optionally using delay information from `conn`.
voltages, optionally using delay information from `conn`.
...
@@ -1100,6 +1100,17 @@ class Sequence:
...
@@ -1100,6 +1100,17 @@ class Sequence:
else
:
else
:
raise
NotImplemented
raise
NotImplemented
def
__iadd__
(
self
,
other
):
if
isinstance
(
other
,
Sequence
):
self
.
events
.
append
(
other
.
events
)
elif
isinstance
(
other
,
list
):
assert
all
(
isinstance
(
e
,
Event
)
and
e
.
time
is
not
None
for
e
in
other
),
\
"
__iadd__: all Events must have times
"
self
.
events
+=
other
else
:
raise
NotImplemented
def
join
(
self
,
other
:
Sequence
):
def
join
(
self
,
other
:
Sequence
):
assert
isinstance
(
other
,
Sequence
),
"
join: can only join Sequences
"
assert
isinstance
(
other
,
Sequence
),
"
join: can only join Sequences
"
return
self
+
other
return
self
+
other
...
...
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