Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sgn-ts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
greg
sgn-ts
Commits
231f79b7
Commit
231f79b7
authored
4 months ago
by
Jameson Graef Rollins
Browse files
Options
Downloads
Patches
Plain Diff
fix missed uses of numpy.concat
parent
bc6f1bc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!78
fix missed uses of numpy.concat
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_tsbuffer.py
+4
-4
4 additions, 4 deletions
tests/test_tsbuffer.py
with
4 additions
and
4 deletions
tests/test_tsbuffer.py
+
4
−
4
View file @
231f79b7
...
...
@@ -299,7 +299,7 @@ def test_add_self_torch(torch_a, a_params):
def
test_add_overlapping_torch
(
torch_a
,
torch_b
):
# At srate of 1024 b's offset of 1024
# is 64 samples behind that of a
data
=
torch
.
concat
(
data
=
torch
.
concat
enate
(
[
torch
.
ones
(
64
),
2
*
torch
.
ones
(
960
),
...
...
@@ -317,7 +317,7 @@ def test_add_overlapping_torch(torch_a, torch_b):
def
test_add_different_shape_torch
(
torch_a
,
torch_g
):
# g starts 512 samples after a
# and is 2048 samples long
data
=
torch
.
concat
([
torch
.
ones
(
512
),
2
*
torch
.
ones
(
512
),
torch
.
ones
(
1536
)])
data
=
torch
.
concat
enate
([
torch
.
ones
(
512
),
2
*
torch
.
ones
(
512
),
torch
.
ones
(
1536
)])
correct
=
SeriesBuffer
(
offset
=
0
,
sample_rate
=
1024
,
shape
=
(
2560
,),
data
=
data
)
assert
torch_a
+
torch_g
==
correct
torch_a
+=
torch_g
...
...
@@ -329,7 +329,7 @@ def test_add_disjoint_torch(torch_a, torch_f):
# 4096 samples after offset of 0
# since a has shape 1024 that leaves 3072 zeros
# between a and f
data
=
torch
.
concat
([
torch
.
ones
(
1024
),
torch
.
zeros
(
3072
),
torch
.
ones
(
1024
)])
data
=
torch
.
concat
enate
([
torch
.
ones
(
1024
),
torch
.
zeros
(
3072
),
torch
.
ones
(
1024
)])
correct
=
SeriesBuffer
(
offset
=
0
,
sample_rate
=
1024
,
shape
=
data
.
shape
,
data
=
data
)
assert
torch_a
+
torch_f
==
correct
torch_a
+=
torch_f
...
...
@@ -341,7 +341,7 @@ def test_add_nonflat_torch(torch_c, torch_d):
# 128 samples after offset of 1028
# since c and d have time shape 1024
# There are 128 samples on either side
data
=
torch
.
concat
([
torch
.
ones
(
128
),
2
*
torch
.
ones
(
896
),
torch
.
ones
(
128
)])
data
=
torch
.
concat
enate
([
torch
.
ones
(
128
),
2
*
torch
.
ones
(
896
),
torch
.
ones
(
128
)])
data
=
data
[
None
,
:]
data
=
data
.
repeat
((
2
,
1
))
correct
=
SeriesBuffer
(
offset
=
2048
,
sample_rate
=
1024
,
shape
=
data
.
shape
,
data
=
data
)
...
...
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