Repository navigation
refactor: adopt cpmux conventions and clarify OPF ownership - #61
Merged
Merged
Conversation
Adopt cpmux-derived Python, Google docstring, header, diagnostic, and grouping conventions while retaining Apache licensing and Python 3.11 support. Fix numerical/RNG/logging/configuration ownership, share private forest operations, preserve public runtime contracts, and restore documentation and CI quality gates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 804ac811-6a11-4d29-8526-ab1643abf900
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Follow-up to merged/released #60. This keeps the agreed ownership, contract, internal-reuse, and cpmux-derived convention changes in one PR. It does not merge itself or publish another release.
Conventions and documentation
CONVENTIONS.mdand repository Copilot instructions based on the supplied cpmux rules.collections.abccallables, absolute grouped imports, double quotes, and 120-column formatting.Ownership and internal reuse
distanceupdates its registered callable atomically, while explicit custom callables remain supported.RandomState, preserving historical permutations without reseeding application-wide state.Deliberate adaptations
OPFython retains Apache-2.0, its existing
opfython.utils.loggingmodule and public reexports, and Python >=3.11. The requested modern annotation idioms are compatible with 3.11. cpmux's MIT license, Textual/Typer/Pydantic architecture, empty-package-initializer rule, and interpreter floor are not transplanted. Package version and dependency versions remain unchanged.Validation
A numerical-guard microbenchmark used seven interleaved repeats of 5,000 calls on positive float64 vectors of 2, 32, and 512 features. New median times were 1.850-3.357 microseconds versus 1.964-3.743 for the equivalent copy-wrapped released implementation. The unsafe mutation-based implementation measured 1.473-2.932 microseconds. Variability was material; this is an allocation/correctness trade-off, not an application-wide speedup claim.