Skip to content

Silent failure when assigning undefined risk_groups to Nodes/Links #103

Description

@networmix

The current implementation of NetGraph allows risk_groups to be assigned to Nodes and Links without validating that those groups are explicitly defined in the risk_groups section of the scenario.

While the Network model permissively accepts string tags for risk groups, the FailureManager and Network methods (like disable_risk_group) strictly require the group to be present in the risk_groups registry to function.

This leads to a "silent failure" state:

  • A user assigns a risk group (e.g., risk_groups: ["Rack_A"]) to a node.
  • The user forgets to define Rack_A in the top-level risk_groups section.
  • The user defines a failure policy targeting Rack_A.

Result: The simulation runs successfully but no failures occur, because the failure engine ignores undefined groups. No warning or error is raised to alert the user that their configuration is incomplete.

Maybe we should raise a ValueError during Network construction if a node/link references a risk group that does not exist.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions