Types and helpers¶
pbcgraph.core.types ¶
Core types and translation-vector helpers.
The public API uses a small number of lightweight aliases:
Attributes:
| Name | Type | Description |
|---|---|---|
TVec |
Integer translation vector (length |
|
NodeId |
Hashable quotient-node identifier. |
|
EdgeKey |
Integer key identifying a directed edge in a multigraph. |
|
NodeInst |
Node instance in the infinite lift: |
validate_tvec ¶
validate_tvec(tvec: Any, dim: int) -> None
Validate that tvec is an integer translation vector
of dimension dim.
Accepts
- tuples/lists of integer-likes,
- 1D NumPy arrays,
- sequences containing NumPy integer scalars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tvec
|
Any
|
Translation vector. |
required |
dim
|
int
|
Required dimension. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Notes
- Entries must be instances of :class:
numbers.Integral. boolis rejected (even though it is a subclass ofint).- This function validates only; containers store translation vectors
internally as tuples of Python
int.