Repository navigation
ONNX-style producer fields, rename producers to packages (wire format v3) - #58
Merged
Merged
Conversation
…, bump format to v3
…dependency version
…itten by other tools
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.
Summary
metadata.producer_name/producer_versionnow follow ONNX semantics and name the tool that wrote the file ("openmodels"+ its release version, or a third-party writer's own name/version) instead of conflating the outermost model's package with scikit-learn's version.metadata.domain_versionfield, which the deserialize-time version check now reads (falling back toproducer_versiononly for v1/v2 files, since that's the only shape where it ever held the sklearn version).metadata.producersis renamedmetadata.packagesand now always includessklearn, even when no estimator in the tree is scikit-learn's own class. v2 files'producerskey is still read for backward compatibility.packages.metadata.dependency_versionsgainspython(platform.python_version()).metadata.openmodels_version(v3 only) -producer_versionwithproducer_name: "openmodels"records the same release, and the old field was never read on deserialize.docs/format.mdupdated: field table, worked examples, a new "Files written by other tools" section, and format history entry for v3.pyproject.toml).Why
The old
producer_version/producer_namepair mixed two unrelated things - which package wrote the model class, and what scikit-learn version its attribute layout matches - into one field. That broke down for a third-party root estimator (mismatched values) and gave a non-Python writer (e.g. an R exporter) nothing honest to put inproducer_name. Splitting "who wrote this file" (producer_*) from "what environment it targets" (domain_version,packages) follows ONNX's convention and makes both openmodels-written and externally-written files self-describing.