refactor(generator): migrate univariate specs to pysatl-core distribtions#5
Open
Desiment wants to merge 3 commits into
Open
refactor(generator): migrate univariate specs to pysatl-core distribtions#5Desiment wants to merge 3 commits into
Desiment wants to merge 3 commits into
Conversation
Replace legacy univariate generator specs with a unified core-backed distribution spec, route univariate sampling through pysatl-core UNURAN, and update docs, notebooks, and tests to match the new API.
LeonidElkin
reviewed
May 20, 2026
* Current UNURAN sampling strategy unstable for sampling data with large means and deviations. Set temporarily default strategy. * Ensure correct mypy behavior by passing strategies explicily
4fbc962 to
46cf41d
Compare
iraedeus
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate
pysatl_cpd/data/generatorunivariate sampling/specs from SciPy-style classes (NormalSpec,UniformSpec, etc.) topysatl-corewithUnivariateDistributionSpec, YAML support for optional parameterization, and UNURAN sampling; then update docs/notebooks and satisfy hooks/coverage.Description of incoming changes:
kind: normal|uniform|exponentialshapes translated into the new unified spec.pysatl-corefamily names/parameter names:UnivariateDistributionSpec("Normal", "meanStd", mu=..., sigma=...)UnivariateDistributionSpec("ContinuousUniform", "standard", lower_bound=..., upper_bound=...)UnivariateDistributionSpec("Exponential", "scale", beta=...)Detailied description
pysatl_cpd/data/generator/specs.pywithUnivariateDistributionSpec.pysatl_cpd/data/generator/config.py:kind: normal|uniform|exponentialnow map toUnivariateDistributionSpeckind: univariatewith optionalparametrization_namesupportedstudent_tremoved/rejectedpysatl_cpd/data/generator/segments/sampling.pytopysatl-core+DefaultUnuranSamplingStrategy.pysatl_cpd/data/generator/presets.pyto use unified specs.pysatl_cpd/data/generator/__init__.pyto remove old univariate classes.UnivariateDistributionSpec:tests/unit/data/generator/test_specs.pytests/unit/data/generator/test_config.pytests/unit/data/generator/segments/test_sampling.pytests/unit/data/generator/test_series.pytests/unit/data/generator/test_dataset_generator.pytests/unit/data/dataset/test_dataset_split.pytests/regression/test_seeded_generators.pyxfailbecausepysatl-coreUNURAN sampling lacks exposed seed control.NormalSpec(...)style toUnivariateDistributionSpec(...)in multiple__init__.pyfiles across the codebase.notebooks/user_guide/02-generator-api.ipynbnotebooks/user_guide/04-core-api-visualization.ipynbpoetry run pytest tests/unit/data/generator tests/unit/data/dataset/test_dataset_split.py tests/regression/test_seeded_generators.py→ 97 passed, 1 xfailedpoetry run ruff check→ passedpoetry run mypy→ passedpoetry run pre-commit run --all-files→ passedKey Decisions
UnivariateDistributionSpecas the public univariate spec API; removeNormalSpec,UniformSpec,ExponentialSpec,StudentTSpec.pysatl-coreUNURAN.