Skip to content

epymorph.geography.custom

Implements a generic geo scope capable of representing arbitrary geographies.

CustomScope

CustomScope(nodes: NDArray[str_] | list[str])

Bases: GeoScope

A scope with no logical connection to existing geographic systems.

Parameters:

node_ids property

node_ids: NDArray[str_]

The list of node IDs included in this scope.

select property

Create a selection from this scope.

geography property

geography: Never

Automatic geography is not supported for custom scopes.

CustomSelection dataclass

CustomSelection(
    scope: GeoScopeT_co,
    selection: NDArray[bool_],
    grouping: GeoGrouping | None,
    aggregation: GeoAggMethod | None,
)

Bases: GeoSelection[CustomScope]

A GeoSelection on a CustomScope.

Typically you will create one of these by calling methods on a GeoSelector instance.

group

group(grouping: GeoGrouping) -> GeoGroup[CustomScope]

Groups the geo axis using the specified grouping.

Parameters:

Returns:

CustomSelector dataclass

CustomSelector(
    _scope: GeoScopeT_co,
    _selection_class: type[GeoSelectionT_co],
)

Bases: GeoSelector[CustomScope, CustomSelection]

A GeoSelector for CustomScopes.