Skip to content

Commit fcf375a

Browse files
committed
Cleanup and renamed internal functions of NDArray.Indexing.*
1 parent f4c0139 commit fcf375a

File tree

6 files changed

+1261
-1269
lines changed

6 files changed

+1261
-1269
lines changed

src/NumSharp.Core/Indexing/np.nonzero.cs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,15 @@ namespace NumSharp
1212
{
1313
public static partial class np
1414
{
15-
1615
/// <summary>
17-
/// Return the indices of the elements that are non-zero.
18-
///
19-
/// Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension.The values in a are always tested and returned in row-major, C-style order.
20-
///
21-
/// To group the indices by element, rather than dimension, use argwhere, which returns a row for each non-zero element.
16+
/// Return the indices of the elements that are non-zero.
17+
/// Returns a tuple of arrays, one for each dimension of a, containing the indices of the non-zero elements in that dimension.The values in a are always tested and returned in row-major, C-style order.
18+
/// To group the indices by element, rather than dimension, use argwhere, which returns a row for each non-zero element.
2219
/// </summary>
23-
/// <param name="a"></param>
24-
/// <returns></returns>
20+
/// <param name="a">Input array.</param>
21+
/// <returns>Indices of elements that are non-zero.</returns>
22+
/// <remarks>https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html</remarks>
2523
public static NDArray<int>[] nonzero(in NDArray a)
2624
=> a.TensorEngine.NonZero(a);
27-
28-
2925
}
3026
}

src/NumSharp.Core/Selection/NDArray.Indexing.Masking.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Diagnostics;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.Linq;
45
using System.Runtime.CompilerServices;
56
using NumSharp.Backends;
@@ -16,9 +17,10 @@ public partial class NDArray
1617
/// <remarks>https://docs.scipy.org/doc/numpy-1.17.0/user/basics.indexing.html</remarks>
1718
/// <exception cref="IndexOutOfRangeException">When one of the indices exceeds limits.</exception>
1819
/// <exception cref="ArgumentException">indices must be of Int type (byte, u/short, u/int, u/long).</exception>
20+
[SuppressMessage("ReSharper", "CoVariantArrayConversion")]
1921
public NDArray this[NDArray<bool> mask]
2022
{
21-
get => retrieve_indices(this, np.nonzero(mask), null, true);
23+
get => FetchIndices(this, np.nonzero(mask), null, true);
2224
set
2325
{
2426
throw new NotImplementedException("Setter is not implemented yet");

0 commit comments

Comments
 (0)