Skip to content

Commit

Permalink
update tests by following other successful PR
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanfufeng committed Sep 30, 2024
1 parent 43adbe0 commit cb01a24
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ coverage:
project:
default:
target: auto
threshold: 0
threshold: 1
set_pending: yes
if_no_uploads: error
if_not_found: error
Expand Down
Binary file added tests/data/acc/CIHEC__BHN___2022002.ms
Binary file not shown.
7 changes: 5 additions & 2 deletions tests/test_cross_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ def get_inventory(self, timespan: DateTimeRange, station: Station) -> obspy.Inve
@pytest.mark.parametrize("substack", [True, False])
@pytest.mark.parametrize("substack_len", [1, 2])
@pytest.mark.parametrize("inc_hours", [0, 24])
def test_correlation(rm_resp: RmResp, cc_method: CCMethod, substack: bool, substack_len: int, inc_hours: int):
@pytest.mark.parametrize("dpath", ["./data/cc", "./data/acc"])
def test_cross_correlation(
rm_resp: RmResp, cc_method: CCMethod, substack: bool, substack_len: int, inc_hours: int, dpath: str
):
config = ConfigParameters()
config.samp_freq = 1.0
config.rm_resp = rm_resp
Expand All @@ -90,7 +93,7 @@ def test_correlation(rm_resp: RmResp, cc_method: CCMethod, substack: bool, subst
if substack:
config.substack = substack
config.substack_len = substack_len * config.cc_len
path = os.path.join(os.path.dirname(__file__), "./data/cc")
path = os.path.join(os.path.dirname(__file__), dpath)

raw_store = SCEDCS3DataStore(path, MockCatalogMock())
ts = raw_store.get_timespans()
Expand Down
4 changes: 3 additions & 1 deletion tests/test_noise_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ def test_detrend(data: np.ndarray):

@pytest.mark.parametrize("freq_norm", [FreqNorm.NO, FreqNorm.RMA])
@pytest.mark.parametrize("time_norm", [TimeNorm.ONE_BIT, TimeNorm.RMA])
def test_noise_processing(time_norm: TimeNorm, freq_norm: FreqNorm):
@pytest.mark.parametrize("smoothspect_N", [10, 1])
def test_noise_processing(time_norm: TimeNorm, freq_norm: FreqNorm, smoothspect_N: int):
config = ConfigParameters()
config.time_norm = time_norm
config.freq_norm = freq_norm
config.smoothspect_N = smoothspect_N
dataS = np.random.random([2, 500])
noise_processing(config, dataS)

Expand Down

0 comments on commit cb01a24

Please sign in to comment.