Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
c866429c
Commit
c866429c
authored
3 years ago
by
Cain, Payton David
Browse files
Options
Downloads
Patches
Plain Diff
add test for handling empty stream
parent
99eeb2f4
No related branches found
Branches containing commit
Tags
1.0.6
Tags containing commit
2 merge requests
!146
Release CMO metadata to production
,
!136
return desired channels when no channels are found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/DerivedTimeseriesFactory_test.py
+13
-1
13 additions, 1 deletion
test/DerivedTimeseriesFactory_test.py
with
13 additions
and
1 deletion
test/DerivedTimeseriesFactory_test.py
+
13
−
1
View file @
c866429c
...
...
@@ -2,8 +2,9 @@ from typing import List
from
obspy
import
Stream
from
geomagio
import
DerivedTimeseriesFactory
,
TimeseriesUtility
from
geomagio
import
TimeseriesUtility
from
geomagio.algorithm
import
Algorithm
,
DeltaFAlgorithm
,
XYZAlgorithm
from
geomagio.DerivedTimeseriesFactory
import
DerivedTimeseriesFactory
,
get_missing
from
geomagio.iaga2002
import
StreamIAGA2002Factory
from
geomagio.edge
import
EdgeFactory
...
...
@@ -91,6 +92,17 @@ def test_get_timeseries():
assert
set
(
TimeseriesUtility
.
get_channels
(
timeseries
))
==
set
([
"
H
"
,
"
D
"
])
def
test_get_missing
():
"""
test.DerivedTimeseriesFactory_test.test_get_missing()
"""
desired
=
[
"
X
"
,
"
Y
"
,
"
D
"
,
"
G
"
]
assert
set
(
get_missing
(
input
=
Stream
(),
desired
=
desired
))
==
set
(
desired
)
desired
=
[
"
H
"
,
"
E
"
,
"
Z
"
,
"
F
"
]
timeseries
=
get_derived_timeseries
(
"
etc/filter/BOU20200101vsec.sec
"
,
desired
,
"
variation
"
,
"
second
"
)
assert
get_missing
(
input
=
timeseries
,
desired
=
desired
)
==
[]
def
get_derived_timeseries
(
url
:
str
,
channels
:
List
[
str
],
data_type
:
str
,
interval
:
str
)
->
Stream
:
...
...
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