Make attribute label, description, and value optional with auto-label generation + add unit tests#3042
Merged
fabiencastan merged 7 commits intodevelopfrom Mar 18, 2026
Merged
Conversation
…ptors with auto-label generation Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update attributes to make label and description optional
Make label, description, and value optional on all attribute descriptors
Mar 13, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3042 +/- ##
===========================================
+ Coverage 83.05% 83.36% +0.30%
===========================================
Files 72 73 +1
Lines 9657 9843 +186
===========================================
+ Hits 8021 8206 +185
- Misses 1636 1637 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…fault value behavior Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com>
Copilot
AI
changed the title
Make label, description, and value optional on all attribute descriptors
Make attribute label, description, and value optional with auto-label generation + add unit tests
Mar 13, 2026
servantftransperfect
approved these changes
Mar 17, 2026
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.
label,description, andvaluewere required positional arguments on all attribute constructors, forcing verbose boilerplate even when defaults were sufficient. This PR makes all three optional and adds tests validating the behavior.Description
All attribute descriptor constructors (
File,BoolParam,IntParam,FloatParam,StringParam,ColorParam,PushButtonParam,ChoiceParam,ListAttribute,GroupAttribute, and geometry variants) now acceptnameas the only required argument.Before:
After:
Features list
label=Noneon all attribute constructors — auto-generated from the name viaconvertToLabel()(camelCase →"Camel Case", snake_case →"Snake Case", acronyms preserved:useGPU→"Use GPU")description=Noneon all attribute constructors — defaults to""value=Noneon all typed param constructors — when used as an output, the attribute isisDynamicValue=True(value computed at runtime); when used as an input, the runtime value is the type's zero-value (str()→"",int()→0,float()→0.0,bool()→False)values=[]inChoiceParam→values=NoneconvertToLabel(name)added todesc/attribute.py(mirrors existing implementation inbin/meshroom_newNodeType)tests/test_attributeDescDefaults.pycovering minimal creation for all types,isDynamicValueon descriptors, input type defaults at runtime, and outputNonevalues before computationImplementation remarks
getDefaultValue()inmeshroom/core/attribute.pywas extended: whendesc.value is None, the attribute is an input, and_valueType is not None, it returns_valueType()instead ofNone. This gives typed inputs a sensible default without requiring node authors to specify it explicitly.ListAttributeandGroupAttributealways initialize withvalue=[]/value={}internally, so they remainisDynamicValue=Falseregardless.Param.__init__retains positional-style signature internally; the optional defaults are applied at each concrete subclass level and propagate upward.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.