Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliby-mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Swain Lab
aliby
aliby-mirror
Commits
85040389
Commit
85040389
authored
2 years ago
by
Alán Muñoz
Browse files
Options
Downloads
Patches
Plain Diff
fix(signal): fringe case t_min < signal.t_interval
parent
27b9c3f6
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
src/agora/io/signal.py
+7
-5
7 additions, 5 deletions
src/agora/io/signal.py
with
7 additions
and
5 deletions
src/agora/io/signal.py
+
7
−
5
View file @
85040389
...
...
@@ -402,18 +402,20 @@ class Signal(BridgeH5):
return
int
(
self
.
tinterval
*
self
.
ntps
/
60
)
@property
def
switch_
fra
mes
(
self
)
->
t
.
List
[
int
]:
def
switch_
ti
mes
(
self
)
->
t
.
List
[
int
]:
switchtimes_name
=
"
switchtimes
"
switch
_fram
es
=
self
.
meta_h5
[
switchtimes_name
]
switch
es_minut
es
=
self
.
meta_h5
[
switchtimes_name
]
return
[
tp
for
tp
in
switch_frames
if
tp
and
tp
<
self
.
max_span
t_min
for
t_min
in
switches_minutes
if
t_min
and
t_min
<
self
.
max_span
]
# Cover for t0 switches
@property
def
stages_span
(
self
)
->
t
.
Tuple
[
t
.
Tuple
[
str
,
int
],
...]:
# Return consecutive stages and their corresponding number of time-points
transition_tps
=
(
0
,
*
self
.
switch_
fra
mes
,
self
.
max_span
)
transition_tps
=
(
0
,
*
self
.
switch_
ti
mes
,
self
.
max_span
)
spans
=
[
end
-
start
for
start
,
end
in
zip
(
transition_tps
[:
-
1
],
transition_tps
[
1
:])
...
...
@@ -425,7 +427,7 @@ class Signal(BridgeH5):
def
stages_span_tp
(
self
)
->
t
.
Tuple
[
t
.
Tuple
[
str
,
int
],
...]:
return
tuple
(
[
(
name
,
t_min
//
self
.
tinterval
*
60
)
(
name
,
(
t_min
*
60
)
//
self
.
tinterval
)
for
name
,
t_min
in
self
.
stages_span
]
)
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