def test_empty_catalog(self): """ ensure returns empty df with required columns """ empty_cat = ev.Catalog() df = magnitudes_to_dataframe(empty_cat) assert isinstance(df, pd.DataFrame) assert not len(df) assert set(df.columns).issubset(MAGNITUDE_COLUMNS)
def test_from_event_directory(self, event_directory): """Tests read magnitudes on event directory.""" df = magnitudes_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 = magnitudes_to_dataframe(default_ebank) assert isinstance(df, pd.DataFrame)
def test_from_file(self, event_file): """ Test for reading magnitudes from files. """ df = magnitudes_to_dataframe(event_file) assert isinstance(df, pd.DataFrame) assert len(df)
def read_mags_output(self, dummy_cat): """Convert dummy catalog to magnitude df.""" return magnitudes_to_dataframe(dummy_cat)