Skip to content

Clean up PQEncoder and PQKMeans: defaults, typing, assert style#7

Merged
afloresep merged 1 commit intomasterfrom
cleanup/encoder-pqkmeans-code-quality
Apr 13, 2026
Merged

Clean up PQEncoder and PQKMeans: defaults, typing, assert style#7
afloresep merged 1 commit intomasterfrom
cleanup/encoder-pqkmeans-code-quality

Conversation

@afloresep
Copy link
Copy Markdown
Owner

  • PQEncoder.fit and fit_transform now default to device='auto' so GPU is picked automatically when available, matching PQKMeans semantics.
  • Replace assert X == True/False with idiomatic assert X / assert not X in the encoder's trained-state guards.
  • Tighten PQKMeans._fit_gpu return type with @overload so fit_predict no longer returns a misleading np.ndarray | None union.
  • Fix "fingeprint" typo in a user-facing assertion message.

- PQEncoder.fit and fit_transform now default to device='auto' so GPU
  is picked automatically when available, matching PQKMeans semantics.
- Replace `assert X == True/False` with idiomatic `assert X` / `assert not X`
  in the encoder's trained-state guards.
- Tighten PQKMeans._fit_gpu return type with @overload so fit_predict no
  longer returns a misleading np.ndarray | None union.
- Fix "fingeprint" typo in a user-facing assertion message.
@afloresep afloresep merged commit b8af0cb into master Apr 13, 2026
4 checks passed
@afloresep afloresep deleted the cleanup/encoder-pqkmeans-code-quality branch April 13, 2026 20:46
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