Skip to content

feat: add ObjectiveName type alias in objectives - #7

Closed
KIRA-L001 wants to merge 3 commits into
oager:mainfrom
KIRA-L001:fix/issue-3-add-type-aliases
Closed

KIRA-L001 wants to merge 3 commits into
oager:mainfrom
KIRA-L001:fix/issue-3-add-type-aliases

Conversation

@KIRA-L001

Copy link
Copy Markdown
Contributor

Adds a Literal type alias for objective names.

)

Adds a [tool.ruff] config (line-length 100, py311) with a mechanical
rule set (E4/E7/E9, F, I, UP), a ruff check step in the tests workflow,
ruff in the dev extra, and fixes the existing mechanical violations.
No behavioural changes in objectives/metrics/survival per the issue's
scope note. ruff check passes; 227 tests pass.

Signed-off-by: KIRA-L001 <137947115+KIRA-L001@users.noreply.github.com>
@oager

oager commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Closing this one — thanks for #5, which is merged.

ObjectiveName lands above the import block, so it splits import logging and friends off from the module docstring and fails E402 (module level import not at top of file) under the ruff config #5 added. You can see it on the CI run here now that fork PRs run automatically.

The deeper issue is that the alias isn't referenced anywhere — compute_objective still takes name: str. A Literal alias earns its place when it's actually annotating something and the type checker can reject a bad objective name at the call site. As written it's a declaration with no reader.

If you want to do this properly it'd be worth doing: thread ObjectiveName through compute_objective and the search entry points so a typo in an objective name is caught statically rather than by the ValueError at runtime. That's a real improvement. Happy to look at it.

Otherwise #1 (example adapter) and #3 (WFA_CONFIG) are open and would be more valuable.

@oager oager mentioned this pull request Aug 17, 2026
@oager oager closed this Aug 17, 2026
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