Struct py_raphtory::graph_view::PyGraphView
source · pub struct PyGraphView {
pub graph: DynamicGraph,
}Expand description
Graph view is a read-only version of a graph at a certain point in time.
Fields§
§graph: DynamicGraphImplementations§
source§impl PyGraphView
impl PyGraphView
The API for querying a view of the graph in a read-only state
pub fn get_unique_layers(&self) -> Vec<String>
sourcepub fn earliest_time(&self) -> Option<i64>
pub fn earliest_time(&self) -> Option<i64>
Timestamp of earliest activity in the graph
Returns: the timestamp of the earliest activity in the graph
sourcepub fn earliest_date_time(&self) -> Option<NaiveDateTime>
pub fn earliest_date_time(&self) -> Option<NaiveDateTime>
DateTime of earliest activity in the graph
Returns: the datetime of the earliest activity in the graph
sourcepub fn latest_time(&self) -> Option<i64>
pub fn latest_time(&self) -> Option<i64>
Timestamp of latest activity in the graph
Returns: the timestamp of the latest activity in the graph
sourcepub fn latest_date_time(&self) -> Option<NaiveDateTime>
pub fn latest_date_time(&self) -> Option<NaiveDateTime>
DateTime of latest activity in the graph
Returns: the datetime of the latest activity in the graph
sourcepub fn num_edges(&self) -> usize
pub fn num_edges(&self) -> usize
Number of edges in the graph
Returns: the number of edges in the graph
sourcepub fn num_vertices(&self) -> usize
pub fn num_vertices(&self) -> usize
Number of vertices in the graph
Returns: the number of vertices in the graph
sourcepub fn has_vertex(&self, id: &PyAny) -> PyResult<bool>
pub fn has_vertex(&self, id: &PyAny) -> PyResult<bool>
Returns true if the graph contains the specified vertex
Arguments: id (str or int): the vertex id
Returns: true if the graph contains the specified vertex, false otherwise
sourcepub fn has_edge(
&self,
src: &PyAny,
dst: &PyAny,
layer: Option<&str>
) -> PyResult<bool>
pub fn has_edge( &self, src: &PyAny, dst: &PyAny, layer: Option<&str> ) -> PyResult<bool>
Returns true if the graph contains the specified edge
Arguments:
src (str or int): the source vertex id
dst (str or int): the destination vertex id
layer (str): the edge layer (optional)
Returns: true if the graph contains the specified edge, false otherwise
sourcepub fn vertex(&self, id: &PyAny) -> PyResult<Option<PyVertex>>
pub fn vertex(&self, id: &PyAny) -> PyResult<Option<PyVertex>>
Gets the vertex with the specified id
Arguments: id (str or int): the vertex id
Returns: the vertex with the specified id, or None if the vertex does not exist
sourcepub fn vertices(&self) -> PyVertices
pub fn vertices(&self) -> PyVertices
Gets the vertices in the graph
Returns: the vertices in the graph
sourcepub fn edge(
&self,
src: &PyAny,
dst: &PyAny,
layer: Option<&str>
) -> PyResult<Option<PyEdge>>
pub fn edge( &self, src: &PyAny, dst: &PyAny, layer: Option<&str> ) -> PyResult<Option<PyEdge>>
Gets the edge with the specified source and destination vertices
Arguments: src (str or int): the source vertex id dst (str or int): the destination vertex id layer (str): the edge layer (optional)
Returns: the edge with the specified source and destination vertices, or None if the edge does not exist
sourcepub fn start(&self) -> Option<i64>
pub fn start(&self) -> Option<i64>
Returns the default start time for perspectives over the view
Returns: the default start time for perspectives over the view
sourcepub fn start_date_time(&self) -> Option<NaiveDateTime>
pub fn start_date_time(&self) -> Option<NaiveDateTime>
Returns the default start datetime for perspectives over the view
Returns: the default start datetime for perspectives over the view
sourcepub fn end(&self) -> Option<i64>
pub fn end(&self) -> Option<i64>
Returns the default end time for perspectives over the view
Returns: the default end time for perspectives over the view
sourcepub fn window_size(&self) -> Option<u64>
pub fn window_size(&self) -> Option<u64>
Returns the size of the window covered by this view
Returns: int: the size of the window
sourcepub fn end_date_time(&self) -> Option<NaiveDateTime>
pub fn end_date_time(&self) -> Option<NaiveDateTime>
Returns the default end datetime for perspectives over the view
Returns: the default end datetime for perspectives over the view
sourcepub fn window(
&self,
start: Option<&PyAny>,
end: Option<&PyAny>
) -> PyResult<PyGraphView>
pub fn window( &self, start: Option<&PyAny>, end: Option<&PyAny> ) -> PyResult<PyGraphView>
Create a view including all events between t_start (inclusive) and t_end (exclusive)
Arguments: start (int): the start time of the window (optional) end (int): the end time of the window (optional)
Returns:
a view including all events between t_start (inclusive) and t_end (exclusive)
sourcepub fn at(&self, end: &PyAny) -> PyResult<PyGraphView>
pub fn at(&self, end: &PyAny) -> PyResult<PyGraphView>
Create a view including all events until end (inclusive)
Arguments: end (int) : the end time of the window
Returns:
a view including all events until end (inclusive)
sourcepub fn default_layer(&self) -> PyGraphView
pub fn default_layer(&self) -> PyGraphView
Create a view including all the edges in the default layer
Returns: a view including all the edges in the default layer
sourcepub fn layer(&self, name: &str) -> Option<PyGraphView>
pub fn layer(&self, name: &str) -> Option<PyGraphView>
Create a view including all the edges in the layer name
Arguments: name (str) : the name of the layer
Returns:
a view including all the edges in the layer name
Trait Implementations§
source§impl<G: GraphViewOps + IntoDynamic> From<G> for PyGraphView
impl<G: GraphViewOps + IntoDynamic> From<G> for PyGraphView
Graph view is a read-only version of a graph at a certain point in time.
source§impl PyClassImpl for PyGraphView
impl PyClassImpl for PyGraphView
source§const IS_BASETYPE: bool = true
const IS_BASETYPE: bool = true
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type Layout = PyCell<PyGraphView>
type Layout = PyCell<PyGraphView>
§type ThreadChecker = ThreadCheckerStub<PyGraphView>
type ThreadChecker = ThreadCheckerStub<PyGraphView>
type Inventory = Pyo3MethodsInventoryForPyGraphView
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyGraphView
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a PyGraphView
source§impl PyTypeInfo for PyGraphView
impl PyTypeInfo for PyGraphView
§type AsRefTarget = PyCell<PyGraphView>
type AsRefTarget = PyCell<PyGraphView>
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
object is an instance of this type.