Repository: rust-ndarray/ndarray (Rust)

Issue:
ArcArray1
There are some references to [`RcArray1` & `RcArray2`](https://github.com/rust-ndarray/ndarray/blob/master/serialization-tests/tests/serialize.rs#L29), causing some warnings. I was planning to put in a PR to move these to ArcArray, but ArcArray1 doesn't exist.

Should we create them? Or move specializations up a level?


Discussion:
In the end, it's syntactic sugar and I think we should keep them (if nothing else, for consistency with `Array1`, `ArrayView1`, etc.). What do you mean by moving specializations up a level?
Should we create `ArcArray1` & `ArcArray2`? Currently we only have a deprecated `RcArray1` & `RcArray2`
Yes, I think we should.
@alex179ohm if you're looking for a good issue to begin with, this could be interesting



Patch:
diff --git a/src/aliases.rs b/src/aliases.rs
index 1c82120a4..f7c71b3d4 100644
--- a/src/aliases.rs
+++ b/src/aliases.rs
@@ -3,7 +3,7 @@
 
 use crate::dimension::Dim;
 #[allow(deprecated)]
-use crate::{Array, ArrayView, ArrayViewMut, Ix, IxDynImpl, RcArray};
+use crate::{ArcArray, Array, ArrayView, ArrayViewMut, Ix, IxDynImpl, RcArray};
 
 /// Create a zero-dimensional index
 #[allow(non_snake_case)]
@@ -158,3 +158,8 @@ pub type RcArray1<A> = RcArray<A, Ix1>;
 #[allow(deprecated)]
 #[deprecated(note = "`RcArray` has been renamed to `ArcArray`")]
 pub type RcArray2<A> = RcArray<A, Ix2>;
+
+/// one-dimensional shared ownership array
+pub type ArcArray1<A> = ArcArray<A, Ix1>;
+/// two-dimensional shared ownership array
+pub type ArcArray2<A> = ArcArray<A, Ix2>;
diff --git a/src/free_functions.rs b/src/free_functions.rs
index 7e2bb752f..8319865dd 100644
--- a/src/free_functions.rs
+++ b/src/free_functions.rs
@@ -9,8 +9,8 @@
 use std::mem::{forget, size_of};
 use std::slice;
 
-use crate::dimension;
 use crate::imp_prelude::*;
+use crate::{dimension, ArcArray1, ArcArray2};
 
 /// Create an [**`Array`**](type.Array.html) with one, two or
 /// three dimensions.
@@ -63,7 +63,7 @@ pub fn arr1<A: Clone>(xs: &[A]) -> Array1<A> {
 }
 
 /// Create a one-dimensional array with elements from `xs`.
-pub fn rcarr1<A: Clone>(xs: &[A]) -> ArcArray<A, Ix1> {
+pub fn rcarr1<A: Clone>(xs: &[A]) -> ArcArray1<A> {
     arr1(xs).into_shared()
 }
 
@@ -289,7 +289,7 @@ where
 
 /// Create a two-dimensional array with elements from `xs`.
 ///
-pub fn rcarr2<A: Clone, V: Clone + FixedInitializer<Elem = A>>(xs: &[V]) -> ArcArray<A, Ix2> {
+pub fn rcarr2<A: Clone, V: Clone + FixedInitializer<Elem = A>>(xs: &[V]) -> ArcArray2<A> {
     arr2(xs).into_shared()
 }
 


Test patch:
diff --git a/serialization-tests/tests/serialize.rs b/serialization-tests/tests/serialize.rs
index 953f2a434..efb3bacd9 100644
--- a/serialization-tests/tests/serialize.rs
+++ b/serialization-tests/tests/serialize.rs
@@ -9,7 +9,7 @@ extern crate rmp_serde;
 #[cfg(feature = "ron")]
 extern crate ron;
 
-use ndarray::{arr0, arr1, arr2, s, ArcArray, ArrayD, Ix2, IxDyn};
+use ndarray::{arr0, arr1, arr2, s, ArcArray, ArcArray2, ArrayD, IxDyn};
 
 #[test]
 fn serial_many_dim_serde() {
@@ -98,13 +98,13 @@ fn serial_ixdyn_serde() {
 fn serial_wrong_count_serde() {
     // one element too few
     let text = r##"{"v":1,"dim":[2,3],"data":[3,1,2.2,3.1,4]}"##;
-    let arr = serde_json::from_str::<ArcArray<f32, Ix2>>(text);
+    let arr = serde_json::from_str::<ArcArray2<f32>>(text);
     println!("{:?}", arr);
     assert!(arr.is_err());
 
     // future version
     let text = r##"{"v":200,"dim":[2,3],"data":[3,1,2.2,3.1,4,7]}"##;
-    let arr = serde_json::from_str::<ArcArray<f32, Ix2>>(text);
+    let arr = serde_json::from_str::<ArcArray2<f32>>(text);
     println!("{:?}", arr);
     assert!(arr.is_err());
 }