Skip to content

Commit eae79f4

Browse files
committed
refactor: use new script for sin and sqrt
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 9c55af3 commit eae79f4

File tree

11 files changed

+524
-1000
lines changed

11 files changed

+524
-1000
lines changed

lib/node_modules/@stdlib/math/special/scripts/function_database.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
{
22
"sqrt": {
33
"input_dtypes": "real_and_generic",
4-
"output_dtypes": "real_floating_point",
4+
"output_dtypes": "real_floating_point_and_generic",
55
"output_policy": "real_floating_point",
6-
"excluded_dtypes": [ "float16", "uint8c" ],
6+
"excluded_dtypes": [ "float16", "uint8c", "int64", "uint64" ],
77
"scalar_kernels": {
8+
"int8": "@stdlib/math/base/special/sqrtf",
9+
"int16": "@stdlib/math/base/special/sqrtf",
10+
"int32": "@stdlib/math/base/special/sqrtf",
11+
"uint8": "@stdlib/math/base/special/sqrtf",
12+
"uint16": "@stdlib/math/base/special/sqrtf",
13+
"uint32": "@stdlib/math/base/special/sqrtf",
814
"float32": "@stdlib/math/base/special/sqrtf",
915
"float64": "@stdlib/math/base/special/sqrt",
1016
"generic": "@stdlib/math/base/special/sqrt"
1117
}
1218
},
1319
"sin": {
1420
"input_dtypes": "real_and_generic",
15-
"output_dtypes": "real_floating_point",
21+
"output_dtypes": "real_floating_point_and_generic",
1622
"output_policy": "real_floating_point",
17-
"excluded_dtypes": [ "float16", "uint8c" ],
23+
"excluded_dtypes": [ "float16", "uint8c", "int64", "uint64" ],
1824
"scalar_kernels": {
25+
"int8": "@stdlib/math/base/special/sinf",
26+
"int16": "@stdlib/math/base/special/sinf",
27+
"int32": "@stdlib/math/base/special/sinf",
28+
"uint8": "@stdlib/math/base/special/sinf",
29+
"uint16": "@stdlib/math/base/special/sinf",
30+
"uint32": "@stdlib/math/base/special/sinf",
1931
"float32": "@stdlib/math/base/special/sinf",
2032
"float64": "@stdlib/math/base/special/sin",
2133
"generic": "@stdlib/math/base/special/sin"

lib/node_modules/@stdlib/math/special/sin/scripts/config.js

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

lib/node_modules/@stdlib/math/special/sin/scripts/generate_files.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ var pkg = require( './../package.json' );
3131
// FUNCTIONS //
3232

3333
/**
34-
* Groups matches by input data type.
34+
* Groups matches by input data type and returns grouped data, input types, and reordered matches.
3535
*
3636
* @private
37-
* @param {Array} matches - array of match entries
38-
* @returns {Object} object containing grouped matches, input types array, and reordered matches
37+
* @param {Array} matches - array of match arrays, where each match is [ input_dtype, output_dtype, package, needs_to_promote, promoted_input_dtype, promoted_output_dtype, c_function_name, loop_kernel ]
38+
* @returns {Object} object containing grouped matches, input types, and reordered matches
3939
*/
4040
function groupMatchesByInputType( matches ) {
4141
var reorderedMatches = [];
@@ -251,15 +251,25 @@ function generateAddonFile( matches, header, basePkg ) {
251251
* @private
252252
*/
253253
function main() {
254+
var filteredMatches;
254255
var basePkg;
255256
var matches;
256257
var header;
257258
var jsOut;
258259
var cOut;
260+
var i;
259261

260262
// Generate and filter matches table:
261263
matches = generateMatchesTable();
262264

265+
// Filter out generic types for addon.c:
266+
filteredMatches = [];
267+
for ( i = 0; i < matches.length; i++ ) {
268+
if ( matches[ i ][ 0 ] !== 'generic' && matches[ i ][ 1 ] !== 'generic' ) {
269+
filteredMatches.push( matches[ i ] );
270+
}
271+
}
272+
263273
// Extract package information:
264274
basePkg = pkg.name.split( '/' ).pop();
265275

@@ -277,7 +287,7 @@ function main() {
277287
});
278288

279289
// Generate addon.c:
280-
cOut = generateAddonFile( matches, header, basePkg );
290+
cOut = generateAddonFile( filteredMatches, header, basePkg );
281291
writeFileSync( join( __dirname, '../src/addon.c' ), cOut, {
282292
'encoding': 'utf8'
283293
});

lib/node_modules/@stdlib/math/special/sin/scripts/get_dtypes.js

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

lib/node_modules/@stdlib/math/special/sin/scripts/map_to_scalar_kernel.js

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

0 commit comments

Comments
 (0)