Skip to content

refactor: add InvalidExecutionModeError for unknown execution modes#38

Open
guru-desh wants to merge 4 commits into
apple:mainfrom
guru-desh:add-invalid-execution-error
Open

refactor: add InvalidExecutionModeError for unknown execution modes#38
guru-desh wants to merge 4 commits into
apple:mainfrom
guru-desh:add-invalid-execution-error

Conversation

@guru-desh

Copy link
Copy Markdown
Contributor

There are repeated ValueErrors with similar messaging for raising exceptions for invalid execution modes (if neither graph nor eager is specified). This PR consolidates it into a custom exception so we don't repeat ourselves

Define InvalidExecutionModeError(ValueError) next to the ExecutionMode
enum so callers can catch a single, dedicated exception type instead
of matching on ad-hoc ValueError message strings.
Add the new exception to the public quantization package surface
alongside ExecutionMode.
Replace the duplicated ValueError messages in Quantizer and
ModelInspector with the shared InvalidExecutionModeError.
…_raises

Match the new exception type instead of the old ValueError message.
Comment thread src/coreai_opt/quantization/config/__init__.py
@guru-desh guru-desh added the enhancement New feature or request label Jul 14, 2026
@guru-desh
guru-desh marked this pull request as ready for review July 14, 2026 20:05
@guru-desh
guru-desh force-pushed the add-invalid-execution-error branch from c56af19 to 9b51292 Compare July 14, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants