From 2c253c6dd3aa67f9f38f2436f85d9c2737d28498 Mon Sep 17 00:00:00 2001 From: Derrick Chambers Date: Wed, 18 Dec 2024 17:10:57 -0800 Subject: [PATCH] finish segy test --- dascore/io/segy/utils.py | 4 +++- tests/test_io/test_segy/test_segy.py | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dascore/io/segy/utils.py b/dascore/io/segy/utils.py index 2a4e5216..9ca76361 100644 --- a/dascore/io/segy/utils.py +++ b/dascore/io/segy/utils.py @@ -38,7 +38,9 @@ def twos_comp(bytes_): def _get_segy_version(fp): """ - Return True if file pointer contains segy formatted data. + Determine if file handle contains segy data. + + Returns (segy, version) if so else False. Based on ObsPy's implementation writen by Lion Krischer. https://github.com/obspy/obspy/blob/master/obspy/io/segy/core.py diff --git a/tests/test_io/test_segy/test_segy.py b/tests/test_io/test_segy/test_segy.py index 435b781c..b360875a 100644 --- a/tests/test_io/test_segy/test_segy.py +++ b/tests/test_io/test_segy/test_segy.py @@ -64,6 +64,8 @@ def test_can_get_format(self, channel_patch_path): def test_channel_patch_round_trip(self, channel_patch_path, channel_patch): """The channel patch should round trip.""" patch1 = channel_patch - patch2 = dc.spool(channel_patch_path)[0] - + patch2 = dc.spool(channel_patch_path)[0].transpose(*patch1.dims) + # We really don't have a way to transport attributes yet, so we + # just check that data and coords are equal. assert np.allclose(patch1.data, patch2.data) + assert patch1.coords == patch2.coords