Skip to content

Create graphs from a subset of lab topology#3065

Merged
ipspace merged 2 commits intodevfrom
graph-class
Feb 3, 2026
Merged

Create graphs from a subset of lab topology#3065
ipspace merged 2 commits intodevfrom
graph-class

Conversation

@ipspace
Copy link
Copy Markdown
Owner

@ipspace ipspace commented Feb 3, 2026

This commit adds the '--include' and '--exclude' parameters to the 'netlab graph' command. These parameters can be used to include or exclude nodes or links from the lab topology and thus create graphs from a subset of the overall topology.

This commit adds the '--include' and '--exclude' parameters to
the 'netlab graph' command. These parameters can be used to
include or exclude nodes or links from the lab topology and thus
create graphs from a subset of the overall topology.
@ipspace ipspace requested a review from Copilot February 3, 2026 12:35
@ipspace ipspace linked an issue Feb 3, 2026 that may be closed by this pull request
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds --include and --exclude parameters to the netlab graph command, enabling users to create graphs from subsets of lab topology nodes and links based on modules, roles, or custom graph classes.

Changes:

  • New CLI parameters (-i/--include and -x/--exclude) for filtering topology elements
  • Core filtering logic that matches against node modules, link roles, and graph.class attributes
  • Schema extensions to support graph.class attribute on nodes and links
  • Comprehensive test coverage with multiple filtering scenarios

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
netsim/cli/graph.py Adds CLI argument parsing for include/exclude parameters with validation
netsim/outputs/_graph.py Implements two-phase filtering algorithm: marking items then removing orphaned connections
netsim/outputs/graph.yml Extends schema to support graph.class attribute as list of strings on nodes and links
docs/netlab/graph.md Documents new filtering parameters with usage examples and behavior explanation
tests/platform-integration/graph/05-include-exclude.yml Adds integration tests for exclude by class and include by module/role

Comment thread netsim/outputs/_graph.py
Comment thread docs/netlab/graph.md Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ipspace
Copy link
Copy Markdown
Owner Author

ipspace commented Feb 3, 2026

You asked for it @a-v-popov ;)

@ipspace ipspace merged commit 56e8324 into dev Feb 3, 2026
6 checks passed
@ipspace ipspace deleted the graph-class branch February 3, 2026 12:55
ipspace added a commit that referenced this pull request Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a netlab graph from a subset of nodes

2 participants