Skip to content

Refactor categorical space dimensions#371

Open
knobel-dk wants to merge 1 commit into
novonordisk-research:developfrom
knobel-dk:fix/issue-355
Open

Refactor categorical space dimensions#371
knobel-dk wants to merge 1 commit into
novonordisk-research:developfrom
knobel-dk:fix/issue-355

Conversation

@knobel-dk

Copy link
Copy Markdown

Summary

This refactors the categorical space dimension implementation by introducing a private _BaseCategorical helper that contains behavior shared by Categorical and Task.

Changes

  • Moves shared categorical setup, prior handling, equality, repr helpers, bounds, transformed bounds, containment, distance, and prior-based sampling into _BaseCategorical.
  • Keeps Categorical and Task as the public classes, with Task retaining only the active-task-specific behavior.
  • Removes the duplicate Task.sample implementation so Task uses the inherited Dimension.sample behavior just like the other dimensions.

Validation

  • Ran python3 -m py_compile ProcessOptimizer/space/space.py.
  • Ran git diff --check.
  • Ran a focused isolated smoke check for Categorical and Task behavior with uv.

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