Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union
from typing import Union, Optional

from pydantic import Field, field_validator

Expand Down Expand Up @@ -119,6 +119,14 @@ def device_id(self) -> str:
"""ID of the corresponding base device"""
return self.deviceId

@property
def module_id(self) -> Optional[str]:
"""Module identifier this vertex belongs to, or None for common vertices (e.g. SwitchingCore)."""
pid = self.gpid.pointId
if len(pid) >= 4 and pid[1] in ("dev", "virt"):
return pid[2]
return None

@property
def is_virtual(self) -> bool:
"""Indicates if the vertex is virtual"""
Expand Down