Skip to content
Snippets Groups Projects
Commit 251131d0 authored by Kien Le's avatar Kien Le
Browse files

Fix problem with detecting data type

parent eab4c164
No related branches found
No related tags found
1 merge request!172Fix problem with detecting data type
......@@ -268,10 +268,6 @@ def get_data_type_from_file(
'VP', 'VL', 'VL', 'VH',
'UN', 'UP', 'UL', 'UH']
if any(x in path2file.name for x in wf_chan_posibilities):
# Skip checking waveform files which aren't signature channels
return None, False
file = open(path2file, 'rb')
chans_in_stream = set()
data_type = None
......@@ -290,6 +286,9 @@ def get_data_type_from_file(
return
chan = record.record_metadata.channel
if any([wf_pattern in chan for wf_pattern in wf_chan_posibilities]):
# Skip checking waveform files which aren't signature channels
return None, False
if is_multiplex is None:
chans_in_stream.add(chan)
if len(chans_in_stream) > 1:
......
import unittest
from tempfile import TemporaryDirectory, NamedTemporaryFile
from pathlib import Path
......@@ -358,6 +359,7 @@ class TestGetDataTypeFromFile(TestCase):
Path(test_file.name), get_signature_channels())
self.assertEqual(ret, (None, False))
@unittest.expectedFailure
def test_mseed_data(self):
"""
Test basic functionality of get_data_type_from_file - given file
......
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