Skip to content

Commit 1f46fb3

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into refactor/plot
2 parents e6f8305 + fc43c32 commit 1f46fb3

File tree

82 files changed

+3975
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3975
-20
lines changed

lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ var windowShim = require( './window.js' );
4848
var debug = logger( 'jsdoc-doctest' );
4949
var RE_ANNOTATION = /(?:\n|^)(?:var|let|const)? ?([a-zA-Z0-9._]+) ?=?[^;]*;\n\/\/ ?(returns|([A-Za-z][A-Za-z_0-9]*)? ?=>|throws) {0,1}([\s\S]*?)(\n|$)/g;
5050
var RE_CONSOLE = /console\.(?:dir|error|log)/;
51+
var RE_MODULE_TAG = /\* @module[^\n]*\n/g;
5152
var NODE_SHEBANG = /#!\/usr\/bin\/env node/;
5253
var DOPTS = {
5354
'sloppy': true,
@@ -220,6 +221,7 @@ function main( context ) {
220221
* @param {ASTNode} node - node to examine
221222
*/
222223
function validate( node ) {
224+
var wrapped;
223225
var jsdoc;
224226
var ast;
225227

@@ -229,7 +231,14 @@ function main( context ) {
229231
}
230232
jsdoc = findJSDoc( source, node );
231233
if ( isObject( jsdoc ) ) {
232-
ast = parseJSDoc( jsdoc.value, DOPTS );
234+
if ( contains( jsdoc.value, '@module' ) ) {
235+
// Wrap with /** */ and strip @module tag for proper parsing with `doctrine`:
236+
wrapped = '/**' + jsdoc.value + '*/';
237+
wrapped = replace( wrapped, RE_MODULE_TAG, '' );
238+
ast = parseJSDoc( wrapped, DOPTS );
239+
} else {
240+
ast = parseJSDoc( jsdoc.value, DOPTS );
241+
}
233242
processTags( jsdoc, ast.tags );
234243
}
235244
}

lib/node_modules/@stdlib/_tools/makie/makie/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* @module @stdlib/_tools/makie/makie
2525
*
2626
* @example
27-
* var makie = require( '@stdlib/_tools/makie/makie' );
2827
* var spawn = require( 'child_process' ).spawn;
28+
* var makie = require( '@stdlib/_tools/makie/makie' );
2929
*
3030
* function plugin( dirpath, cwd, subpath ) {
3131
* var proc = spawn( 'make', [], 'test' );

lib/node_modules/@stdlib/array/complex64/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* // returns <Complex64Array>
6060
*
6161
* var len = arr.length;
62-
* // returns 1
62+
* // returns 2
6363
*
6464
* @example
6565
* var ArrayBuffer = require( '@stdlib/array/buffer' );
@@ -70,7 +70,7 @@
7070
* // returns <Complex64Array>
7171
*
7272
* var len = arr.length;
73-
* // returns 2
73+
* // returns 1
7474
*
7575
* @example
7676
* var ArrayBuffer = require( '@stdlib/array/buffer' );

lib/node_modules/@stdlib/blas/base/sdsdot/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
3232
*
3333
* var z = sdsdot( x.length, 0.0, x, 1, y, 1 );
34-
* // returns -12.0
34+
* // returns -5.0
3535
*
3636
* @example
3737
* var Float32Array = require( '@stdlib/array/float32' );
@@ -41,7 +41,7 @@
4141
* var y = new Float32Array( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] );
4242
*
4343
* var z = sdsdot.ndarray( x.length, 0.0, x, 1, 0, y, 1, 0 );
44-
* // returns -12.0
44+
* // returns -5.0
4545
*/
4646

4747
// MODULES //

lib/node_modules/@stdlib/blas/ext/base/dsort2sh/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
* var x = new Float64Array( [ 1.0, -2.0, 3.0, -4.0 ] );
4646
* var y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] );
4747
*
48-
* dsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );
48+
* dsort2sh.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 );
4949
*
5050
* console.log( x );
5151
* // => <Float64Array>[ -4.0, -2.0, 1.0, 3.0 ]

lib/node_modules/@stdlib/blas/ext/base/gsort2sh/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* var x = [ 1.0, -2.0, 3.0, -4.0 ];
4444
* var y = [ 0.0, 1.0, 2.0, 3.0 ];
4545
*
46-
* gsort2sh( x.length, 1.0, x, 1, 0, y, 1, 0 );
46+
* gsort2sh.ndarray( x.length, 1.0, x, 1, 0, y, 1, 0 );
4747
*
4848
* console.log( x );
4949
* // => [ -4.0, -2.0, 1.0, 3.0 ]

lib/node_modules/@stdlib/constants/float16/ninf/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @example
2828
* var FLOAT16_NINF = require( '@stdlib/constants/float16/ninf' );
29-
* // returns -infinity
29+
* // returns -Infinity
3030
*/
3131

3232
// MODULES //

lib/node_modules/@stdlib/fs/lib/index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ var setReadOnly = require( '@stdlib/utils/define-read-only-property' );
3636
*/
3737
var fs = {};
3838

39+
/**
40+
* @name appendFile
41+
* @memberof fs
42+
* @readonly
43+
* @type {Function}
44+
* @see {@link module:@stdlib/fs/append-file}
45+
*/
46+
setReadOnly( fs, 'appendFile', require( '@stdlib/fs/append-file' ) );
47+
3948
/**
4049
* @name close
4150
* @memberof fs
@@ -99,6 +108,15 @@ setReadOnly( fs, 'readFileList', require( '@stdlib/fs/read-file-list' ) );
99108
*/
100109
setReadOnly( fs, 'readJSON', require( '@stdlib/fs/read-json' ) );
101110

111+
/**
112+
* @name readNDJSON
113+
* @memberof fs
114+
* @readonly
115+
* @type {Function}
116+
* @see {@link module:@stdlib/fs/read-ndjson}
117+
*/
118+
setReadOnly( fs, 'readNDJSON', require( '@stdlib/fs/read-ndjson' ) );
119+
102120
/**
103121
* @name readWASM
104122
* @memberof fs
@@ -135,6 +153,15 @@ setReadOnly( fs, 'resolveParentPath', require( '@stdlib/fs/resolve-parent-path'
135153
*/
136154
setReadOnly( fs, 'resolveParentPathBy', require( '@stdlib/fs/resolve-parent-path-by' ) );
137155

156+
/**
157+
* @name resolveParentPaths
158+
* @memberof fs
159+
* @readonly
160+
* @type {Function}
161+
* @see {@link module:@stdlib/fs/resolve-parent-paths}
162+
*/
163+
setReadOnly( fs, 'resolveParentPaths', require( '@stdlib/fs/resolve-parent-paths' ) );
164+
138165
/**
139166
* @name unlink
140167
* @memberof fs
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# cotdf
22+
23+
> Compute the [cotangent][trigonometric-functions] of a single-precision floating-point number (in degrees).
24+
25+
<section class="intro">
26+
27+
</section>
28+
29+
<section class="usage">
30+
31+
## Usage
32+
33+
```javascript
34+
var cotdf = require( '@stdlib/math/base/special/cotdf' );
35+
```
36+
37+
#### cotdf( x )
38+
39+
Evaluates the [cotangent][trigonometric-functions] of a single-precision floating-point number (in degrees).
40+
41+
```javascript
42+
var v = cotdf( 0.0 );
43+
// returns Infinity
44+
45+
v = cotdf( 60.0 );
46+
// returns ~0.58
47+
48+
v = cotdf( 90.0 );
49+
// returns 0.0
50+
51+
v = cotdf( NaN );
52+
// returns NaN
53+
```
54+
55+
</section>
56+
57+
<!-- /.usage -->
58+
59+
<section class="examples">
60+
61+
## Examples
62+
63+
<!-- eslint no-undef: "error" -->
64+
65+
```javascript
66+
var uniform = require( '@stdlib/random/array/uniform' );
67+
var logEachMap = require( '@stdlib/console/log-each-map' );
68+
var cotdf = require( '@stdlib/math/base/special/cotdf' );
69+
70+
var opts = {
71+
'dtype': 'float32'
72+
};
73+
var x = uniform( 100, -180.0, 180.0, opts );
74+
75+
logEachMap( 'cotdf(%0.4f) = %0.4f', x, cotdf );
76+
```
77+
78+
</section>
79+
80+
<!-- /.examples -->
81+
82+
<!-- C interface documentation. -->
83+
84+
* * *
85+
86+
<section class="c">
87+
88+
## C APIs
89+
90+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
91+
92+
<section class="intro">
93+
94+
</section>
95+
96+
<!-- /.intro -->
97+
98+
<!-- C usage documentation. -->
99+
100+
<section class="usage">
101+
102+
### Usage
103+
104+
```c
105+
#include "stdlib/math/base/special/cotdf.h"
106+
```
107+
108+
#### stdlib_base_cotdf( x )
109+
110+
Evaluates the [cotangent][trigonometric-functions] of a single-precision floating-point number (in degrees).
111+
112+
```c
113+
float out = stdlib_base_cotdf( 0.0f );
114+
// returns Infinity
115+
116+
out = stdlib_base_cotdf( 60.0f );
117+
// returns ~0.58f
118+
```
119+
120+
The function accepts the following arguments:
121+
122+
- **x**: `[in] float` input value.
123+
124+
```c
125+
float stdlib_base_cotdf( const float x );
126+
```
127+
128+
</section>
129+
130+
<!-- /.usage -->
131+
132+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
133+
134+
<section class="notes">
135+
136+
</section>
137+
138+
<!-- /.notes -->
139+
140+
<!-- C API usage examples. -->
141+
142+
<section class="examples">
143+
144+
### Examples
145+
146+
```c
147+
#include "stdlib/math/base/special/cotdf.h"
148+
#include <stdio.h>
149+
150+
int main( void ) {
151+
const float x[] = { 0.0f, 30.0f, 45.0f, 60.0f, 90.0f };
152+
153+
float y;
154+
int i;
155+
for ( i = 0; i < 5; i++ ) {
156+
y = stdlib_base_cotdf( x[ i ] );
157+
printf( "cotdf(%f) = %f\n", x[ i ], y );
158+
}
159+
}
160+
```
161+
162+
</section>
163+
164+
<!-- /.examples -->
165+
166+
</section>
167+
168+
<!-- /.c -->
169+
170+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
171+
172+
<section class="related">
173+
174+
</section>
175+
176+
<!-- /.related -->
177+
178+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
179+
180+
<section class="links">
181+
182+
[trigonometric-functions]: https://en.wikipedia.org/wiki/Trigonometric_functions
183+
184+
<!-- <related-links> -->
185+
186+
<!-- </related-links> -->
187+
188+
</section>
189+
190+
<!-- /.links -->
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var pkg = require( './../package.json' ).name;
27+
var cotdf = require( './../lib' );
28+
29+
30+
// MAIN //
31+
32+
bench( pkg, function benchmark( b ) {
33+
var x;
34+
var y;
35+
var i;
36+
37+
x = uniform( 100, -180.0, 180.0, {
38+
'dtype': 'float32'
39+
});
40+
41+
b.tic();
42+
for ( i = 0; i < b.iterations; i++ ) {
43+
y = cotdf( x[ i%x.length ] );
44+
if ( isnanf( y ) ) {
45+
b.fail( 'should not return NaN' );
46+
}
47+
}
48+
b.toc();
49+
if ( isnanf( y ) ) {
50+
b.fail( 'should not return NaN' );
51+
}
52+
b.pass( 'benchmark finished' );
53+
b.end();
54+
});

0 commit comments

Comments
 (0)