forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into de…
…velop
- Loading branch information
Showing
58 changed files
with
1,871 additions
and
397 deletions.
There are no files selected for viewing
149 changes: 149 additions & 0 deletions
149
lib/node_modules/@stdlib/_tools/scaffold/math-iter-unary/scripts/data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
[ | ||
{ | ||
"$schema": "math/[email protected]", | ||
"base_alias": "cbrt", | ||
"alias": "cbrt", | ||
"pkg_desc": "compute the cube root", | ||
"desc": "computes the cube root", | ||
"short_desc": "cube root", | ||
"parameters": [ | ||
{ | ||
"name": "x", | ||
"desc": "input value", | ||
"type": { | ||
"javascript": "number", | ||
"jsdoc": "number", | ||
"c": "double", | ||
"dtype": "float64" | ||
}, | ||
"domain": [ | ||
{ | ||
"min": "-infinity", | ||
"max": "infinity" | ||
} | ||
], | ||
"rand": { | ||
"prng": "random/base/uniform", | ||
"parameters": [ | ||
-10, | ||
10 | ||
] | ||
}, | ||
"example_values": [ | ||
64, | ||
27, | ||
0, | ||
0, | ||
-9, | ||
8, | ||
-1, | ||
125, | ||
-10.2, | ||
11.3, | ||
-12.4, | ||
3.5, | ||
-1.6, | ||
15.7, | ||
-16, | ||
17.9, | ||
-188, | ||
19.11, | ||
-200, | ||
21.15 | ||
] | ||
} | ||
], | ||
"returns": { | ||
"desc": "cube root", | ||
"type": { | ||
"javascript": "number", | ||
"jsdoc": "number", | ||
"c": "double", | ||
"dtype": "float64" | ||
} | ||
}, | ||
"keywords": [ | ||
"cube", | ||
"root", | ||
"cbrt", | ||
"cubic", | ||
"power" | ||
], | ||
"extra_keywords": [ | ||
"math.cbrt" | ||
] | ||
}, | ||
{ | ||
"$schema": "math/[email protected]", | ||
"base_alias": "exp", | ||
"alias": "exp", | ||
"pkg_desc": "evaluate the natural exponential function", | ||
"desc": "evaluates the natural exponential function", | ||
"short_desc": "natural exponential function", | ||
"parameters": [ | ||
{ | ||
"name": "x", | ||
"desc": "input value", | ||
"type": { | ||
"javascript": "number", | ||
"jsdoc": "number", | ||
"c": "double", | ||
"dtype": "float64" | ||
}, | ||
"domain": [ | ||
{ | ||
"min": "-infinity", | ||
"max": "infinity" | ||
} | ||
], | ||
"rand": { | ||
"prng": "random/base/uniform", | ||
"parameters": [ | ||
-10, | ||
10 | ||
] | ||
}, | ||
"example_values": [ | ||
-1.2, | ||
2, | ||
-3.1, | ||
-4.7, | ||
5.5, | ||
6.7, | ||
8.9, | ||
-10.2, | ||
11.3, | ||
-12.4, | ||
13.5, | ||
14.6, | ||
-15.7, | ||
16.8, | ||
-17.9, | ||
18.1, | ||
-19.11, | ||
20.12, | ||
-21.15, | ||
23.78 | ||
] | ||
} | ||
], | ||
"returns": { | ||
"desc": "function value", | ||
"type": { | ||
"javascript": "number", | ||
"jsdoc": "number", | ||
"c": "double", | ||
"dtype": "float64" | ||
} | ||
}, | ||
"keywords": [ | ||
"natural", | ||
"exponential", | ||
"exp", | ||
"power" | ||
], | ||
"extra_keywords": [ | ||
"math.exp" | ||
] | ||
} | ||
] |
79 changes: 79 additions & 0 deletions
79
lib/node_modules/@stdlib/_tools/scaffold/math-iter-unary/scripts/generate_data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2024 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var resolve = require( 'path' ).resolve; | ||
var findPkgs = require( '@stdlib/_tools/pkgs/find' ).sync; | ||
var readJSON = require( '@stdlib/fs/read-json' ).sync; | ||
var writeFile = require( '@stdlib/fs/write-file' ).sync; | ||
var rootDir = require( '@stdlib/_tools/utils/root-dir' ); | ||
|
||
|
||
// VARIABLES // | ||
|
||
var ROOT_DIR = rootDir(); | ||
var opts = { | ||
'encoding': 'utf8' | ||
}; | ||
|
||
|
||
// MAIN // | ||
|
||
/** | ||
* Main execution sequence. | ||
* | ||
* @private | ||
*/ | ||
function main() { | ||
var path; | ||
var json; | ||
var pkgs; | ||
var out; | ||
var o; | ||
var i; | ||
|
||
// Resolve unary "special" math packages: | ||
pkgs = findPkgs({ | ||
'dir': ROOT_DIR, | ||
'pattern': '**/math/base/special/*/package.json' | ||
}); | ||
|
||
// Filter for package's containing scaffold metadata and which have unary APIs... | ||
out = []; | ||
for ( i = 0; i < pkgs.length; i++ ) { | ||
path = resolve( ROOT_DIR, pkgs[i] ); | ||
json = readJSON( resolve( path, 'package.json' ), opts ); | ||
if ( json instanceof Error ) { | ||
console.error( 'Encountered an error when attempting to read package: %s. Error: %s.', pkgs[ i ], json.message ); | ||
continue; | ||
} | ||
o = json.__stdlib__; // eslint-disable-line no-underscore-dangle | ||
if ( o && o.scaffold && o.scaffold.parameters.length === 1 ) { | ||
out.push( o.scaffold ); | ||
} | ||
} | ||
// Write the metadata to a local file for subsequent consumption by other scripts: | ||
writeFile( resolve( __dirname, 'data.json' ), JSON.stringify( out, null, ' ' )+'\n', opts ); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.