Skip to content

Fix/pipeline#114

Open
faux66 wants to merge 8 commits into
mainfrom
fix/pipeline
Open

Fix/pipeline#114
faux66 wants to merge 8 commits into
mainfrom
fix/pipeline

Conversation

@faux66
Copy link
Copy Markdown
Contributor

@faux66 faux66 commented May 25, 2026

  • Add new distribution generators (beta, gamma, lognormal, student, weibull, uniform) with generator classes in generators.py
  • Fix generate_beta default a=0.0 → a=1.0
  • Fix generate_lognorm — remove unnecessary np.sqrt(s)
  • Fix division by zero in generator
  • Add missing generate_uniform import
  • Add uniform hypothesis to Hypothesis enum
  • Filter abstract classes from criterion codes (common.py)
  • Replace if-elif with dict lookup in _get_criteria_config() (C901)

@faux66 faux66 marked this pull request as ready for review May 25, 2026 22:07
@faux66 faux66 requested review from alex98247 and f1i3g3 May 25, 2026 22:07
@faux66
Copy link
Copy Markdown
Contributor Author

faux66 commented May 25, 2026

Насколько я понимаю, тесты падают из-за pysatl-criterion = { version = "*", source = "testpypi" } в pyproject.toml, из-за этого же нельзя нормальным образом использовать критерион в эксперименте

@f1i3g3 f1i3g3 added bug Something isn't working python Pull requests that update python code 1.0.0 labels May 26, 2026
list[type[AbstractGoodnessOfFitStatistic]],
base_class.__subclasses__(),
)
valid_criteria_codes = [cls.code().split("_")[0] for cls in valid_criteria_types]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Лучше через

valid_criteria_codes = [
    cls.code().split("_")[0]
    for cls in valid_criteria_types
    if not inspect.isabstract(cls)
]

Comment on lines +162 to +163
valid_criteria_codes = [
cls.code().split("_")[0] for cls in valid_criteria_types if not getattr(cls, "__abstractmethods__", None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Написал отдельно

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

На мне расширить документацию тут

Comment on lines +245 to +254
_HYPOTHESIS_TO_BASE_CLASS: dict[Hypothesis, type[Any]] = {
Hypothesis.NORMAL: AbstractNormalityGofStatistic,
Hypothesis.EXPONENTIAL: AbstractExponentialityGofStatistic,
Hypothesis.WEIBULL: AbstractWeibullGofStatistic,
Hypothesis.GAMMA: AbstractGammaGofStatistic,
Hypothesis.BETA: AbstractBetaGofStatistic,
Hypothesis.LOGNORMAL: AbstractLogNormalGofStatistic,
Hypothesis.STUDENT: AbstractStudentGofStatistic,
Hypothesis.UNIFORM: AbstractUniformGofStatistic,
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вынести куда-нибудь повыше?

Comment on lines +220 to +239
elif hypothesis == Hypothesis.GAMMA:
hypothesis_generator = GammaGenerator()
generator_name = "GAMMAGENERATOR"
generator_parameters = [hypothesis_generator.alfa, hypothesis_generator.beta]
elif hypothesis == Hypothesis.BETA:
hypothesis_generator = BetaRVSGenerator()
generator_name = "BETARVSGENERATOR"
generator_parameters = [hypothesis_generator.a, hypothesis_generator.b]
elif hypothesis == Hypothesis.LOGNORMAL:
hypothesis_generator = LognormGenerator()
generator_name = "LOGNORMGENERATOR"
generator_parameters = [hypothesis_generator.s, hypothesis_generator.mu]
elif hypothesis == Hypothesis.STUDENT:
hypothesis_generator = TRVSGenerator(df=1)
generator_name = "TRVSGENERATOR"
generator_parameters = [hypothesis_generator.df]
elif hypothesis == Hypothesis.UNIFORM:
hypothesis_generator = UniformGenerator()
generator_name = "UNIFORMGENERATOR"
generator_parameters = [hypothesis_generator.a, hypothesis_generator.b]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут бы тоже обобщить в идеале.

@f1i3g3 f1i3g3 self-requested a review May 26, 2026 00:55
Copy link
Copy Markdown
Contributor

@f1i3g3 f1i3g3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кажется, ещё старые тесты валятся, а ещё надо будет новые добавить.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.0.0 bug Something isn't working python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants