Skip to content

Commit

Permalink
Bump ndarray from 0.15.4 to 0.16.0 (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke authored Aug 5, 2024
1 parent 4e47e85 commit f013f50
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/3d_charts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors = ["Michael Freeborn <[email protected]>"]
edition = "2021"

[dependencies]
ndarray = "0.15.6"
ndarray = "0.16.0"
rand = "0.8.5"
plotly = { path = "../../plotly" }
10 changes: 5 additions & 5 deletions examples/3d_charts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rand::Rng;
// 3D Scatter Plots
fn simple_scatter3d_plot() {
let n: usize = 100;
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec();
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = t.iter().map(|x| x.sin()).collect();
let z: Vec<f64> = t.iter().map(|x| x.cos()).collect();

Expand All @@ -25,7 +25,7 @@ fn simple_scatter3d_plot() {

fn customized_scatter3d_plot() {
let n: usize = 100;
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec();
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = t.iter().map(|x| x.sin()).collect();
let z: Vec<f64> = t.iter().map(|x| x.cos()).collect();
let sizelookup = z.clone();
Expand Down Expand Up @@ -114,7 +114,7 @@ fn customized_scatter3d_plot() {
// 3D Line Plots
fn simple_line3d_plot() {
let n: usize = 100;
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec();
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = t.iter().map(|x| x.sin()).collect();
let z: Vec<f64> = t.iter().map(|x| x.cos()).collect();

Expand All @@ -128,8 +128,8 @@ fn simple_line3d_plot() {
// 3D Surface Plot
fn surface_plot() {
let n: usize = 100;
let x: Vec<f64> = Array::linspace(-10., 10., n).into_raw_vec();
let y: Vec<f64> = Array::linspace(-10., 10., n).into_raw_vec();
let x: Vec<f64> = Array::linspace(-10., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = Array::linspace(-10., 10., n).into_raw_vec_and_offset().0;
let z: Vec<Vec<f64>> = x
.iter()
.map(|i| {
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_charts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Michael Freeborn <[email protected]>"]
edition = "2021"

[dependencies]
ndarray = "0.15.6"
ndarray = "0.16.0"
plotly = { path = "../../plotly" }
rand = "0.8.5"
rand_distr = "0.4.3"
6 changes: 3 additions & 3 deletions examples/basic_charts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rand_distr::{Distribution, Normal, Uniform};
// Scatter Plots
fn simple_scatter_plot() {
let n: usize = 100;
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec();
let t: Vec<f64> = Array::linspace(0., 10., n).into_raw_vec_and_offset().0;
let y: Vec<f64> = t.iter().map(|x| x.sin()).collect();

let trace = Scatter::new(t, y).mode(Mode::Markers);
Expand All @@ -30,7 +30,7 @@ fn simple_scatter_plot() {
fn line_and_scatter_plots() {
let n: usize = 100;
let mut rng = rand::thread_rng();
let random_x: Vec<f64> = Array::linspace(0., 1., n).into_raw_vec();
let random_x: Vec<f64> = Array::linspace(0., 1., n).into_raw_vec_and_offset().0;
let random_y0: Vec<f64> = Normal::new(5., 1.)
.unwrap()
.sample_iter(&mut rng)
Expand Down Expand Up @@ -86,7 +86,7 @@ fn bubble_scatter_plots() {

fn polar_scatter_plot() {
let n: usize = 400;
let theta: Vec<f64> = Array::linspace(0., 360., n).into_raw_vec();
let theta: Vec<f64> = Array::linspace(0., 360., n).into_raw_vec_and_offset().0;
let r: Vec<f64> = theta
.iter()
.map(|x| {
Expand Down
2 changes: 1 addition & 1 deletion examples/images/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2021"

[dependencies]
image = "0.25"
ndarray = "0.15.6"
ndarray = "0.16.0"
plotly = { path = "../../plotly", features = ["plotly_image", "plotly_ndarray"] }
2 changes: 1 addition & 1 deletion examples/ndarray/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ authors = ["Michael Freeborn <[email protected]>"]
edition = "2021"

[dependencies]
ndarray = "0.15.6"
ndarray = "0.16.0"
plotly = { path = "../../plotly", features = ["plotly_ndarray"] }
2 changes: 1 addition & 1 deletion examples/shapes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Michael Freeborn <[email protected]>"]
edition = "2021"

[dependencies]
ndarray = "0.15.6"
ndarray = "0.16.0"
plotly = { path = "../../plotly" }
rand = "0.8.5"
rand_distr = "0.4.3"
2 changes: 1 addition & 1 deletion examples/shapes/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn lines_positioned_relative_to_the_plot_and_to_the_axes() {
}

fn creating_tangent_lines_with_shapes() {
let x0 = Array::linspace(1.0, 3.0, 200).into_raw_vec();
let x0 = Array::linspace(1.0, 3.0, 200).into_raw_vec_and_offset().0;
let y0 = x0.iter().map(|v| *v * (v.powf(2.)).sin() + 1.).collect();

let trace = Scatter::new(x0, y0);
Expand Down
2 changes: 1 addition & 1 deletion examples/statistical_charts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Michael Freeborn <[email protected]>"]
edition = "2021"

[dependencies]
ndarray = "0.15.6"
ndarray = "0.16.0"
plotly = { path = "../../plotly" }
rand = "0.8.5"
rand_distr = "0.4.3"
2 changes: 1 addition & 1 deletion examples/statistical_charts/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn bar_chart_with_error_bars() {
}

fn colored_and_styled_error_bars() {
let x_theo: Vec<f64> = Array::linspace(-4., 4., 100).into_raw_vec();
let x_theo: Vec<f64> = Array::linspace(-4., 4., 100).into_raw_vec_and_offset().0;
let sincx: Vec<f64> = x_theo
.iter()
.map(|x| (x * std::f64::consts::PI).sin() / (*x * std::f64::consts::PI))
Expand Down
4 changes: 2 additions & 2 deletions plotly/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ image = { version = "0.25", optional = true }
js-sys = { version = "0.3", optional = true }
plotly_derive = { version = "0.9.0", path = "../plotly_derive" }
plotly_kaleido = { version = "0.9.0", path = "../plotly_kaleido", optional = true }
ndarray = { version = "0.15.4", optional = true }
ndarray = { version = "0.16.0", optional = true }
once_cell = "1"
serde = { version = "1.0.132", features = ["derive"] }
serde_json = "1.0.73"
Expand All @@ -45,6 +45,6 @@ csv = "1.1.6"
image = "0.25"
itertools = ">=0.10, <0.14"
itertools-num = "0.1.3"
ndarray = "0.15.4"
ndarray = "0.16.0"
plotly_kaleido = { version = "0.9.0", path = "../plotly_kaleido" }
rand_distr = "0.4"
2 changes: 1 addition & 1 deletion plotly/src/traces/scatter_polar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ where
/// let theta: Array<f64, Ix1> = Array::range(0., 360., 360. / n as f64);
/// let mut rs: Array<f64, Ix2> = Array::zeros((11, 11));
/// let mut count = 0.;
/// for mut row in rs.gencolumns_mut() {
/// for mut row in rs.columns_mut() {
/// for index in 0..row.len() {
/// row[index] = count + (index as f64).powf(2.);
/// }
Expand Down

0 comments on commit f013f50

Please sign in to comment.