Repository: bluss/rust-ndarray
Pull request #257 (2016-12-24 14:31:43)

Prepare next version


Patch:
diff --git a/.travis.yml b/.travis.yml
index 98f4b2fa..a9c2e8f8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,6 +26,7 @@ addons:
       - libopenblas-dev
 script:
   - |
+      cargo build --verbose --no-default-features &&
       cargo build --verbose --features "$FEATURES" &&
       cargo test --verbose --features "$FEATURES" &&
       cargo test --release --verbose --features "" &&
diff --git a/README.rst b/README.rst
index a771f307..f3d2c4e4 100644
--- a/README.rst
+++ b/README.rst
@@ -72,11 +72,16 @@ your `Cargo.toml`.
 How to use with cargo::
 
     [dependencies]
-    ndarray = "0.7"
+    ndarray = "0.7.2"
 
 Recent Changes (ndarray)
 ------------------------
 
+- 0.7.2
+
+  - Add array methods ``.remove_axis()``, ``.merge_axes()`` and ``.invert_axis()``
+  - Rename ``Axis``’ accessor ``axis`` to ``index``, old name is deprecated.
+
 - 0.7.1
 
   - Fix two bugs in ``Array::clone()``; it did not support zero-size elements
diff --git a/src/impl_methods.rs b/src/impl_methods.rs
index 732e046b..c9b7077f 100644
--- a/src/impl_methods.rs
+++ b/src/impl_methods.rs
@@ -1376,6 +1376,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
         })
     }
 
+    #[cfg(lanes_along)]
     fn lanes_along<'a, F>(&'a self, axis: Axis, mut visit: F)
         where D: RemoveAxis,
               F: FnMut(ArrayView1<'a, A>),
@@ -1392,6 +1393,7 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
         })
     }
 
+    #[cfg(lanes_along)]
     fn lanes_along_mut<'a, F>(&'a mut self, axis: Axis, mut visit: F)
         where D: RemoveAxis,
               S: DataMut,


Test patch:
diff --git a/numeric-tests/tests/accuracy.rs b/numeric-tests/tests/accuracy.rs
index 1f7bee48..03fcf455 100644
--- a/numeric-tests/tests/accuracy.rs
+++ b/numeric-tests/tests/accuracy.rs
@@ -10,8 +10,6 @@ use rand::Rng;
 use ndarray::prelude::*;
 use ndarray::{
     Data,
-    DataMut,
-    RemoveAxis,
     LinalgScalar,
 };
 
@@ -206,13 +204,6 @@ trait Utils {
     type Data;
     fn max(&self) -> &Self::Elem
         where Self::Elem: PartialOrd;
-    fn lift<F>(&mut self, F)
-        where F: FnMut(Self::Elem) -> Self::Elem, Self::Elem: Copy,
-              Self::Data: DataMut;
-    fn fold_axis<F>(&self, axis: Axis, f: F) -> Array<Self::Elem, <Self::Dim as RemoveAxis>::Smaller>
-        where Self::Dim: RemoveAxis,
-              Self::Elem: Clone,
-              F: FnMut(&Self::Elem, &Self::Elem) -> Self::Elem;
 }
 
 impl<A, S, D> Utils for ArrayBase<S, D>
@@ -238,29 +229,4 @@ impl<A, S, D> Utils for ArrayBase<S, D>
             panic!("empty");
         }
     }
-    fn lift<F>(&mut self, mut f: F)
-        where F: FnMut(A) -> A, A: Copy,
-              S: DataMut<Elem=A>
-
-    {
-        for elt in self {
-            *elt = f(*elt);
-        }
-    }
-
-    fn fold_axis<F>(&self, axis: Axis, mut f: F) -> Array<A, D::Smaller>
-        where D: RemoveAxis,
-              F: FnMut(&A, &A) -> A,
-              A: Clone,
-    {
-        let len = self.shape()[axis.axis()];
-        let mut row = self.subview(axis, 0).to_owned();
-        for i in 1..len {
-            let r2 = self.subview(axis, i);
-            for (a, b) in row.iter_mut().zip(r2) {
-                *a = f(a, b);
-            }
-        }
-        row
-    }
 }