Skip to content

Commit f14ff3f

Browse files
committed
Auto-generated commit
1 parent b687f68 commit f14ff3f

File tree

10 files changed

+97
-57
lines changed

10 files changed

+97
-57
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-09-12)
7+
## Unreleased (2025-09-13)
88

99
<section class="bug-fixes">
1010

@@ -44,6 +44,8 @@
4444

4545
<details>
4646

47+
- [`c7229c9`](https://github.com/stdlib-js/stdlib/commit/c7229c91160851c316f4caefd6aea6e387621edd) - **refactor:** consolidate files _(by Athan Reines)_
48+
- [`491ccba`](https://github.com/stdlib-js/stdlib/commit/491ccba47c32b20c1e90e468d6e187aa0583e8b8) - **refactor:** reorder imports _(by Athan Reines)_
4749
- [`c63f610`](https://github.com/stdlib-js/stdlib/commit/c63f610323ce4a6a44f0d359525274bb174d5c76) - **refactor:** use add-on dispatch utility _(by Athan Reines)_
4850
- [`ece831b`](https://github.com/stdlib-js/stdlib/commit/ece831b187c2e9b9ee3d29b527b39b4005ee9fe8) - **fix:** fallback to `assign` method _(by Athan Reines)_
4951
- [`32598ec`](https://github.com/stdlib-js/stdlib/commit/32598ecb974bacd50b686118a78cf8d06f66f645) - **chore:** reorder keywords _(by Athan Reines)_

dist/index.js

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/config.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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 dtypes = require( '@stdlib/ndarray-dtypes' );
24+
25+
26+
// MAIN //
27+
28+
var config = {
29+
// Total number of ndarray arguments:
30+
'nargs': 2,
31+
32+
// Number of input ndarray arguments:
33+
'nin': 1,
34+
35+
// Number of output ndarray arguments:
36+
'nout': 1,
37+
38+
// List of supported input ndarray data types:
39+
'idtypes': dtypes( 'numeric_and_generic' ),
40+
41+
// List of supported output ndarray data types:
42+
'odtypes': dtypes( 'real_and_generic' ),
43+
44+
// Dispatch policies:
45+
'policies': {
46+
// Output data type policy:
47+
'output': 'real_and_generic',
48+
49+
// Input ndarray casting policy:
50+
'casting': 'none'
51+
}
52+
};
53+
54+
55+
// EXPORTS //
56+
57+
module.exports = config;

lib/main.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,13 @@
2222

2323
// MODULES //
2424

25-
var dispatcher = require( '@stdlib/ndarray-dispatch' );
26-
var dtypes = require( '@stdlib/ndarray-dtypes' );
27-
var unary = require( '@stdlib/ndarray-base-unary' );
28-
var ufunc = require( '@stdlib/math-tools-unary' );
25+
var dispatch = require( '@stdlib/ndarray-dispatch' );
2926
var setProps = require( '@stdlib/ndarray-base-meta-data-props' );
30-
var meta = require( './meta.json' );
27+
var ufunc = require( '@stdlib/math-tools-unary' );
28+
var unary = require( '@stdlib/ndarray-base-unary' );
3129
var data = require( './data.js' );
3230
var types = require( './types.json' );
33-
var policies = require( './policies.json' );
34-
35-
36-
// VARIABLES //
37-
38-
var idtypes = dtypes( 'numeric_and_generic' );
39-
var odtypes = dtypes( 'real_and_generic' );
31+
var config = require( './config.js' );
4032

4133

4234
// MAIN //
@@ -68,9 +60,9 @@ var odtypes = dtypes( 'real_and_generic' );
6860
* var arr = ndarray2array( y );
6961
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
7062
*/
71-
var abs = ufunc( dispatcher( unary, types, data, meta.nargs, meta.nin, meta.nout ), [ idtypes ], odtypes, policies );
72-
setProps( meta, types, abs );
73-
setProps( meta, types, abs.assign );
63+
var abs = ufunc( dispatch( unary, types, data, config.nargs, config.nin, config.nout ), [ config.idtypes ], config.odtypes, config.policies );
64+
setProps( config, types, abs );
65+
setProps( config, types, abs.assign );
7466

7567

7668
// EXPORTS //

lib/meta.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

lib/native.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,21 @@
1616
* limitations under the License.
1717
*/
1818

19+
/* eslint-disable max-len */
20+
1921
'use strict';
2022

2123
// MODULES //
2224

2325
var dispatch = require( '@stdlib/ndarray-base-unary-addon-dispatch' );
2426
var setProps = require( '@stdlib/ndarray-base-meta-data-props' );
25-
var dtypes = require( '@stdlib/ndarray-dtypes' );
2627
var ufunc = require( '@stdlib/math-tools-unary' );
2728
var addon = require( './../src/addon.node' );
28-
var meta = require( './meta.json' );
2929
var types = require( './types.json' );
30-
var policies = require( './policies.json' );
30+
var config = require( './config.js' );
3131
var fallback = require( './main.js' ).assign;
3232

3333

34-
// VARIABLES //
35-
36-
var idtypes = dtypes( 'numeric_and_generic' );
37-
var odtypes = dtypes( 'real_and_generic' );
38-
39-
4034
// MAIN //
4135

4236
/**
@@ -66,9 +60,9 @@ var odtypes = dtypes( 'real_and_generic' );
6660
* var arr = ndarray2array( y );
6761
* // returns [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ]
6862
*/
69-
var abs = ufunc( dispatch( addon, fallback ), [ idtypes ], odtypes, policies );
70-
setProps( meta, types, abs );
71-
setProps( meta, types, abs.assign );
63+
var abs = ufunc( dispatch( addon, fallback ), [ config.idtypes ], config.odtypes, config.policies );
64+
setProps( config, types, abs );
65+
setProps( config, types, abs.assign );
7266

7367

7468
// EXPORTS //

lib/policies.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

lib/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var dtypes = require( '@stdlib/ndarray-dtypes' );
3131

3232
// MAIN //
3333

34+
// Type signatures...
3435
var types = [
3536
dtypes.float64, dtypes.float64,
3637
dtypes.float64, dtypes.generic,

test/test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var IS_BROWSER = require( '@stdlib/assert-is-browser' );
2626
var dtypes2signatures = require( '@stdlib/ndarray-base-dtypes2signatures' );
2727
var hasProp = require( '@stdlib/assert-has-property' );
2828
var types = require( './../lib/types.json' );
29-
var meta = require( './../lib/meta.json' );
29+
var config = require( './../lib/config.js' );
3030
var fcn = require( './../lib' );
3131

3232

@@ -81,47 +81,47 @@ tape( 'if a native implementation is not available, the main export is a JavaScr
8181
});
8282

8383
tape( 'attached to the main export is a property for retrieving the number of input and output arrays', function test( t ) {
84-
t.strictEqual( fcn.nargs, meta.nargs, 'returns expected value' );
84+
t.strictEqual( fcn.nargs, config.nargs, 'returns expected value' );
8585
t.end();
8686
});
8787

8888
tape( 'attached to the main export is a property for retrieving the number of input arrays', function test( t ) {
89-
t.strictEqual( fcn.nin, meta.nin, 'returns expected value' );
89+
t.strictEqual( fcn.nin, config.nin, 'returns expected value' );
9090
t.end();
9191
});
9292

9393
tape( 'attached to the main export is a property for retrieving the number of output arrays', function test( t ) {
94-
t.strictEqual( fcn.nout, meta.nout, 'returns expected value' );
94+
t.strictEqual( fcn.nout, config.nout, 'returns expected value' );
9595
t.end();
9696
});
9797

9898
tape( 'attached to the main export is a property for retrieving the list of supported array data types', function test( t ) {
99-
t.deepEqual( fcn.types, dtypes2signatures( types, meta.nin, meta.nout ), 'returns expected value' );
99+
t.deepEqual( fcn.types, dtypes2signatures( types, config.nin, config.nout ), 'returns expected value' );
100100
t.end();
101101
});
102102

103103
tape( 'attached to the main export is an `assign` method for assigning results to a provided output array', function test( t ) {
104-
t.strictEqual( hasProp( fcn, 'assign' ), true, 'has property' );
105-
t.strictEqual( typeof fcn.assign, 'function', 'has method' );
104+
t.strictEqual( hasProp( fcn, 'assign' ), true, 'returns expected value' );
105+
t.strictEqual( typeof fcn.assign, 'function', 'returns expected value' );
106106
t.end();
107107
});
108108

109109
tape( 'attached to the `assign` method is a property for retrieving the number of input and output arrays', function test( t ) {
110-
t.strictEqual( fcn.assign.nargs, meta.nargs, 'returns expected value' );
110+
t.strictEqual( fcn.assign.nargs, config.nargs, 'returns expected value' );
111111
t.end();
112112
});
113113

114114
tape( 'attached to the `assign` method is a property for retrieving the number of input arrays', function test( t ) {
115-
t.strictEqual( fcn.assign.nin, meta.nin, 'returns expected value' );
115+
t.strictEqual( fcn.assign.nin, config.nin, 'returns expected value' );
116116
t.end();
117117
});
118118

119119
tape( 'attached to the `assign` method is a property for retrieving the number of output arrays', function test( t ) {
120-
t.strictEqual( fcn.assign.nout, meta.nout, 'returns expected value' );
120+
t.strictEqual( fcn.assign.nout, config.nout, 'returns expected value' );
121121
t.end();
122122
});
123123

124124
tape( 'attached to the `assign` method is a property for retrieving the list of supported array data types', function test( t ) {
125-
t.deepEqual( fcn.assign.types, dtypes2signatures( types, meta.nin, meta.nout ), 'returns expected value' );
125+
t.deepEqual( fcn.assign.types, dtypes2signatures( types, config.nin, config.nout ), 'returns expected value' );
126126
t.end();
127127
});

0 commit comments

Comments
 (0)