def test_empty_catalog(self): """ ensure returns empty df with required columns """ empty_cat = ev.Catalog() df = arrivals_to_dataframe(empty_cat) assert isinstance(df, pd.DataFrame) assert not len(df) assert set(df.columns).issubset(ARRIVAL_COLUMNS)
def test_arrivals_from_origin(self, dummy_cat): """ tests for specifically extracting arrivals from origin objects """ origin = dummy_cat[0].origins[0] df = arrivals_to_dataframe(origin) assert len(df) == len(origin.arrivals)
def test_from_event_directory(self, event_directory): """Test for extracting info from a directory of events.""" df = arrivals_to_dataframe(event_directory) assert len(df) assert isinstance(df, pd.DataFrame)
def test_from_event_bank(self, default_ebank): """ Ensure event banks can be used to get dataframes. """ df = arrivals_to_dataframe(default_ebank) assert isinstance(df, pd.DataFrame)
def test_from_file(self, event_file): """ test for reading arrivals from files. """ df = arrivals_to_dataframe(event_file) assert isinstance(df, pd.DataFrame) assert len(df)
def test_no_origin(self, no_origin): """ ensure returns empty df with required columns """ df = arrivals_to_dataframe(no_origin) assert isinstance(df, pd.DataFrame) assert not len(df) assert set(df.columns).issubset(ARRIVAL_COLUMNS)
def read_arr_output(self, dummy_cat): """Read the dummy_catalog into an arrival dataframe.""" return arrivals_to_dataframe(dummy_cat)