Skip to content

Improve semiring Pareto coverage with focused frontier-behavior tests#1303

Merged
SkBlaz merged 2 commits intomasterfrom
copilot/improve-test-coverage-6dcc794f-a879-4c62-b73d-6264b543bf3e
Mar 28, 2026
Merged

Improve semiring Pareto coverage with focused frontier-behavior tests#1303
SkBlaz merged 2 commits intomasterfrom
copilot/improve-test-coverage-6dcc794f-a879-4c62-b73d-6264b543bf3e

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 28, 2026

This PR addresses the coverage gap by adding targeted unit tests for Pareto frontier semantics in the semiring subsystem. The change is intentionally narrow: test-only additions for uncovered/under-covered behavior in py3plex.semiring.pareto.

  • What changed

    • Added tests/test_semiring_pareto.py to cover:
      • dominance-based rejection in ParetoSet.add()
      • pruning of dominated existing vectors
      • deterministic max_size truncation behavior
      • epsilon-tolerant near-equality handling
      • dimension-mismatch handling through public API behavior
      • union() merge semantics (including duplicate retention behavior in current implementation)
      • cartesian_combine() componentwise aggregation + pruning
      • pareto_semiring_spec() construction (zero, one, plus, times)
      • __repr__ contract
  • Design notes

    • Tests validate behavior through public APIs (add, union, cartesian_combine, spec operators), reducing coupling to internals.
    • Existing semantics are documented in assertions (including duplicate handling in union) so future behavior changes are explicit.
from py3plex.semiring.pareto import ParetoSet

frontier = ParetoSet(max_size=2)
frontier.add((2.0, 1.0))
frontier.add((1.0, 2.0))
frontier.add((0.0, 3.0))

assert frontier.to_list() == [(0.0, 3.0), (1.0, 2.0)]

Copilot AI and others added 2 commits March 28, 2026 06:03
@SkBlaz SkBlaz marked this pull request as ready for review March 28, 2026 06:32
@SkBlaz SkBlaz self-requested a review as a code owner March 28, 2026 06:32
@SkBlaz SkBlaz merged commit c2393fb into master Mar 28, 2026
33 checks passed
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.

2 participants