swiss-seismological-service / SeismoStats

https://seismostats.readthedocs.io
GNU Affero General Public License v3.0
7 stars 3 forks source link

Add Tests to Catalog methods #129

Open schmidni opened 4 months ago

schmidni commented 4 months ago

Catalog.estimate_mc and Catalog.estimate_b need to be tested.

Since the methods estimate_b and mc_ks already should be tested, you only need to check whether they are called correctly, depending on the various combinations of input.

As a minimal example, there is already a test in seismicity/tests/test_catalog.py -> test_catalog_bin which tests whether the bin_to_precision method is correctly called. You will need to do some more validation on the input parameters. (delta_m = None or not, and so on).

martahan commented 3 months ago

There's a branch with this now, I added some of the tests, but for estimate_b and mc, it only checks error raising. I am not sure how much we should add and what is redundant due to already existing tests, anyways to be continued. I also changed some things about the underlying binning function and the corresponding test.