Beispiel #1
0
def test_valid_spearman_threshold(threshold, criterion):
    config_data = {"fcluster": {"criterion": criterion, "threshold": threshold}}
    hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #2
0
def test_invalid_linkage_metric(metric):
    config_data = {"linkage": {"metric": metric}}
    with pytest.raises(pydantic.ValidationError):
        hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #3
0
def test_default_linkage_metric():
    config_data = {}
    config = hierarchical_config.HierarchicalConfig(**config_data)
    assert "euclidean" == config.linkage.metric
Beispiel #4
0
def test_default_linkage_method():
    config_data = {}
    config = hierarchical_config.HierarchicalConfig(**config_data)
    assert config.linkage.method == "average"
Beispiel #5
0
def test_valid_linkage_metric(metric):
    config_data = {"linkage": {"metric": metric}}
    hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #6
0
def test_valid_linkage_method(method):
    config_data = {"linkage": {"method": method}}
    hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #7
0
def test_default_fcluster_depth():
    config = hierarchical_config.HierarchicalConfig()
    assert config.fcluster.depth == 2
Beispiel #8
0
def test_invalid_depth(depth):
    config_data = {"fcluster": {"depth": depth}}
    with pytest.raises(pydantic.ValidationError):
        hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #9
0
def test_valid_depth(depth):
    config_data = {"fcluster": {"depth": depth}}
    hierarchical_config.HierarchicalConfig(**config_data)
Beispiel #10
0
def test_default_spearman_threshold(criterion, default_threshold):
    config_data = {"fcluster": {"criterion": criterion}}
    config = hierarchical_config.HierarchicalConfig(**config_data)

    assert config.fcluster.threshold == default_threshold