Skip to content

Commit bd1017d

Browse files
committed
feat: add numeric and real dtype defaults
1 parent 03effb2 commit bd1017d

File tree

7 files changed

+32
-0
lines changed

7 files changed

+32
-0
lines changed

lib/node_modules/@stdlib/ndarray/defaults/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ The returned object has the following properties:
5454
- **dtypes**: default data types.
5555

5656
- **default**: default data type.
57+
- **numeric**: default numeric data type.
58+
- **real**: default real-valued data type.
5759
- **floating_point**: default floating-point data type.
5860
- **real_floating_point**: default real-valued floating-point data type.
5961
- **complex_floating_point**: default complex-valued floating-point data type.

lib/node_modules/@stdlib/ndarray/defaults/docs/repl.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
out.dtypes.default: string
1414
Default data type.
1515

16+
out.dtypes.numeric: string
17+
Default numeric data type.
18+
19+
out.dtypes.real: string
20+
Default real-valued data type.
21+
1622
out.dtypes.floating_point: string
1723
Default floating-point data type.
1824

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ interface DataTypes {
2727
*/
2828
default: 'float64';
2929

30+
/**
31+
* Default numeric data type.
32+
*/
33+
numeric: 'float64';
34+
35+
/**
36+
* Default real-valued data type.
37+
*/
38+
real: 'float64';
39+
3040
/**
3141
* Default floating-point data type.
3242
*/

lib/node_modules/@stdlib/ndarray/defaults/lib/get.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ var defaults = require( './main.js' );
2828
var DEFAULTS = defaults();
2929
var HASH = {
3030
'dtypes.default': DEFAULTS.dtypes.default,
31+
'dtypes.numeric': DEFAULTS.dtypes.numeric,
32+
'dtypes.real': DEFAULTS.dtypes.real,
3133
'dtypes.floating_point': DEFAULTS.dtypes.floating_point,
3234
'dtypes.real_floating_point': DEFAULTS.dtypes.real_floating_point,
3335
'dtypes.complex_floating_point': DEFAULTS.dtypes.complex_floating_point,

lib/node_modules/@stdlib/ndarray/defaults/lib/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ function defaults() {
3434
// Data types:
3535
'dtypes': {
3636
'default': 'float64',
37+
'numeric': 'float64',
38+
'real': 'float64',
3739
'floating_point': 'float64',
3840
'real_floating_point': 'float64',
3941
'complex_floating_point': 'complex128',

lib/node_modules/@stdlib/ndarray/defaults/test/test.get.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ tape( 'if provided a recognized setting, the function returns a default value',
4646

4747
values = [
4848
'dtypes.default',
49+
'dtypes.numeric',
50+
'dtypes.real',
4951
'dtypes.floating_point',
5052
'dtypes.real_floating_point',
5153
'dtypes.complex_floating_point',
@@ -59,6 +61,8 @@ tape( 'if provided a recognized setting, the function returns a default value',
5961
];
6062
expected = [
6163
DEFAULTS.dtypes.default,
64+
DEFAULTS.dtypes.numeric,
65+
DEFAULTS.dtypes.real,
6266
DEFAULTS.dtypes.floating_point,
6367
DEFAULTS.dtypes.real_floating_point,
6468
DEFAULTS.dtypes.complex_floating_point,

lib/node_modules/@stdlib/ndarray/defaults/test/test.main.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ tape( 'the function returns default ndarray settings', function test( t ) {
4242
t.strictEqual( hasOwnProp( o.dtypes, 'default' ), true, 'has property' );
4343
t.strictEqual( typeof o.dtypes.default, 'string', 'returns expected value' );
4444

45+
t.strictEqual( hasOwnProp( o.dtypes, 'numeric' ), true, 'has property' );
46+
t.strictEqual( typeof o.dtypes.numeric, 'string', 'returns expected value' );
47+
48+
t.strictEqual( hasOwnProp( o.dtypes, 'real' ), true, 'has property' );
49+
t.strictEqual( typeof o.dtypes.real, 'string', 'returns expected value' );
50+
4551
t.strictEqual( hasOwnProp( o.dtypes, 'floating_point' ), true, 'has property' );
4652
t.strictEqual( typeof o.dtypes.floating_point, 'string', 'returns expected value' );
4753

0 commit comments

Comments
 (0)