obsplus.utils.testing module¶
Testing utilities for ObsPlus.
- class obsplus.utils.testing.ArchiveDirectory(path, starttime=None, endtime=None, sampling_rate=1, duration=3600, overlap=0, gaps=None, seed_ids=('TA.M17A..VHZ', 'TA.BOB..VHZ'))[source]¶
Bases:
object
class for creating a simple archive
- obsplus.utils.testing.assert_streams_almost_equal(st1, st2, basic_stats=True, atol=1e-05, rtol=1e-08, equal_nan=True, allow_off_by_one=False)[source]¶
Assert that two streams are almost equal else raise helpful exceptions.
- Parameters:
st1 (
Stream
) – The first streamst2 (
Stream
) – The second streambasic_stats (
bool
) – If True, only compare basic stats of the streams including: network, station, location, channel, starttime, endtimeatol (
float
) – The absolute tolerance parameterrtol (
float
) – The relative tolerance parameterequal_nan (
bool
) – If True evaluate NaNs as equalallow_off_by_one (
bool
) – If True, allow the arrays and time alignments to be off by one sample.
- Return type:
None
Notes
See numpy.allclose for description of atol and rtol paramter.
- Raises:
AssertionError if streams are not about equal. –