Context
In PR #795, we implemented smarter field merging for the nsys configuration by using exclude_unset=True in the model_dump() call. This allows partial overrides of nsys fields in scenario configurations while preserving base values from test definitions.
A similar approach was previously used for reports. However, the current approach for most other fields is "all or nothing" - meaning everything should be set at one level or another.
Proposal
Implement a consistent model merging strategy across the codebase:
- Consider creating a unified
merge_models(tdef, tscenario) function or similar utility
- Apply the smarter merge approach consistently for all relevant model fields
- Ensure the merging hierarchy is clear and well-documented
This would provide a friendlier and more intuitive user experience when overriding configuration values.
References
Context
In PR #795, we implemented smarter field merging for the
nsysconfiguration by usingexclude_unset=Truein themodel_dump()call. This allows partial overrides ofnsysfields in scenario configurations while preserving base values from test definitions.A similar approach was previously used for reports. However, the current approach for most other fields is "all or nothing" - meaning everything should be set at one level or another.
Proposal
Implement a consistent model merging strategy across the codebase:
merge_models(tdef, tscenario)function or similar utilityThis would provide a friendlier and more intuitive user experience when overriding configuration values.
References
nsyssubfield merging behavior #795nsyssubfield merging behavior #795 (comment)