Skip to content

Daemontus/feat/set samplers#50

Merged
daemontus merged 4 commits intomainfrom
daemontus/feat/set-samplers
Jan 8, 2026
Merged

Daemontus/feat/set samplers#50
daemontus merged 4 commits intomainfrom
daemontus/feat/set-samplers

Conversation

@daemontus
Copy link
Member

@daemontus daemontus commented Jan 8, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added sample_items() method to symbolic set collections (ColorSet, VertexSet, SpaceSet, PerturbationSet, and colored variants) for uniform random sampling with optional seed parameter for reproducible results.
    • Added example script demonstrating uniform random sampling on symbolic sets.
  • Tests

    • New test coverage for sampling functionality across parameter and perturbation modules.
  • Chores

    • Updated dependencies to latest biodivine library versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

This pull request introduces uniform random sampling capabilities to the biodivine_aeon library. New sample_items() methods are added to collection-like interfaces (ColorSet, VertexSet, SpaceSet, and their colored/perturbation variants), each accepting optional retained variables/functions and a seed parameter. The underlying implementation includes new sampler types backed by BDD-based uniform valuation sampling with deterministic seeding.

Changes

Cohort / File(s) Summary
Dependency Updates
Cargo.toml
Minor version bumps for three biodivine packages: lib-param-bn (0.7.0→0.7.1), hctl-model-checker (0.3.4→0.3.5), algo-bdd-scc (0.3.1→0.3.2)
Python API Surface
biodivine_aeon/__init__.pyi
Adds sample_items() method signatures to 8 collection classes (ColorSet, VertexSet, SpaceSet, ColoredVertexSet, ColoredSpaceSet, PerturbationSet, ColoredPerturbationSet) with optional retained parameters and seed
Color Sampling
src/bindings/lib_param_bn/symbolic/set_color.rs
Introduces _ColorModelSampler struct and sample_items() method; adds helper methods read_retained_functions(), mk_native(), mk_derived(), semantic_eq() for projection-based sampling
Vertex Sampling
src/bindings/lib_param_bn/symbolic/set_vertex.rs
Adds _VertexModelSampler struct and sample_items() method; includes shared compute_retained_variables() helper for retained variable computation
Space Sampling
src/bindings/lib_param_bn/symbolic/set_spaces.rs
Introduces _SpaceModelSampler struct; adds sample_items() with helper compute_retained_variables() for space projection sampling
Colored Vertex Sampling
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs
Adds _ColorVertexModelSampler struct and sample_items() method; refactors with shared compute_retained() helper for both iteration and sampling paths
Colored Space Sampling
src/bindings/lib_param_bn/symbolic/set_colored_space.rs
Introduces _ColorSpaceModelSampler struct; adds sample_items() and private compute_retained() helper; consolidates retained computation logic
Perturbation Sampling
src/bindings/pbn_control/set_perturbation.rs
Adds _PerturbationModelSampler struct and sample_items() method; includes compute_retained_variables() helper for perturbation-specific projection
Colored Perturbation Sampling
src/bindings/pbn_control/set_colored_perturbation.rs
Introduces _ColorPerturbationModelSampler struct; adds sample_items() method and helper constructors; includes private compute_retained() helper
Example & Tests
example/script/uniform_random_sampling.py, tests/test_param_bn_module.py, tests/test_control_module.py
New example script demonstrating uniform random sampling workflow; adds unit tests for samplers in both param_bn (VertexSet, SpaceSet, ColoredVertexSet, ColoredSpaceSet) and control (PerturbationSet, ColoredPerturbationSet) modules

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

The changes introduce significant new functionality across 7 Rust binding modules with non-trivial sampling logic, projection mechanics, and retained variable handling. While patterns are similar across implementations, each module operates in a distinct context (colors, vertices, spaces, perturbations, and their colored variants), requiring careful verification of correctness for BDD-based uniform sampling, proper retained variable/function computation, and consistency across different type combinations.

Possibly related PRs

  • Daemontus/feat/updates #47: Modifies the same Rust binding types (ColorSet, VertexSet, SpaceSet, Colored\*/\*Perturbation) to add serialization support and Cargo features alongside existing method expansions, indicating parallel API surface changes.

Poem

🐰 Hoppy code hops through spaces wide,
Random samplers skip with seeded pride,
Colors, vertices, perturbations too,
Uniform sampling—now reproducible and true!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Daemontus/feat/set samplers' is partially related to the changeset but uses a branch-name convention that obscures the main change. Use a clearer, more descriptive title like 'Add uniform random sampling methods to symbolic sets' that better communicates the feature without relying on branch naming conventions.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/bindings/lib_param_bn/symbolic/set_color.rs (1)

275-293: Consider documenting the default seed behavior.

The implementation correctly constructs the sampler with projection-aware uniform sampling. However, seed.unwrap_or_default() defaults to 0, which means calling sample_items() without a seed will always produce the same sequence. This is likely intentional for reproducibility, but worth documenting explicitly in the docstring.

src/bindings/pbn_control/set_colored_perturbation.rs (1)

758-808: Consider extracting shared valuation-splitting logic.

The __next__ implementation duplicates significant logic with _ColorPerturbationModelIterator::__next__ (lines 702-743). Both iterate over network variables to separate color and perturbation valuations.

This is acceptable for clarity, but if this pattern appears frequently, consider extracting a helper method.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4ddf409 and 56e2528.

📒 Files selected for processing (12)
  • Cargo.toml
  • biodivine_aeon/__init__.pyi
  • example/script/uniform_random_sampling.py
  • src/bindings/lib_param_bn/symbolic/set_color.rs
  • src/bindings/lib_param_bn/symbolic/set_colored_space.rs
  • src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs
  • src/bindings/lib_param_bn/symbolic/set_spaces.rs
  • src/bindings/lib_param_bn/symbolic/set_vertex.rs
  • src/bindings/pbn_control/set_colored_perturbation.rs
  • src/bindings/pbn_control/set_perturbation.rs
  • tests/test_control_module.py
  • tests/test_param_bn_module.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-08-13T14:52:22.035Z
Learnt from: daemontus
Repo: sybila/biodivine-aeon-py PR: 43
File: example/algorithms_evaluation/run.py:6-6
Timestamp: 2025-08-13T14:52:22.035Z
Learning: The file `example/algorithms_evaluation/run.py` is legacy code copied for experiments in the biodivine-aeon-py repository. Changes to this file are typically out of scope for PRs as it serves as reference/experimental code.

Applied to files:

  • example/script/uniform_random_sampling.py
🧬 Code graph analysis (9)
src/bindings/lib_param_bn/symbolic/set_spaces.rs (2)
src/bindings/lib_bdd/mod.rs (12)
  • module (14-14)
  • module (15-15)
  • module (16-16)
  • module (17-17)
  • module (18-18)
  • module (19-19)
  • module (20-20)
  • module (21-21)
  • module (22-22)
  • module (23-23)
  • module (24-24)
  • module (25-25)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (3)
  • retained (389-395)
  • compute_retained_variables (384-399)
  • new (78-83)
src/bindings/lib_param_bn/symbolic/set_colored_space.rs (5)
src/bindings/lib_bdd/mod.rs (12)
  • module (14-14)
  • module (15-15)
  • module (16-16)
  • module (17-17)
  • module (18-18)
  • module (19-19)
  • module (20-20)
  • module (21-21)
  • module (22-22)
  • module (23-23)
  • module (24-24)
  • module (25-25)
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (11)
  • compute_retained (343-366)
  • ctx (447-449)
  • new (83-88)
  • sample_items (291-310)
  • __iter__ (137-139)
  • __iter__ (371-373)
  • __iter__ (408-410)
  • __next__ (375-398)
  • __next__ (412-438)
  • next (401-403)
  • next (441-443)
src/bindings/lib_param_bn/symbolic/set_spaces.rs (11)
  • ctx (253-253)
  • new (76-81)
  • sample_items (232-248)
  • compute_retained_variables (299-318)
  • __iter__ (126-128)
  • __iter__ (323-325)
  • __iter__ (341-343)
  • __next__ (327-331)
  • __next__ (345-357)
  • next (334-336)
  • next (360-362)
src/bindings/lib_param_bn/symbolic/model_space.rs (1)
  • new_native (153-158)
src/bindings/lib_param_bn/symbolic/model_color.rs (1)
  • new_native (329-341)
tests/test_control_module.py (8)
biodivine_aeon/__init__.pyi (9)
  • mk_unit_perturbations (1850-1850)
  • sample_items (1166-1166)
  • sample_items (1222-1222)
  • sample_items (1274-1274)
  • sample_items (1335-1339)
  • sample_items (1383-1387)
  • sample_items (1756-1759)
  • sample_items (1825-1829)
  • mk_unit_colored_perturbations (1852-1852)
src/bindings/pbn_control/asynchronous_perturbation_graph.rs (2)
  • mk_unit_perturbations (354-356)
  • mk_unit_colored_perturbations (365-368)
src/bindings/pbn_control/set_colored_perturbation.rs (3)
  • sample_items (562-590)
  • next (747-749)
  • next (811-813)
src/bindings/pbn_control/set_perturbation.rs (3)
  • sample_items (291-314)
  • next (424-426)
  • next (462-464)
src/bindings/lib_param_bn/symbolic/set_colored_space.rs (3)
  • sample_items (286-306)
  • next (427-429)
  • next (476-478)
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (3)
  • sample_items (291-310)
  • next (401-403)
  • next (441-443)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (3)
  • sample_items (234-249)
  • next (415-417)
  • next (441-443)
src/bindings/lib_param_bn/symbolic/set_color.rs (3)
  • sample_items (276-293)
  • next (381-383)
  • next (412-414)
tests/test_param_bn_module.py (5)
src/bindings/lib_param_bn/boolean_network.rs (1)
  • from_aeon (227-231)
src/bindings/lib_param_bn/symbolic/asynchronous_graph.rs (1)
  • mk_subspace_vertices (447-453)
src/bindings/lib_param_bn/symbolic/set_spaces.rs (2)
  • sample_items (232-248)
  • ctx (253-253)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (3)
  • sample_items (234-249)
  • retained (389-395)
  • items (216-224)
src/bindings/lib_param_bn/symbolic/symbolic_space_context.rs (2)
  • mk_unit_spaces (197-200)
  • mk_unit_colored_spaces (172-191)
example/script/uniform_random_sampling.py (2)
src/lib.rs (1)
  • biodivine_aeon (84-95)
biodivine_aeon/__init__.pyi (3)
  • BooleanNetwork (730-858)
  • AsynchronousGraph (1391-1462)
  • Reachability (1927-1943)
src/bindings/lib_param_bn/symbolic/set_color.rs (5)
src/bindings/lib_bdd/mod.rs (12)
  • module (14-14)
  • module (15-15)
  • module (16-16)
  • module (17-17)
  • module (18-18)
  • module (19-19)
  • module (20-20)
  • module (21-21)
  • module (22-22)
  • module (23-23)
  • module (24-24)
  • module (25-25)
src/bindings/lib_param_bn/symbolic/set_colored_space.rs (5)
  • ctx (189-189)
  • ctx (315-315)
  • ctx (400-400)
  • ctx (449-449)
  • new (84-89)
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (2)
  • ctx (447-449)
  • new (83-88)
src/bindings/lib_bdd/bdd_valuation.rs (4)
  • ctx (52-52)
  • ctx (58-58)
  • ctx (70-70)
  • b (310-310)
src/bindings/lib_param_bn/symbolic/model_color.rs (1)
  • new_native (329-341)
biodivine_aeon/__init__.pyi (7)
src/bindings/pbn_control/set_colored_perturbation.rs (1)
  • sample_items (562-590)
src/bindings/pbn_control/set_perturbation.rs (1)
  • sample_items (291-314)
src/bindings/lib_param_bn/symbolic/set_colored_space.rs (1)
  • sample_items (286-306)
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (1)
  • sample_items (291-310)
src/bindings/lib_param_bn/symbolic/set_spaces.rs (1)
  • sample_items (232-248)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (2)
  • sample_items (234-249)
  • retained (389-395)
src/bindings/lib_param_bn/symbolic/set_color.rs (1)
  • sample_items (276-293)
src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (4)
src/bindings/lib_bdd/mod.rs (12)
  • module (14-14)
  • module (15-15)
  • module (16-16)
  • module (17-17)
  • module (18-18)
  • module (19-19)
  • module (20-20)
  • module (21-21)
  • module (22-22)
  • module (23-23)
  • module (24-24)
  • module (25-25)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (7)
  • retained (389-395)
  • new (78-83)
  • compute_retained_variables (384-399)
  • __next__ (408-412)
  • __next__ (426-438)
  • next (415-417)
  • next (441-443)
src/bindings/lib_param_bn/symbolic/set_colored_space.rs (10)
  • compute_retained (368-389)
  • ctx (189-189)
  • ctx (315-315)
  • ctx (400-400)
  • ctx (449-449)
  • new (84-89)
  • __next__ (398-424)
  • __next__ (438-473)
  • next (427-429)
  • next (476-478)
src/bindings/lib_param_bn/symbolic/set_color.rs (7)
  • ctx (352-352)
  • new (87-92)
  • read_retained_functions (318-360)
  • __next__ (369-378)
  • __next__ (392-409)
  • next (381-383)
  • next (412-414)
src/bindings/pbn_control/set_perturbation.rs (3)
src/bindings/lib_param_bn/symbolic/set_vertex.rs (4)
  • compute_retained_variables (384-399)
  • retained (389-395)
  • sample_items (234-249)
  • new (78-83)
src/bindings/pbn_control/set_colored_perturbation.rs (4)
  • ctx (646-651)
  • ctx (652-656)
  • sample_items (562-590)
  • new (79-87)
src/bindings/pbn_control/model_perturbation.rs (1)
  • new_native (237-250)
🪛 Ruff (0.14.10)
tests/test_param_bn_module.py

987-987: BooleanNetwork may be undefined, or defined from star imports

(F405)


995-995: AsynchronousGraph may be undefined, or defined from star imports

(F405)


1010-1010: BooleanExpression may be undefined, or defined from star imports

(F405)


1029-1029: SymbolicSpaceContext may be undefined, or defined from star imports

(F405)


1038-1038: AsynchronousGraph may be undefined, or defined from star imports

(F405)

example/script/uniform_random_sampling.py

1-1: from biodivine_aeon import * used; unable to detect undefined names

(F403)


7-7: BooleanNetwork may be undefined, or defined from star imports

(F405)


8-8: AsynchronousGraph may be undefined, or defined from star imports

(F405)


17-17: Reachability may be undefined, or defined from star imports

(F405)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: tests-linux (3.9)
  • GitHub Check: tests-linux (3.10)
  • GitHub Check: tests-linux (3.12)
  • GitHub Check: tests-windows
  • GitHub Check: clippy
  • GitHub Check: tests-linux (3.11)
  • GitHub Check: tests-macos-and-coverage
  • GitHub Check: mypy
  • GitHub Check: notebooks-linux
  • GitHub Check: tests-linux (3.9)
  • GitHub Check: tests-linux (3.12)
  • GitHub Check: tests-linux (3.11)
  • GitHub Check: tests-linux (3.10)
  • GitHub Check: tests-windows
  • GitHub Check: tests-macos-and-coverage
  • GitHub Check: notebooks-linux
  • GitHub Check: clippy
  • GitHub Check: mypy
  • GitHub Check: pdoc documentation
🔇 Additional comments (30)
tests/test_control_module.py (1)

280-296: Well-structured tests for the new sampling functionality.

The tests correctly verify:

  • Seeded sampling produces consistent results
  • Retained variable/function filtering excludes non-retained items from samples
  • Both PerturbationSet and ColoredPerturbationSet samplers work as expected
example/script/uniform_random_sampling.py (1)

1-45: Good demonstration of the new sampling API.

The example clearly illustrates the workflow for uniform random sampling and hypothesis testing. The use of seed=1 ensures reproducibility.

One consideration: the relative path '../case-study/butanol-production/butanol-pathway-f1-f2-f3.aeon' assumes a specific execution context. Consider adding a brief comment about where to run this script from, or using Path(__file__).parent for more robust path resolution.

tests/test_param_bn_module.py (1)

986-1054: Comprehensive test coverage for symbolic samplers.

The test effectively exercises:

  • VertexSet.sample_items() with constraint validation
  • ColorSet.sample_items() with function expression verification
  • ColoredVertexSet.sample_items() combining both
  • SpaceSet.sample_items() with retained variable projection
  • ColoredSpaceSet.items() with retained variables and functions

The assertions properly verify that samples respect the underlying set constraints and that retained variable filtering excludes non-retained items.

src/bindings/lib_param_bn/symbolic/set_spaces.rs (3)

46-56: Clean sampler struct definition.

The _SpaceModelSampler struct appropriately holds the context, projection, and sampler state needed for uniform sampling.


224-248: Well-implemented sample_items method.

The implementation correctly:

  • Reuses compute_retained_variables to avoid code duplication with items()
  • Creates a RawProjection for the retained variables
  • Initializes the RNG with a deterministic seed (defaulting to 0)

339-363: Implementation correctly handles empty BDD sampling.

The random_valuation_sample method returns Option<BddValuation>, properly returning None when the BDD is empty. PyO3 automatically converts this to the correct Python iterator behavior (StopIteration). The pattern is consistent across the codebase and handles edge cases appropriately.

src/bindings/pbn_control/set_perturbation.rs (4)

55-66: Appropriate sampler struct for perturbation sampling.

The _PerturbationModelSampler correctly includes parameter_mapping which is needed to handle the perturbation-specific logic of unsetting state variables when perturbations are inactive.


283-314: Correct implementation of sample_items for perturbations.

The method properly:

  • Reuses compute_retained_variables for consistency with items()
  • Applies the duplicate pruning BDD to ensure unique perturbation sampling
  • Initializes the sampler with the pruned projection

435-459: Post-sampling cleanup logic is correctly implemented.

The __next__ implementation properly mirrors the iterator's logic at lines 409-421:

  • Samples a valuation from the projection
  • Copies retained variables to a partial valuation
  • Removes state variables when the perturbation parameter is false (lines 447-452)

This ensures sampled PerturbationModel instances are semantically correct.


369-400: Well-factored helper function.

Extracting compute_retained_variables eliminates duplication between items() and sample_items() while maintaining the perturbation-specific logic for variable resolution and mapping.

src/bindings/lib_param_bn/symbolic/set_vertex.rs (4)

48-58: Clean sampler struct definition.

The _VertexModelSampler follows the established pattern with context, projection, and sampler fields.


226-249: Well-documented sample_items method.

The docstring clearly explains:

  • The optional projection behavior
  • That sampling is uniform with respect to the projected set
  • The seed parameter for deterministic sampling

382-399: Clean helper function implementation.

The compute_retained_variables helper:

  • Uses idiomatic Rust with iterator chaining
  • Properly resolves VariableIdType to BDD variables
  • Falls back to all state variables when retained is None

420-444: Correct sampler iterator implementation.

The __next__ method properly:

  • Samples a full valuation from the projection BDD
  • Extracts only the retained variables into a partial valuation
  • Constructs a VertexModel with the sampled values
Cargo.toml (1)

31-37: Dependency updates support the new sampling functionality.

The updates to biodivine-lib-param-bn (0.7.0 → 0.7.1), biodivine-hctl-model-checker (0.3.4 → 0.3.5), and biodivine-algo-bdd-scc (0.3.1 → 0.3.2) are necessary for the mk_uniform_valuation_sampler API used across multiple binding modules in this PR.

src/bindings/lib_param_bn/symbolic/set_color.rs (3)

49-61: LGTM! Well-structured sampler type.

The _ColorModelSampler struct correctly encapsulates all necessary state for uniform sampling: the context, projection, sampler, and retained variable lists. This mirrors the iterator pattern established by _ColorModelIterator.


392-409: LGTM! Correct sampling implementation.

The __next__ implementation properly:

  1. Samples a full valuation from the BDD
  2. Extracts only retained variables into a partial valuation
  3. Constructs a ColorModel with the retained implicit/explicit lists

The pattern correctly handles the case where the BDD is empty (returns None).


308-316: Good semantic equality implementation.

Using XOR with limit 1 is an efficient way to check BDD equality - if the XOR produces any non-terminal node, the BDDs differ.

src/bindings/lib_param_bn/symbolic/set_colored_vertex.rs (3)

51-63: LGTM! Consistent sampler structure.

The _ColorVertexModelSampler correctly mirrors the iterator structure and follows the same pattern as _ColorModelSampler in set_color.rs.


340-366: Good refactoring to share retained computation logic.

The compute_retained helper properly consolidates the logic previously duplicated between items and the new sample_items, correctly combining function variables from ColorSet::read_retained_functions with state variables from VertexSet::compute_retained_variables.


412-438: LGTM! Correct separation of color and state variables.

The implementation correctly:

  1. Samples a valuation from the projected BDD
  2. Separates retained variables into color (parameter) and state buckets using find_state_variable
  3. Constructs separate ColorModel and VertexModel instances

This ensures the returned models don't contain cross-contaminated variable assignments.

src/bindings/pbn_control/set_colored_perturbation.rs (3)

54-68: LGTM! Appropriate additional fields for perturbation handling.

The _ColorPerturbationModelSampler correctly includes the parameter_mapping field needed to handle perturbation variables, consistent with _ColorPerturbationModelIterator.


574-578: Correct duplicate pruning before sampling.

The implementation correctly applies mk_duplicate_pruning_bdd before creating the projection, ensuring uniform sampling respects the pruning semantics required for perturbation sets.


625-628: LGTM! Appropriate clippy allow for complex return type.

The #[allow(clippy::type_complexity)] is justified given the 4-tuple return type. This is an internal helper, so the complexity is acceptable.

src/bindings/lib_param_bn/symbolic/set_colored_space.rs (3)

52-64: LGTM! Consistent sampler design.

The _ColorSpaceModelSampler follows the established pattern with appropriate context type (SymbolicSpaceContext).


366-389: Good helper extraction matching ColoredVertexSet pattern.

The compute_retained helper correctly delegates to ColorSet::read_retained_functions and SpaceSet::compute_retained_variables, maintaining consistency with the pattern in set_colored_vertex.rs.


438-473: LGTM! Correct Python context handling.

The __next__ implementation correctly:

  1. Extracts the parent SymbolicContext from SymbolicSpaceContext for ColorModel construction
  2. Uses all_extra_state_variables() for space variables (different from regular state variables)
  3. Returns PyResult to handle potential extraction errors
biodivine_aeon/__init__.pyi (3)

1166-1166: LGTM! Correct type signature for ColorSet.sample_items.

The stub correctly mirrors the items() signature with the addition of the optional seed parameter.


1335-1339: LGTM! Consistent type signatures across colored set types.

The sample_items signatures for ColoredVertexSet, ColoredSpaceSet, and ColoredPerturbationSet correctly:

  1. Match their corresponding items() signatures
  2. Add the optional seed parameter
  3. Return appropriate tuple iterators

Also applies to: 1383-1387, 1825-1829


1756-1759: LGTM! Correct PerturbationSet.sample_items signature.

The type stub correctly reflects the simpler signature (no retained_functions parameter) matching the Rust implementation.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 80.52930% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.07%. Comparing base (4ddf409) to head (56e2528).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...indings/lib_param_bn/symbolic/set_colored_space.rs 30.76% 54 Missing ⚠️
...c/bindings/pbn_control/set_colored_perturbation.rs 90.90% 11 Missing ⚠️
src/bindings/pbn_control/set_perturbation.rs 88.15% 9 Missing ⚠️
src/bindings/lib_param_bn/symbolic/set_color.rs 89.61% 8 Missing ⚠️
...ndings/lib_param_bn/symbolic/set_colored_vertex.rs 90.41% 7 Missing ⚠️
src/bindings/lib_param_bn/symbolic/set_spaces.rs 87.03% 7 Missing ⚠️
src/bindings/lib_param_bn/symbolic/set_vertex.rs 86.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #50      +/-   ##
==========================================
+ Coverage   71.79%   72.07%   +0.28%     
==========================================
  Files         106      106              
  Lines       11449    11768     +319     
==========================================
+ Hits         8220     8482     +262     
- Misses       3229     3286      +57     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@daemontus daemontus merged commit 90ce062 into main Jan 8, 2026
27 checks passed
@daemontus daemontus deleted the daemontus/feat/set-samplers branch January 8, 2026 15:58
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