diff --git a/cozo-core/src/algo/pagerank.rs b/cozo-core/src/algo/pagerank.rs index d6c866b7..7ada6097 100644 --- a/cozo-core/src/algo/pagerank.rs +++ b/cozo-core/src/algo/pagerank.rs @@ -8,9 +8,13 @@ use std::collections::BTreeMap; +#[cfg(not(feature = "rayon"))] +use approx::AbsDiffEq; #[cfg(feature = "rayon")] use graph::prelude::{page_rank, CsrLayout, DirectedCsrGraph, GraphBuilder, PageRankConfig}; use miette::Result; +#[cfg(not(feature = "rayon"))] +use nalgebra::{Dynamic, OMatrix, U1}; use smartstring::{LazyCompact, SmartString}; use crate::algo::AlgoImpl; @@ -37,8 +41,8 @@ impl AlgoImpl for PageRank { ) -> Result<()> { let edges = algo.relation(0)?; let undirected = algo.bool_option("undirected", Some(false))?; - let theta = algo.unit_interval_option("theta", Some(0.8))? as f32; - let epsilon = algo.unit_interval_option("epsilon", Some(0.05))? as f32; + let theta = algo.unit_interval_option("theta", Some(0.85))? as f32; + let epsilon = algo.unit_interval_option("epsilon", Some(0.0001))? as f32; let iterations = algo.pos_integer_option("iterations", Some(10))?; let (graph, indices, _) = edges.convert_edge_to_graph(undirected, tx, stores)?; @@ -98,9 +102,6 @@ fn pagerank( iterations: usize, poison: Poison, ) -> Result> { - use approx::AbsDiffEq; - use nalgebra::{Dynamic, OMatrix, U1}; - let init_val = (1. - theta) / edges.len() as f32; let mut g_mat = OMatrix::::repeat(edges.len(), edges.len(), init_val); let n = edges.len(); diff --git a/scripts/build-release-linux.sh b/scripts/build-release-linux.sh index de4c0071..31039bf8 100755 --- a/scripts/build-release-linux.sh +++ b/scripts/build-release-linux.sh @@ -4,9 +4,14 @@ set -e VERSION=$(cat ./VERSION) -rm -fr release +#rm -fr release mkdir -p release +# python +CARGO_NET_GIT_FETCH_WITH_CLI=true podman run --rm -v $(pwd):/io -w /io/cozo-lib-python ghcr.io/pyo3/maturin:latest build --release --strip -F compact -F storage-rocksdb +# copy python +cp target/wheels/*.whl release/ + for TARGET in aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu; do # standalone, c, java, nodejs CARGO_PROFILE_RELEASE_LTO=fat cross build --release -p cozoserver -p cozo_c -p cozo_java -p cozo-node -F compact -F storage-rocksdb --target $TARGET @@ -34,8 +39,3 @@ for TARGET in aarch64-linux-android armv7-linux-androideabi i686-linux-android x CARGO_PROFILE_RELEASE_LTO=fat cross build -p cozo_java --release --target=$TARGET cp target/$TARGET/release/libcozo_java.so release/libcozo_java-$VERSION-$TARGET.so # java done - -# python -CARGO_NET_GIT_FETCH_WITH_CLI=true podman run --rm -v $(pwd):/io -w /io/cozo-lib-python ghcr.io/pyo3/maturin:latest build --release --strip -F compact -F storage-rocksdb -# copy python -cp target/wheels/*.whl release/ \ No newline at end of file diff --git a/scripts/update-images.sh b/scripts/update-images.sh new file mode 100644 index 00000000..e4c472e3 --- /dev/null +++ b/scripts/update-images.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# +# Copyright 2022, The Cozo Project Authors. +# +# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. +# If a copy of the MPL was not distributed with this file, +# You can obtain one at https://mozilla.org/MPL/2.0/. +# + +podman pull ghcr.io/pyo3/maturin:latest +podman pull ghcr.io/cross-rs/x86_64-unknown-linux-musl:main +podman pull ghcr.io/cross-rs/aarch64-unknown-linux-musl:main +podman pull ghcr.io/cross-rs/x86_64-linux-android:main +podman pull ghcr.io/cross-rs/i686-linux-android:main +podman pull ghcr.io/cross-rs/aarch64-linux-android:main +podman pull ghcr.io/cross-rs/armv7-linux-androideabi:main +podman pull ghcr.io/cross-rs/x86_64-unknown-linux-gnu:main +podman pull ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main \ No newline at end of file