Skip to content
Snippets Groups Projects
Commit e2b2eb85 authored by Jeremy M Fee's avatar Jeremy M Fee
Browse files

Merge branch 'get-channels=None' into 'master'

return desired channels when no channels are found

See merge request !136
parents 8b89c3a9 dad3c0a3
No related branches found
No related tags found
2 merge requests!146Release CMO metadata to production,!136return desired channels when no channels are found
Pipeline #69000 passed
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"name": "geomag-algorithms", "name": "geomag-algorithms",
"organization": "U.S. Geological Survey", "organization": "U.S. Geological Survey",
"description": "Library for processing Geomagnetic timeseries data.", "description": "Library for processing Geomagnetic timeseries data.",
"version": "1.4.0", "version": "1.4.1",
"status": "Development", "status": "Development",
"permissions": { "permissions": {
......
...@@ -17,7 +17,7 @@ packages = [ ...@@ -17,7 +17,7 @@ packages = [
{include = "geomagio" } {include = "geomagio" }
] ]
repository="https://code.usgs.gov/ghsc/geomag/geomag-algorithms" repository="https://code.usgs.gov/ghsc/geomag/geomag-algorithms"
version = "1.4.0" version = "1.4.1"
[tool.poetry.dependencies] [tool.poetry.dependencies]
......
...@@ -2,8 +2,9 @@ from typing import List ...@@ -2,8 +2,9 @@ from typing import List
from obspy import Stream from obspy import Stream
from geomagio import DerivedTimeseriesFactory, TimeseriesUtility from geomagio import TimeseriesUtility
from geomagio.algorithm import Algorithm, DeltaFAlgorithm, XYZAlgorithm from geomagio.algorithm import Algorithm, DeltaFAlgorithm, XYZAlgorithm
from geomagio.DerivedTimeseriesFactory import DerivedTimeseriesFactory, get_missing
from geomagio.iaga2002 import StreamIAGA2002Factory from geomagio.iaga2002 import StreamIAGA2002Factory
from geomagio.edge import EdgeFactory from geomagio.edge import EdgeFactory
...@@ -91,6 +92,17 @@ def test_get_timeseries(): ...@@ -91,6 +92,17 @@ def test_get_timeseries():
assert set(TimeseriesUtility.get_channels(timeseries)) == set(["H", "D"]) 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( def get_derived_timeseries(
url: str, channels: List[str], data_type: str, interval: str url: str, channels: List[str], data_type: str, interval: str
) -> Stream: ) -> Stream:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment