nrel.hive
latest
  • Quick Start
  • Example
  • Inputs
  • Outputs
  • Customize
  • Developer Docs
  • API Reference
    • nrel
      • Subpackages
        • nrel.hive
nrel.hive
  • API Reference
  • nrel
  • nrel.hive
  • nrel.hive.model
  • nrel.hive.model.roadnetwork
  • nrel.hive.model.roadnetwork.link_id
  • Edit on GitHub

nrel.hive.model.roadnetwork.link_id

Module Contents

Functions

create_link_id(→ nrel.hive.util.typealiases.LinkId)

creates a LinkId from its source and destination node ids

extract_node_ids(→ Tuple[Optional[Exception], ...)

expects the provided string is of the form {src_node_id}-{dst_node_id}

extract_node_ids_int(→ Tuple[Optional[Exception], ...)

node ids can be strings for the haversine case but for networkx graphs they must be

reverse_link_id(→ Tuple[Optional[Exception], ...)

attempts to reverse a link id by swapping the node ids. can be used to look up the

Attributes

NodeId

nrel.hive.model.roadnetwork.link_id.NodeId
nrel.hive.model.roadnetwork.link_id.create_link_id(src: int, dst: int) → nrel.hive.util.typealiases.LinkId[source]

creates a LinkId from its source and destination node ids :param src: the source node id :param dst: the destination node id :return: a LinkId

nrel.hive.model.roadnetwork.link_id.extract_node_ids(link_id: nrel.hive.util.typealiases.LinkId) → Tuple[Exception | None, Tuple[NodeId, NodeId] | None][source]

expects the provided string is of the form {src_node_id}-{dst_node_id} :param link_id: a string that is a LinkId :return: an error, or, a tuple containing both node ids

nrel.hive.model.roadnetwork.link_id.extract_node_ids_int(link_id: nrel.hive.util.typealiases.LinkId) → Tuple[Exception | None, Tuple[int, int] | None][source]

node ids can be strings for the haversine case but for networkx graphs they must be integers as they are treated as indices.

Parameters:

link_id (LinkId) – link id to read

Returns:

_description_

Return type:

Tuple[Optional[Exception], Optional[Tuple[int, int]]]

nrel.hive.model.roadnetwork.link_id.reverse_link_id(link_id: nrel.hive.util.typealiases.LinkId) → Tuple[Exception | None, nrel.hive.util.typealiases.LinkId | None][source]

attempts to reverse a link id by swapping the node ids. can be used to look up the “other side of the street” on 2-way streets. :param link_id: the link id to reverse :return: either an error or the reversed LinkId

Previous Next

© Copyright 2022, NREL. Revision 224263b8.

Built with Sphinx using a theme provided by Read the Docs.