Slices
Slice management from annnet.core._Slices.
Use G.slices and the AnnNet slice methods for slice workflows. Direct
imports from underscore modules follow the internal API policy.
annnet.core._Slices.SliceManager
Namespace for all slice operations, exposed as G.slices.
Attributes
Functions
add
Create a new empty slice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slice_id
|
str
|
|
required |
**attributes
|
Any
|
Slice attributes. |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
|
remove
Remove a non-default slice and its per-slice attributes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
slice_id
|
str
|
|
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If attempting to remove the internal default slice. |
KeyError
|
If the slice does not exist. |
add_edge_to_slice
Attach an existing edge to a slice (no weight changes).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lid
|
str
|
|
required |
eid
|
str
|
|
required |
Raises:
| Type | Description |
|---|---|
KeyError
|
If the slice or edge does not exist. |
add_edges
Attach many existing edges to a slice and include their incident vertices.
get_slices_dict
Return the raw slice_id → SliceRecord mapping (distinct from list).
intersect
Return the intersection of vertices and edges across multiple slices.
difference
Return the vertices and edges present in one slice but not another.
create_slice_from_operation
Create a new slice from a precomputed membership result.
add_vertex_to_slice
Attach an existing vertex to a slice.
Raises:
| Type | Description |
|---|---|
KeyError
|
If the slice or vertex does not exist. |
union_create
Create a slice from the union of existing slices.
intersect_create
Create a slice from the intersection of existing slices.
difference_create
Create a slice from the difference of two slices.
aggregate
Build a target slice from sources via 'union' or 'intersection'.
vertex_presence
List slices that contain a given vertex.
edge_presence
edge_presence(
edge_id=None,
source=None,
target=None,
*,
include_default=False,
undirected_match=None
)
Slices containing an edge by id, or by (source, target) endpoint pair.
hyperedge_presence
Slices containing a hyperedge by undirected members or directed head+tail.
conserved_edges
Count edges that appear in at least min_slices slices.
temporal_dynamics
Summarize added and removed members across an ordered slice sequence.