Skip to content

Add get_available_criteria#131

Merged
alex98247 merged 1 commit into
mainfrom
get_available_criteria
Jul 22, 2026
Merged

Add get_available_criteria#131
alex98247 merged 1 commit into
mainfrom
get_available_criteria

Conversation

@alex98247

Copy link
Copy Markdown
Contributor

Summary

Add get_available_criteria for returning available goodness-of-fit statistic classes and move short-code lookup to get_available_criteria_codes.

Quick changelog

  • Renamed the previous get_available_criteria behavior to get_available_criteria_codes.
  • Added a new get_available_criteria method returning concrete AbstractGoodnessOfFitStatistic subclasses.
  • Added explicit loading of goodness-of-fit statistic modules before subclass discovery.
  • Updated statistic utility tests for both class lookup and short-code lookup.

What's new?

This PR separates two related utility behaviors:

  • get_available_criteria(distribution) now returns the available non-abstract goodness-of-fit statistic classes for the requested distribution.
  • get_available_criteria_codes(distribution) preserves the previous behavior and returns the list of statistic short codes.

The implementation also explicitly imports pysatl_criterion.statistics.goodness_of_fit before walking AbstractGoodnessOfFitStatistic.__subclasses__(), so criteria discovery no longer depends on prior import order.

Validation added in tests/utils/test_statistic.py checks that:

  • short-code results remain unchanged for supported distributions;
  • returned criteria are subclasses of AbstractGoodnessOfFitStatistic;
  • returned criteria are concrete, non-abstract classes;
  • returned criteria match the requested distribution.

@alex98247 alex98247 self-assigned this Jul 22, 2026
@alex98247
alex98247 merged commit cda0213 into main Jul 22, 2026
7 checks passed
@alex98247
alex98247 deleted the get_available_criteria branch July 22, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant