예제 #1
0
 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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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)
예제 #5
0
 def read_mags_output(self, dummy_cat):
     """Convert dummy catalog to magnitude df."""
     return magnitudes_to_dataframe(dummy_cat)