MCPcopy Index your code
hub / github.com/stumpy-dev/stumpy / test_match_isconstant

Function test_match_isconstant

tests/test_motifs.py:452–500  ·  view source on GitHub ↗
(Q, T)

Source from the content-addressed store, hash-verified

450
451@pytest.mark.parametrize("Q, T", test_data)
452def test_match_isconstant(Q, T):
453 m = Q.shape[0]
454 excl_zone = int(np.ceil(m / 4))
455 max_distance = 0.3
456
457 T_subseq_isconstant = functools.partial(
458 naive.isconstant_func_stddev_threshold, quantile_threshold=0.05
459 )
460
461 left = naive_match(
462 Q,
463 T,
464 excl_zone,
465 max_distance=max_distance,
466 T_subseq_isconstant=T_subseq_isconstant,
467 )
468
469 right = match(
470 Q,
471 T,
472 max_matches=None,
473 max_distance=lambda D: max_distance, # also test lambda functionality
474 T_subseq_isconstant=T_subseq_isconstant,
475 )
476
477 npt.assert_almost_equal(left, right)
478
479 # Test for when Q is constant
480 Q_subseq_isconstant = np.array([True])
481
482 left = naive_match(
483 Q,
484 T,
485 excl_zone,
486 max_distance=max_distance,
487 T_subseq_isconstant=T_subseq_isconstant,
488 Q_subseq_isconstant=Q_subseq_isconstant,
489 )
490
491 right = match(
492 Q,
493 T,
494 max_matches=None,
495 max_distance=lambda D: max_distance, # also test lambda functionality
496 T_subseq_isconstant=T_subseq_isconstant,
497 Q_subseq_isconstant=Q_subseq_isconstant,
498 )
499
500 npt.assert_almost_equal(left, right)
501
502
503@pytest.mark.parametrize("Q, T", test_data)

Callers

nothing calls this directly

Calls 2

matchFunction · 0.90
naive_matchFunction · 0.85

Tested by

no test coverage detected