Skip to content

Commit

Permalink
testing: adding testing functions for Mc and b estimation as Catalog …
Browse files Browse the repository at this point in the history
…method, but only for errors
  • Loading branch information
martahan committed Jun 7, 2024
1 parent a9b6440 commit cbd08fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions seismostats/seismicity/tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ def test_catalog_bin_none():
catalog.bin_magnitudes()


def test_catalog_estimate_mc():
catalog = Catalog({'magnitude': [0.235, -0.235, 4.499, 4.5, 6, 0.1, 1.6]})

with pytest.raises(ValueError):
catalog.estimate_mc()


def test_catalog_estimate_b():
catalog = Catalog({'magnitude': [0.235, -0.235, 4.499, 4.5, 6, 0.1, 1.6]})

with pytest.raises(ValueError):
catalog.estimate_b(None, None)
catalog.estimate_b(mc=1.0, None)
catalog.estimate_b(mc=None, delta_m=0.1)


def test_to_quakeml():
xml_file = os.path.join(PATH_RESOURCES, 'quakeml_data.xml')
with open(xml_file, 'r') as file:
Expand Down

0 comments on commit cbd08fc

Please sign in to comment.