def test_magnitude(self, dummy_mag): dummy_mag = dummy_mag.magnitudes[0] mag_df = station_magnitudes_to_df(dummy_mag) assert len(mag_df) == len(dummy_mag.station_magnitude_contributions) sm = mag_df.iloc[0] assert sm.magnitude_id == dummy_mag.resource_id.id
def test_empty_catalog(self, empty_cat): """ ensure returns empty df with required columns """ df = station_magnitudes_to_df(empty_cat) assert isinstance(df, pd.DataFrame) assert not len(df) assert set(df.columns).issubset(STATION_MAGNITUDE_COLUMNS)
def read_sms_output(self, dummy_cat): return station_magnitudes_to_df(dummy_cat)