Skip to content

Commit

Permalink
make the inner rust value accessible on python NodeState and LazyNode…
Browse files Browse the repository at this point in the history
…State wrappers (#1878)

make the inner rust value accessible on python NodeState and LazyNodeState wrappers so they can be used as input arguments for other functions
  • Loading branch information
ljeub-pometry authored Dec 2, 2024
1 parent a8813ad commit c340a1b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions raphtory/src/python/graph/node_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ macro_rules! impl_lazy_node_state {
inner: LazyNodeState<'static, $op, DynamicGraph, DynamicGraph>,
}

impl $name {
pub fn inner(&self) -> &LazyNodeState<'static, $op, DynamicGraph, DynamicGraph> {
&self.inner
}
}

#[pymethods]
impl $name {
/// Compute all values and return the result as a node view
Expand Down Expand Up @@ -306,6 +312,12 @@ macro_rules! impl_node_state {
inner: Arc<NodeState<'static, $value, DynamicGraph, DynamicGraph>>,
}

impl $name {
pub fn inner(&self) -> &NodeState<'static, $value, DynamicGraph, DynamicGraph> {
self.inner.as_ref()
}
}

impl_node_state_ops!(
$name,
$value,
Expand Down

0 comments on commit c340a1b

Please sign in to comment.