Recognize user-defined types in 'type:' attribute definition#3432
Merged
Conversation
Fixes the original complaint from #3431 Also: * Update documentation * Explain how to create new boxes in AGENTS.md * Add a code coverage test
There was a problem hiding this comment.
Pull request overview
Extends the topology data validator to resolve and merge user-defined data types when they are referenced via a type: key inside a dictionary-based type definition (addressing #3431), and updates related documentation and coverage tests.
Changes:
- Resolve user-defined types referenced in
type:inside Box/dict type definitions by merging the referenced user type definition into the local type definition. - Update developer validation documentation to describe the new merging behavior and remove outdated “won’t work” guidance.
- Add a coverage test (YAML + expected log) and update AGENTS.md guidance on creating Box objects correctly.
Reviewed changes
Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/coverage/errors/user-data-types.yml | New coverage topology exercising user-defined types in type: and related error cases |
| tests/coverage/errors/user-data-types.log | Expected error output for the new coverage topology |
| netsim/data/validate.py | Implements user-defined type resolution/merge when type: references a user-defined type |
| docs/dev/validation.md | Updates validation docs to mention user-defined types and type:-merge behavior |
| AGENTS.md | Adds guidance to use data.get_box() / data.get_empty_box() when creating Box objects |
jbemmel
reviewed
Jun 3, 2026
jbemmel
approved these changes
Jun 3, 2026
Collaborator
jbemmel
left a comment
There was a problem hiding this comment.
Minor inconsistency in the test comment
Would be nice if user defined types could be used in _alt_types, rather than documenting you can't - is that hard to add?
Owner
Author
Coming in a few minutes ;) |
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.
Fixes the original complaint from #3431
Also: