From b2db66e663fe70fe02d106ee832c96621c850bd6 Mon Sep 17 00:00:00 2001 From: kachark Date: Sat, 30 Mar 2024 20:39:42 -0500 Subject: [PATCH] formatting --- Cargo.toml | 2 +- build.rs | 3 +++ examples/emd_2D/main.rs | 2 +- examples/emd_2D/plot.rs | 1 - examples/sinkhorn_1D/main.rs | 2 +- examples/sinkhorn_1D/plot.rs | 1 - 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6c940cc..275b12c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ cxx-build = "1.0" pyo3 = { version = "0.20", features = ["auto-initialize"] } numpy = "0.20" rand = "0.8" -criterion = "0.3" +criterion = { version = "0.4", features = ["html_reports"] } [features] default = ["ndarray-linalg-openblas-system"] diff --git a/build.rs b/build.rs index 4f0954b..d9dbf8b 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,7 @@ fn main() { + // Temporary workaround to find M1 mac location of homebrew libraries + println!("cargo:rustc-link-search=/opt/homebrew/opt/openblas/lib"); + cxx_build::bridge("src/exact/ffi.rs") .file("src/exact/fast_transport/EMD_wrapper.cpp") .flag_if_supported("-std=c++14") diff --git a/examples/emd_2D/main.rs b/examples/emd_2D/main.rs index 58814ad..2ed9e69 100644 --- a/examples/emd_2D/main.rs +++ b/examples/emd_2D/main.rs @@ -1,8 +1,8 @@ use ndarray::prelude::*; use ndarray_stats::QuantileExt; -use rust_optimal_transport as ot; use ot::prelude::*; +use rust_optimal_transport as ot; mod plot; diff --git a/examples/emd_2D/plot.rs b/examples/emd_2D/plot.rs index ef55ceb..1c6ee90 100644 --- a/examples/emd_2D/plot.rs +++ b/examples/emd_2D/plot.rs @@ -15,7 +15,6 @@ pub fn plot_py( // Start the python interpreter Python::with_gil(|py| { - // Import matplotlib let plt = py.import("matplotlib.pyplot")?; diff --git a/examples/sinkhorn_1D/main.rs b/examples/sinkhorn_1D/main.rs index 46d2f7a..ebe4133 100644 --- a/examples/sinkhorn_1D/main.rs +++ b/examples/sinkhorn_1D/main.rs @@ -1,8 +1,8 @@ use ndarray::{prelude::*, stack}; use ndarray_stats::QuantileExt; -use rust_optimal_transport as ot; use ot::prelude::*; +use rust_optimal_transport as ot; mod plot; diff --git a/examples/sinkhorn_1D/plot.rs b/examples/sinkhorn_1D/plot.rs index f3b2fbe..82ec0ff 100644 --- a/examples/sinkhorn_1D/plot.rs +++ b/examples/sinkhorn_1D/plot.rs @@ -14,7 +14,6 @@ pub fn plot_py( // Start the python interpreter Python::with_gil(|py| { - // Import matplotlib let plt = py.import("matplotlib.pyplot")?;