Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Nov 9, 2023
1 parent c2999f8 commit 1fbae5f
Show file tree
Hide file tree
Showing 12 changed files with 304 additions and 74 deletions.
52 changes: 2 additions & 50 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#/
# @license Apache-2.0
#
# Copyright (c) 2021 The Stdlib Authors.
# Copyright (c) 2023 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.
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
publish:

# Define display name:
name: 'Publish package to npm'
name: 'Publish top-level package to npm'

# Define the type of virtual host machine on which to run the job:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -103,54 +103,6 @@ jobs:
SLUG=${{ github.repository }}
git push "https://$GITHUB_ACTOR:[email protected]/$SLUG.git" --follow-tags
# Remove CLI:
- name: 'Remove CLI'
if: ${{ github.ref == 'refs/heads/main' }}
run: |
# Exit if the package does not have a CLI:
if ! grep -q '"bin":' package.json; then
exit 0
fi
rm -rf ./bin/cli
rm -f test/test.cli.js
rm -f etc/cli_opts.json
rm -f docs/usage.txt
# For all dependencies, check in all *.js files if they are still used; if not, remove them:
jq -r '.dependencies | keys[]' ./package.json | while read -r dep; do
dep=$(echo "$dep" | xargs)
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
jq --indent 2 "del(.dependencies[\"$dep\"])" ./package.json > ./package.json.tmp
mv ./package.json.tmp ./package.json
fi
done
jq -r '.devDependencies | keys[]' ./package.json | while read -r dep; do
if [[ "$dep" != "@stdlib"* ]]; then
continue
fi
dep=$(echo "$dep" | xargs)
if ! grep -q "$dep" lib/** && ! grep -q -s "$dep" manifest.json && ! grep -q -s "$dep" include.gypi; then
jq --indent 2 "del(.devDependencies[\"$dep\"])" ./package.json > ./package.json.tmp
mv ./package.json.tmp ./package.json
fi
done
# Remove CLI section:
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/(\* \* \*\n+)?<section class=\"cli\">[\s\S]+?<\!\-\- \/.cli \-\->//"
# Remove CLI from package.json:
jq -r 'del(.bin)' package.json > package.json.tmp
mv package.json.tmp package.json
# Add entry for CLI package to See Also section of README.md:
cliPkgName=$(jq -r '.name' package.json)-cli
escapedPkg=$(echo "$cliPkgName" | sed -e 's/\//\\\//g')
escapedPkg=$(echo "$escapedPkg" | sed -e 's/\@/\\\@/g')
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"related\">(?:\n\n\* \* \*\n\n## See Also\n\n)?/<section class=\"related\">\n\n## See Also\n\n- <span class=\"package-name\">[\`$escapedPkg\`][$escapedPkg]<\/span><span class=\"delimiter\">: <\/span><span class=\"description\">CLI package for use as a command-line utility.<\/span>\n/"
# Add link definition for CLI package to README.md:
find . -type f -name '*.md' -print0 | xargs -0 perl -0777 -i -pe "s/<section class=\"links\">/<section class=\"links\">\n\n[$escapedPkg]: https:\/\/www.npmjs.com\/package\/$escapedPkg/"
# Replace GitHub MathJax equations with SVGs:
- name: 'Replace GitHub MathJax equations with SVGs'
run: |
Expand Down
40 changes: 39 additions & 1 deletion base/broadcasted-binary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,44 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
*/
type Binary<T, U, V> = ( v1: T, v2: U ) => V;

/**
* Input array.
*/
type InputArray<T> = Array1D<T> | Array2D<T>;

/**
* Input array shape.
*/
type InputArrayShape = Shape1D | Shape2D;

/**
* Output array.
*/
type OutputArray<T> = Array2D<T>;

/**
* Output array shape.
*/
type OutputArrayShape = Shape2D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V> = [
InputArray<T>,
InputArray<U>,
OutputArray<V>
];

/**
* Input and output array shapes.
*/
type InOutShapes = [
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.
*
Expand Down Expand Up @@ -62,7 +100,7 @@ type Binary<T, U, V> = ( v1: T, v2: U ) => V;
* console.log( z );
* // => [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ]
*/
declare function bbinary2d<T = unknown, U = unknown, V = unknown>( arrays: [ Array1D<T> | Array2D<T>, Array1D<U> | Array2D<U>, Array2D<V> ], shapes: [ Shape1D | Shape2D, Shape1D | Shape2D, Shape2D ], fcn: Binary<T, U, V> ): void;
declare function bbinary2d<T = unknown, U = unknown, V = unknown>( arrays: InOutArrays<T, U, V>, shapes: InOutShapes, fcn: Binary<T, U, V> ): void;


// EXPORTS //
Expand Down
20 changes: 19 additions & 1 deletion base/broadcasted-binary3d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ type OutputArray<T> = Array3D<T>;
*/
type OutputArrayShape = Shape3D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V> = [
InputArray<T>,
InputArray<U>,
OutputArray<V>
];

/**
* Input and output array shapes.
*/
type InOutShapes = [
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a three-dimensional nested output array.
*
Expand Down Expand Up @@ -82,7 +100,7 @@ type OutputArrayShape = Shape3D;
* console.log( z );
* // => [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ]
*/
declare function bbinary3d<T = unknown, U = unknown, V = unknown>( arrays: [ InputArray<T>, InputArray<U>, OutputArray<V> ], shapes: [ InputArrayShape, InputArrayShape, OutputArrayShape ], fcn: Binary<T, U, V> ): void;
declare function bbinary3d<T = unknown, U = unknown, V = unknown>( arrays: InOutArrays<T, U, V>, shapes: InOutShapes, fcn: Binary<T, U, V> ): void;


// EXPORTS //
Expand Down
20 changes: 19 additions & 1 deletion base/broadcasted-binary4d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ type OutputArray<T> = Array4D<T>;
*/
type OutputArrayShape = Shape4D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V> = [
InputArray<T>,
InputArray<U>,
OutputArray<V>
];

/**
* Input and output array shapes.
*/
type InOutShapes = [
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a four-dimensional nested output array.
*
Expand Down Expand Up @@ -82,7 +100,7 @@ type OutputArrayShape = Shape4D;
* console.log( z );
* // => [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ]
*/
declare function bbinary4d<T = unknown, U = unknown, V = unknown>( arrays: [ InputArray<T>, InputArray<U>, OutputArray<V> ], shapes: [ InputArrayShape, InputArrayShape, OutputArrayShape ], fcn: Binary<T, U, V> ): void;
declare function bbinary4d<T = unknown, U = unknown, V = unknown>( arrays: InOutArrays<T, U, V>, shapes: InOutShapes, fcn: Binary<T, U, V> ): void;


// EXPORTS //
Expand Down
20 changes: 19 additions & 1 deletion base/broadcasted-binary5d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ type OutputArray<T> = Array5D<T>;
*/
type OutputArrayShape = Shape5D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V> = [
InputArray<T>,
InputArray<U>,
OutputArray<V>
];

/**
* Input and output array shapes.
*/
type InOutShapes = [
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
* Applies a binary callback to elements in two broadcasted input arrays and assigns results to elements in a five-dimensional nested output array.
*
Expand Down Expand Up @@ -82,7 +100,7 @@ type OutputArrayShape = Shape5D;
* console.log( z );
* // => [ [ [ [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ], [ [ 2.0, 2.0 ], [ 2.0, 2.0 ] ] ] ] ]
*/
declare function bbinary5d<T = unknown, U = unknown, V = unknown>( arrays: [ InputArray<T>, InputArray<U>, OutputArray<V> ], shapes: [ InputArrayShape, InputArrayShape, OutputArrayShape ], fcn: Binary<T, U, V> ): void;
declare function bbinary5d<T = unknown, U = unknown, V = unknown>( arrays: InOutArrays<T, U, V>, shapes: InOutShapes, fcn: Binary<T, U, V> ): void;


// EXPORTS //
Expand Down
44 changes: 43 additions & 1 deletion base/broadcasted-quaternary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,48 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
*/
type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;

/**
* Input array.
*/
type InputArray<T> = Array1D<T> | Array2D<T>;

/**
* Input array shape.
*/
type InputArrayShape = Shape1D | Shape2D;

/**
* Output array.
*/
type OutputArray<T> = Array2D<T>;

/**
* Output array shape.
*/
type OutputArrayShape = Shape2D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V, W, X> = [
InputArray<T>,
InputArray<U>,
InputArray<V>,
InputArray<W>,
OutputArray<X>
];

/**
* Input and output array shapes.
*/
type InOutShapes = [
InputArrayShape,
InputArrayShape,
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
* Applies a quaternary callback to elements in four broadcasted input arrays and assigns results to elements in a two-dimensional nested output array.
*
Expand Down Expand Up @@ -69,7 +111,7 @@ type Quaternary<T, U, V, W, X> = ( v1: T, v2: U, v3: V, v4: W ) => X;
* console.log( out );
* // => [ [ 4.0, 8.0 ], [ 12.0, 16.0 ] ]
*/
declare function bquaternary2d<T = unknown, U = unknown, V = unknown, W = unknown, X = unknown>( arrays: [ Array1D<T> | Array2D<T>, Array1D<U> | Array2D<U>, Array1D<V> | Array2D<V>, Array1D<W> | Array2D<W>, Array2D<X> ], shapes: [ Shape1D | Shape2D, Shape1D | Shape2D, Shape1D | Shape2D, Shape1D | Shape2D, Shape2D ], fcn: Quaternary<T, U, V, W, X> ): void;
declare function bquaternary2d<T = unknown, U = unknown, V = unknown, W = unknown, X = unknown>( arrays: InOutArrays<T, U, V, W, X>, shapes: InOutShapes, fcn: Quaternary<T, U, V, W, X> ): void;


// EXPORTS //
Expand Down
48 changes: 34 additions & 14 deletions base/broadcasted-quinary2d/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,47 @@ import { Shape1D, Shape2D } from '@stdlib/types/ndarray';
type Quinary<T, U, V, W, X, Y> = ( v1: T, v2: U, v3: V, v4: W, v5: X ) => Y;

/**
* List of input and output arrays.
* Input array.
*/
type InputArray<T> = Array1D<T> | Array2D<T>;

/**
* Input array shape.
*/
type InputArrayShape = Shape1D | Shape2D;

/**
* Output array.
*/
type OutputArray<T> = Array2D<T>;

/**
* Output array shape.
*/
type OutputArrayShape = Shape2D;

/**
* Input and output arrays.
*/
type InOutArrays<T, U, V, W, X, Y> = [
Array1D<T> | Array2D<T>,
Array1D<U> | Array2D<U>,
Array1D<V> | Array2D<V>,
Array1D<W> | Array2D<W>,
Array1D<X> | Array2D<X>,
Array2D<Y>
InputArray<T>,
InputArray<U>,
InputArray<V>,
InputArray<W>,
InputArray<X>,
OutputArray<Y>
];

/**
* List of input and output array shapes.
* Input and output array shapes.
*/
type InOutShapes = [
Shape1D | Shape2D,
Shape1D | Shape2D,
Shape1D | Shape2D,
Shape1D | Shape2D,
Shape1D | Shape2D,
Shape2D
InputArrayShape,
InputArrayShape,
InputArrayShape,
InputArrayShape,
InputArrayShape,
OutputArrayShape
];

/**
Expand Down
Loading

0 comments on commit 1fbae5f

Please sign in to comment.