Skip to content

GoodnessOfFitHypothesis documents dict support, but dict-based hypotheses are rejected #167

Todo

Description

@f1i3g3

Problem

src/pysatl_criterion/statistics/hypothesis.py — the GoodnessOfFitHypothesis docstring promises:

parameters : dict of str to float, ParameterValues, or None

But the constructor sets:

self.parameter_values = parameters if isinstance(parameters, ParameterValues) else None

and AbstractGoodnessOfFitStatistic.supports_hypothesis() (statistics/goodness_of_fit/goodness_of_fit_statistic.py) starts with:

values = hypothesis.parameter_values
return values is not None and any(...)

So a hypothesis constructed from a plain dict (explicitly allowed by the docstring) has parameter_values is None and always fails supports_hypothesis — which also breaks get_hypothesis_generator-style discovery flows for dict-based hypotheses.

This was already flagged in a review comment on PR #160 (2026-11-07) and is still present after the merge.

Suggestion

Either:

  • accept dict properly (wrap/convert into the statistic's ParameterizationDescriptor before capability checks), or
  • narrow the documented contract to ParameterValues | None and reject dict loudly at construction time.

A small regression test covering a dict-based hypothesis would pin the chosen behaviour.

Activity

  1. added
    bug
    documentation
    python
    on Nov 23, 2026
  2. added theissue type on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

1.1.0bugdocumentationpython

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions