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
2d910277
Commit
2d910277
authored
4 months ago
by
Yun-Jing Huang
Browse files
Options
Downloads
Patches
Plain Diff
remove internal pad
parent
ef1e5cf9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!80
remove internal pad
Pipeline
#685919
passed
4 months ago
Stage: build
Stage: test
Stage: .post
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sgnts/base/__init__.py
+6
-13
6 additions, 13 deletions
src/sgnts/base/__init__.py
src/sgnts/sinks/__init__.py
+6
-17
6 additions, 17 deletions
src/sgnts/sinks/__init__.py
with
12 additions
and
30 deletions
src/sgnts/base/__init__.py
+
6
−
13
View file @
2d910277
...
...
@@ -4,14 +4,7 @@ from dataclasses import dataclass
from
math
import
isinf
from
typing
import
Optional
,
Union
from
sgn.base
import
(
InternalPad
,
SinkElement
,
SinkPad
,
SourceElement
,
SourcePad
,
TransformElement
,
)
from
sgn.base
import
SinkElement
,
SinkPad
,
SourceElement
,
SourcePad
,
TransformElement
from
sgnts.base.array_ops
import
Array
,
ArrayBackend
,
NumpyBackend
from
sgnts.base.audioadapter
import
Audioadapter
...
...
@@ -251,7 +244,7 @@ class _TSTransSink:
return
preparedbufs
def
internal
(
self
,
pad
:
InternalPad
)
->
None
:
def
internal
(
self
)
->
None
:
"""
Align buffers from all the sink pads.
If AdapterConfig is provided, perform the requested
...
...
@@ -379,8 +372,8 @@ class TSTransform(TransformElement, _TSTransSink):
TransformElement
.
__post_init__
(
self
)
_TSTransSink
.
__post_init__
(
self
)
def
internal
(
self
,
pad
:
InternalPad
):
_TSTransSink
.
internal
(
self
,
pad
)
def
internal
(
self
):
_TSTransSink
.
internal
(
self
)
def
transform
(
self
,
pad
:
SourcePad
)
->
TSFrame
:
"""
The transform function must be provided by the subclass.
...
...
@@ -409,8 +402,8 @@ class TSSink(SinkElement, _TSTransSink):
SinkElement
.
__post_init__
(
self
)
_TSTransSink
.
__post_init__
(
self
)
def
internal
(
self
,
pad
:
InternalPad
):
_TSTransSink
.
internal
(
self
,
pad
)
def
internal
(
self
):
_TSTransSink
.
internal
(
self
)
@dataclass
...
...
This diff is collapsed.
Click to expand it.
src/sgnts/sinks/__init__.py
+
6
−
17
View file @
2d910277
from
dataclasses
import
dataclass
import
numpy
as
np
from
sgn.base
import
InternalPad
from
sgnts.base
import
Time
,
TSSink
...
...
@@ -17,14 +16,9 @@ class FakeSeriesSink(TSSink):
verbose
:
bool
=
False
def
internal
(
self
,
pad
:
InternalPad
)
->
None
:
"""
Print frames if verbose.
Args:
pad:
InternalPad, the internal pad
"""
super
().
internal
(
pad
)
def
internal
(
self
)
->
None
:
"""
Print frames if verbose.
"""
super
().
internal
()
for
sink_pad
in
self
.
sink_pads
:
frame
=
self
.
preparedframes
[
sink_pad
]
if
frame
.
EOS
:
...
...
@@ -82,14 +76,9 @@ class DumpSeriesSink(TSSink):
with
open
(
self
.
fname
,
"
a
"
)
as
f
:
np
.
savetxt
(
f
,
out
)
def
internal
(
self
,
pad
:
InternalPad
)
->
None
:
"""
Write out time-series data.
Args:
pad:
InternalPad
"""
super
().
internal
(
pad
)
def
internal
(
self
)
->
None
:
"""
Write out time-series data.
"""
super
().
internal
()
sink_pad
=
self
.
sink_pad
frame
=
self
.
preparedframes
[
sink_pad
]
if
frame
.
EOS
:
...
...
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