Conversation
MaterialRun, ProcessRun and MeasurementRun accept an optional template that takes precedence over the template of the spec. IngredientRun accepts its own name and labels and falls back to the values on the spec. The version moves from 2.2.5 to 2.3.0. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Material, process, and measurement runs accept an optional template of their own. The template property returns the run's own template when it has one, and otherwise returns the template of its spec, as before. The attribute setters read that property, so they also check a run that has a template and no spec against its bounds.
Ingredient runs accept their own name and labels, and these take precedence over the values on the spec. When a run has neither, it reads the values from its spec, as before, and loading a run restores both values. Ingredient runs have no template of their own.
The change is additive. Existing objects behave as they did, with two corner cases. An ingredient run with no spec and no labels returns an empty list for labels instead of None. An ingredient run that kept the name and labels of an earlier spec keeps them when a later spec is assigned.
The template property lives on the spec mix-in. Each run class also inherits the template trait, which stores the value and checks its type. Python cannot merge one property from two mix-ins. The spec mix-in defines the getter and setter, and delegates storage to the template trait.
The version bump is minor, from 2.2.5 to 2.3.0.
Test commands run locally, all passing:
🤖 Generated with Claude Code