Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ljeub-pometry committed Nov 6, 2024
1 parent 5f1e41d commit 5d5b559
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 89 deletions.
82 changes: 16 additions & 66 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ reqwest = { version = "0.12.8", default-features = false, features = [
] }
serde = { version = "1.0.197", features = ["derive", "rc"] }
serde_json = "1.0.114"
pyo3 = { version = "0.20.0", features = ["multiple-pymethods", "chrono"] }
pyo3-build-config = "0.20.0"
numpy = "0.20.0"
pyo3 = { version = "0.22.6", features = ["multiple-pymethods", "chrono"] }
pyo3-build-config = "0.22.6"
numpy = "0.22.1"
itertools = "0.13.0"
rand = "0.8.5"
rayon = "1.8.1"
Expand Down Expand Up @@ -106,6 +106,7 @@ polars-core = "0.39.2"
polars-io = "0.39.2"
polars-utils = "0.39.2"
kdam = { git = "https://github.com/ljeub-pometry/kdam.git", branch = "pyo3_0_22" }
hashbrown = "0.15.1"
pretty_assertions = "1.4.0"
quickcheck = "1.0.3"
quickcheck_macros = "1.0.0"
Expand Down
1 change: 0 additions & 1 deletion examples/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ regex = { workspace = true }
serde = { workspace = true }
itertools = { workspace = true }
tracing = { workspace = true }
tqdm = { workspace = true }

[[bin]]
name = "btc"
Expand Down
7 changes: 3 additions & 4 deletions raphtory/src/core/entities/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::{borrow::Cow, ops::Index, sync::Arc};

use raphtory_api::core::entities::edges::edge_ref::EdgeRef;
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use std::{borrow::Cow, sync::Arc};

pub mod edges;
pub mod graph;
Expand Down Expand Up @@ -81,14 +80,14 @@ mod test {

#[test]
fn set_one() {
let mut bm: Multiple = [1].into_iter().collect();
let bm: Multiple = [1].into_iter().collect();
let actual = bm.into_iter().collect::<Vec<_>>();
assert_eq!(actual, vec![1usize]);
}

#[test]
fn set_two() {
let mut bm: Multiple = [1, 67].into_iter().collect();
let bm: Multiple = [1, 67].into_iter().collect();

let actual = bm.into_iter().collect::<Vec<_>>();
assert_eq!(actual, vec![1usize, 67]);
Expand Down
5 changes: 1 addition & 4 deletions raphtory/src/io/parquet_loaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use crate::{
serialise::incremental::InternalCache,
};
use itertools::Itertools;
use polars_arrow::{
array::StructArray,
datatypes::{ArrowDataType as DataType, ArrowSchema, Field},
};
use polars_arrow::datatypes::{ArrowDataType as DataType, ArrowSchema, Field};
use polars_parquet::{
read,
read::{read_metadata, FileMetaData, FileReader},
Expand Down
4 changes: 2 additions & 2 deletions raphtory/src/python/graph/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ impl PyEdge {
/// Returns:
/// List[int]: A list of unix timestamps.
///
pub fn history<'py>(&self, py: Python<'py>) -> Py<PyArray<i64, Ix1>> {
pub fn history<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray<i64, Ix1>> {
let history = self.edge.history();
history.into_pyarray(py).to_owned()
history.into_pyarray_bound(py)
}

/// Returns the number of times an edge is added or change to an edge is made.
Expand Down
4 changes: 2 additions & 2 deletions raphtory/src/python/graph/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ impl PyNode {
///
/// Returns:
/// List[int]: A list of unix timestamps of the event history of node.
pub fn history(&self, py: Python<'_>) -> Py<PyArray<i64, Ix1>> {
pub fn history<'py>(&self, py: Python<'py>) -> Bound<'py, PyArray<i64, Ix1>> {
let history = self.node.history();
history.into_pyarray(py).to_owned()
history.into_pyarray_bound(py)
}

/// Returns the history of a node, including node additions and changes made to node.
Expand Down
14 changes: 7 additions & 7 deletions raphtory/src/python/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,13 +413,13 @@ impl From<Vec<i64>> for NumpyArray {
impl IntoPy<PyObject> for NumpyArray {
fn into_py(self, py: Python<'_>) -> PyObject {
match self {
NumpyArray::Bool(value) => value.into_pyarray(py).to_object(py),
NumpyArray::I32(value) => value.into_pyarray(py).to_object(py),
NumpyArray::I64(value) => value.into_pyarray(py).to_object(py),
NumpyArray::U32(value) => value.into_pyarray(py).to_object(py),
NumpyArray::U64(value) => value.into_pyarray(py).to_object(py),
NumpyArray::F32(value) => value.into_pyarray(py).to_object(py),
NumpyArray::F64(value) => value.into_pyarray(py).to_object(py),
NumpyArray::Bool(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::I32(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::I64(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::U32(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::U64(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::F32(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::F64(value) => value.into_pyarray_bound(py).to_object(py),
NumpyArray::Props(vec) => match vec.first() {
Some(Prop::Bool(_)) => {
Self::Bool(vec.into_iter().filter_map(|p| p.into_bool()).collect()).into_py(py)
Expand Down

0 comments on commit 5d5b559

Please sign in to comment.