def test_decompose_inventory(self): """Ensure an inventory (and children) can be decomposed.""" # Ensure the inventory is broken down inv = obspy.read_inventory() out = decompose(inv) assert len(out) > 1 # make sure some of the expected classes are there. assert {Network, Station, Inventory}.issubset(set(out)) # next test some of the subcomponents objs = (inv, inv[0], inv[0][0], inv[0][0][0]) for obj in objs: assert len(decompose(obj)) > 1
def test_decompose_catalog(self): """ensure the catalog, and friends, can be decomposed.""" test_cls = (ev.Catalog, ev.Event, ev.Origin, ev.Pick, ev.Amplitude) cat = obspy.read_events() for obj, _, _ in obsplus.utils.misc.yield_obj_parent_attr(cat): out = decompose(obj) if isinstance(obj, test_cls): assert len(out) > 1
def test_decompose_stream(self): """Ensure a stream is decomposed in a sensible way.""" out = decompose(obspy.read()) expected = {Stream, Trace, np.ndarray} assert expected.issubset(set(out))