Skip to content

Commit ddbc6ca

Browse files
committed
chore: clean-up
1 parent 3ab0f4f commit ddbc6ca

10 files changed

Lines changed: 35 additions & 27 deletions

File tree

lib/node_modules/@stdlib/ndarray/base/rot90/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# rot90
2222

23-
> Rotate an ndarray 90 degrees in the plane specified by two dimension indices.
23+
> Rotate an ndarray 90 degrees in a specified plane.
2424
2525
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
2626

@@ -57,7 +57,7 @@ var y = rot90( x, [ 0, 1 ], 1, false );
5757
The function accepts the following arguments:
5858

5959
- **x**: input ndarray.
60-
- **dims**: dimension indices defining the plane of rotation. Must contain exactly two unique dimension indices.
60+
- **dims**: dimension indices defining the plane of rotation. Must contain exactly two unique dimension indices. If a dimension index is provided as an integer less than zero, the dimension index is resolved relative to the last dimension, with the last dimension corresponding to the value `-1`.
6161
- **k**: number of times to rotate by 90 degrees. Positive values rotate counterclockwise. Negative values rotate clockwise.
6262
- **writable**: boolean indicating whether a returned ndarray should be writable.
6363

@@ -71,8 +71,8 @@ The function accepts the following arguments:
7171

7272
## Notes
7373

74-
- If `k > 0`, the function rotates the ndarray counterclockwise.
75-
- If `k < 0`, the function rotates the ndarray clockwise.
74+
- If `k > 0`, the function rotates the plane from the first specified dimension toward the second specified dimension. This means that, for a two-dimensional ndarray and `dims = [0, 1]`, the function rotates the plane counterclockwise.
75+
- If `k < 0`, the function rotates the plane from the second specified dimension toward the first specified dimension. This means that, for a two-dimensional ndarray and `dims = [1, 0]`, the function rotates the plane clockwise.
7676
- Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
7777
- The `writable` parameter **only** applies to ndarray constructors supporting **read-only** instances.
7878
- The returned ndarray is a **view** of the input ndarray. Accordingly, writing to the original ndarray will **mutate** the returned ndarray and vice versa.

lib/node_modules/@stdlib/ndarray/base/rot90/benchmark/benchmark.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var rot90 = require( './../lib' );
3131

3232
// MAIN //
3333

34-
bench( format( '%s::2d,base', pkg ), function benchmark( b ) {
34+
bench( format( '%s::base:ndims=2', pkg ), function benchmark( b ) {
3535
var values;
3636
var v;
3737
var i;
@@ -59,7 +59,7 @@ bench( format( '%s::2d,base', pkg ), function benchmark( b ) {
5959
b.end();
6060
});
6161

62-
bench( format( '%s::2d,non-base', pkg ), function benchmark( b ) {
62+
bench( format( '%s::non-base:ndims=2', pkg ), function benchmark( b ) {
6363
var values;
6464
var v;
6565
var i;
@@ -91,7 +91,7 @@ bench( format( '%s::2d,non-base', pkg ), function benchmark( b ) {
9191
b.end();
9292
});
9393

94-
bench( format( '%s::3d,base,dims=[1,2]', pkg ), function benchmark( b ) {
94+
bench( format( '%s::base:ndims=3,dims=[1,2]', pkg ), function benchmark( b ) {
9595
var values;
9696
var v;
9797
var i;
@@ -119,7 +119,7 @@ bench( format( '%s::3d,base,dims=[1,2]', pkg ), function benchmark( b ) {
119119
b.end();
120120
});
121121

122-
bench( format( '%s::3d,base,dims=[0,2]', pkg ), function benchmark( b ) {
122+
bench( format( '%s::base:ndims=3,dims=[0,2]', pkg ), function benchmark( b ) {
123123
var values;
124124
var v;
125125
var i;
@@ -147,7 +147,7 @@ bench( format( '%s::3d,base,dims=[0,2]', pkg ), function benchmark( b ) {
147147
b.end();
148148
});
149149

150-
bench( format( '%s::4d,base', pkg ), function benchmark( b ) {
150+
bench( format( '%s::base:ndims=4', pkg ), function benchmark( b ) {
151151
var values;
152152
var v;
153153
var i;
@@ -175,7 +175,7 @@ bench( format( '%s::4d,base', pkg ), function benchmark( b ) {
175175
b.end();
176176
});
177177

178-
bench( format( '%s::5d,base', pkg ), function benchmark( b ) {
178+
bench( format( '%s::base:ndims=5', pkg ), function benchmark( b ) {
179179
var values;
180180
var v;
181181
var i;

lib/node_modules/@stdlib/ndarray/base/rot90/docs/repl.txt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11

22
{{alias}}( x, dims, k, writable )
3-
Rotates an ndarray 90 degrees in the plane specified by two dimension
4-
indices.
3+
Rotates an ndarray 90 degrees in a specified plane.
54

6-
If `k > 0`, the function rotates the ndarray counterclockwise. If `k < 0`,
7-
the function rotates the ndarray clockwise.
5+
If `k > 0`, the function rotates the plane from the first specified
6+
dimension toward the second specified dimension. This means that, for a two-
7+
dimensional ndarray and `dims = [0, 1]`, the function rotates the plane
8+
counterclockwise.
9+
10+
If `k < 0`, the function rotates the plane from the second specified
11+
dimension toward the first specified dimension. This means that, for a two-
12+
dimensional ndarray and `dims = [1, 0]`, the function rotates the plane
13+
clockwise.
814

915
Each provided dimension index must reside on the interval [-ndims, ndims-1].
1016

@@ -19,7 +25,9 @@
1925

2026
dims: ArrayLikeObject<integer>
2127
Dimension indices defining the plane of rotation. Must contain exactly
22-
two unique dimension indices.
28+
two unique dimension indices. If less than zero, an index is resolved
29+
relative to the last dimension, with the last dimension corresponding to
30+
the value `-1`.
2331

2432
k: integer
2533
Number of times to rotate by 90 degrees.

lib/node_modules/@stdlib/ndarray/base/rot90/docs/types/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import { typedndarray } from '@stdlib/types/ndarray';
2424
import { Collection } from '@stdlib/types/array';
2525

2626
/**
27-
* Rotates an ndarray 90 degrees in the plane specified by two dimension indices.
27+
* Rotates an ndarray 90 degrees in a specified plane.
2828
*
2929
* ## Notes
3030
*
31-
* - If `k > 0`, the function rotates the ndarray counterclockwise.
32-
* - If `k < 0`, the function rotates the ndarray clockwise.
31+
* - If `k > 0`, the function rotates the plane from the first specified dimension toward the second specified dimension. This means that, for a two-dimensional ndarray and `dims = [0, 1]`, the function rotates the plane counterclockwise.
32+
* - If `k < 0`, the function rotates the plane from the second specified dimension toward the first specified dimension. This means that, for a two-dimensional ndarray and `dims = [1, 0]`, the function rotates the plane clockwise.
3333
* - Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
3434
*
3535
* @param x - input array

lib/node_modules/@stdlib/ndarray/base/rot90/docs/types/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import rot90 = require( './index' );
4141
rot90( zeros( 'generic', sh, ord ), [ 0, 1 ], 1, false ); // $ExpectType genericndarray<number>
4242
}
4343

44-
// The compiler throws an error if the function is provided a first argument which is not an ndarray having a recognized/supported data type...
44+
// The compiler throws an error if the function is provided a first argument which is not an ndarray...
4545
{
4646
rot90( '10', [ 0, 1 ], 1, false ); // $ExpectError
4747
rot90( 10, [ 0, 1 ], 1, false ); // $ExpectError

lib/node_modules/@stdlib/ndarray/base/rot90/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ y = rot90( x, [ 0, 1 ], -1, false );
5050
console.log( ndarray2array( y ) );
5151
// => [ [ 4, 1 ], [ 5, 2 ], [ 6, 3 ] ]
5252

53-
// Reverse the rotation direction by reversing the dims order:
53+
// Reverse the rotation direction by reversing the dimension order:
5454
y = rot90( x, [ 1, 0 ], 1, false );
5555
console.log( ndarray2array( y ) );
5656
// => [ [ 4, 1 ], [ 5, 2 ], [ 6, 3 ] ]

lib/node_modules/@stdlib/ndarray/base/rot90/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* Rotate an ndarray 90 degrees in the plane specified by two dimension indices.
22+
* Rotate an ndarray 90 degrees in a specified plane.
2323
*
2424
* @module @stdlib/ndarray/base/rot90
2525
*

lib/node_modules/@stdlib/ndarray/base/rot90/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ var format = require( '@stdlib/string/format' );
3434
// MAIN //
3535

3636
/**
37-
* Rotates an ndarray 90 degrees in the plane specified by two dimension indices.
37+
* Rotates an ndarray 90 degrees in a specified plane.
3838
*
3939
* ## Notes
4040
*
41-
* - If `k > 0`, the function rotates the ndarray counterclockwise.
42-
* - If `k < 0`, the function rotates the ndarray clockwise.
41+
* - If `k > 0`, the function rotates the plane from the first specified dimension toward the second specified dimension. This means that, for a two-dimensional ndarray and `dims = [0, 1]`, the function rotates the plane counterclockwise.
42+
* - If `k < 0`, the function rotates the plane from the second specified dimension toward the first specified dimension. This means that, for a two-dimensional ndarray and `dims = [1, 0]`, the function rotates the plane clockwise.
4343
* - Each provided dimension index must reside on the interval `[-ndims, ndims-1]`.
4444
*
4545
* @param {ndarray} x - input array

lib/node_modules/@stdlib/ndarray/base/rot90/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/ndarray/base/rot90",
33
"version": "0.0.0",
4-
"description": "Rotate an ndarray 90 degrees in the plane specified by two dimension indices.",
4+
"description": "Rotate an ndarray 90 degrees in a specified plane.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

lib/node_modules/@stdlib/ndarray/base/rot90/test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ tape( 'the function supports a `writable` parameter', function test( t ) {
615615
t.end();
616616
});
617617

618-
tape( 'the function supports a non-zero offset', function test( t ) {
618+
tape( 'the function supports ndarrays having a non-zero offset', function test( t ) {
619619
var expected;
620620
var arr;
621621
var buf;
@@ -647,7 +647,7 @@ tape( 'the function supports a non-zero offset', function test( t ) {
647647
t.end();
648648
});
649649

650-
tape( 'the function supports rotating four times in the same plane, returning the original arrangement', function test( t ) {
650+
tape( 'the function returns the original arrangement when rotating four times in the same plane', function test( t ) {
651651
var expected;
652652
var arr;
653653
var buf;

0 commit comments

Comments
 (0)