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 20, 2024
1 parent 92c31be commit be55521
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 2 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/test_published_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#/
# @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.
#/

# Workflow name:
name: test_published_package

# Workflow triggers:
on:
# Run workflow on a weekly schedule:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '19 7 * * 3'

# Run workflow upon completion of `publish` workflow run:
workflow_run:
workflows: ["publish"]
types: [completed]

# Allow workflow to be manually run:
workflow_dispatch:

# Workflow jobs:
jobs:
test-published:
# Define a display name:
name: 'Test running examples of published package'

# Define the type of virtual host machine:
runs-on: ubuntu-latest

# Define environment variables:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

# Run workflow job if `publish` workflow run is successful or when the workflow is manually run:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}

# Define the job's steps:
steps:
# Checkout the repository:
- name: 'Checkout repository'
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0

# Install Node.js:
- name: 'Install Node.js'
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: 20
timeout-minutes: 5

# Create test directory and run examples:
- name: 'Create test directory and run examples'
run: |
cd ..
mkdir test-published
cd test-published
# Copy example file:
cp $GITHUB_WORKSPACE/examples/index.js .
# Create a minimal package.json
echo '{
"name": "test-published",
"version": "1.0.0",
"main": "index.js",
"dependencies": {}
}' > package.json
# Get package name and modify example file:
PACKAGE_NAME=$(jq -r '.name' $GITHUB_WORKSPACE/package.json)
ESCAPED_PACKAGE_NAME=$(echo "$PACKAGE_NAME" | sed 's/[\/&]/\\&/g')
sed -i "s/require( '.\/..\/lib' )/require( '$ESCAPED_PACKAGE_NAME' )/g" index.js
# Extract and install dependencies:
DEPS=$(grep -oP "require\(\s*'([^']+)'\s*\)" index.js | sed "s/require(\s*'//" | sed "s/'\s*)//" | grep -v "^\.")
for dep in $DEPS; do
npm install $dep --save
done
# Run the example:
node index.js
# Send Slack notification if job fails:
- name: 'Send notification to Slack in case of failure'
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
with:
status: ${{ job.status }}
channel: '#npm-ci'
if: failure()
52 changes: 50 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,46 @@
<section class="release" id="unreleased">

## Unreleased (2024-11-15)
## Unreleased (2024-11-20)

<section class="packages">

### Packages

<section class="package" id="strided-base-unreleased">

#### [@stdlib/strided/base](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/strided/base)

<details>

<section class="features">

##### Features

- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190)

</section>

<!-- /.features -->

<section class="breaking-changes">

##### BREAKING CHANGES

- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec): update namespace declarations

- To migrate, users should consult the corresponding packages containing the respective implementations to determine what is breaking. The primary breakages come from the `blas/*` namespace, where we recently refactored how top-level BLAS APIs operate on input arguments.

</section>

<!-- /.breaking-changes -->

</details>

</section>

<!-- /.package -->

<section class="package" id="strided-base-strided2object-unreleased">

#### [@stdlib/strided/base/strided2object](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/strided/base/strided2object)
Expand All @@ -36,14 +70,27 @@

<!-- /.packages -->

<section class="breaking-changes">

### BREAKING CHANGES

- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec): update namespace declarations

- To migrate, users should consult the corresponding packages containing the respective implementations to determine what is breaking. The primary breakages come from the `blas/*` namespace, where we recently refactored how top-level BLAS APIs operate on input arguments.

</section>

<!-- /.breaking-changes -->

<section class="contributors">

### Contributors

A total of 2 people contributed to this release. Thank you to the following contributors:
A total of 3 people contributed to this release. Thank you to the following contributors:

- Aman Bhansali
- Athan Reines
- Philipp Burckhardt

</section>

Expand All @@ -55,6 +102,7 @@ A total of 2 people contributed to this release. Thank you to the following cont

<details>

- [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - **feat:** update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190) _(by stdlib-bot, Philipp Burckhardt)_
- [`c442b93`](https://github.com/stdlib-js/stdlib/commit/c442b93d2ed3af2a2f50402b4b0dc87e9090f596) - **feat:** add `blas/base/drotm-wasm` [(#3021)](https://github.com/stdlib-js/stdlib/pull/3021) _(by Aman Bhansali, Athan Reines)_

</details>
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Mohammad Kaif <98884589+Kaif987@users.noreply.github.com>
Momtchil Momtchev <momtchil@momtchev.com>
Muhammad Haris <harriskhan047@outlook.com>
Naresh Jagadeesan <naresh.naresh000@gmail.com>
Neeraj Pathak <neerajrpathak710@gmail.com>
NightKnight <Ahmedatwa866@yahoo.com>
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
Expand All @@ -84,6 +85,7 @@ Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
Ryan Seal <splrk@users.noreply.github.com>
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
Shivam <11shivam00@gmail.com>
Expand Down
138 changes: 138 additions & 0 deletions base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import nullaryAddonDispatch = require( './../../../base/nullary-addon-dispatch'
import offsetView = require( './../../../base/offset-view' );
import quaternary = require( './../../../base/quaternary' );
import quinary = require( './../../../base/quinary' );
import readDataView = require( './../../../base/read-dataview' );
import reinterpretBoolean = require( './../../../base/reinterpret-boolean' );
import reinterpretComplex = require( './../../../base/reinterpret-complex' );
import reinterpretComplex64 = require( './../../../base/reinterpret-complex64' );
Expand All @@ -56,12 +57,14 @@ import smap2 = require( './../../../base/smap2' );
import smskmap = require( './../../../base/smskmap' );
import smskmap2 = require( './../../../base/smskmap2' );
import stride2offset = require( './../../../base/stride2offset' );
import strided2object = require( './../../../base/strided2object' );
import ternary = require( './../../../base/ternary' );
import unary = require( './../../../base/unary' );
import unaryAddonDispatch = require( './../../../base/unary-addon-dispatch' );
import unaryBy = require( './../../../base/unary-by' );
import unaryDtypeSignatures = require( './../../../base/unary-dtype-signatures' );
import unarySignatureCallbacks = require( './../../../base/unary-signature-callbacks' );
import writeDataView = require( './../../../base/write-dataview' );
import zmap = require( './../../../base/zmap' );

/**
Expand Down Expand Up @@ -1050,6 +1053,47 @@ interface Namespace {
*/
quinary: typeof quinary;

/**
* Copies elements from an input strided DataView to elements in an output strided array.
*
* @param N - number of indexed elements
* @param view - output DataView
* @param strideView - `view` stride length (in bytes)
* @param out - output array
* @param strideOut - `out` stride length
* @param littleEndian - boolean indicating whether the data is stored in little-endian format
* @returns output DataView
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var DataView = require( '@stdlib/array/dataview' );
*
* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
* var view = new DataView( x.buffer );
*
* var y = new Float64Array( x.length );
* var out = ns.readDataView( x.length, view, 8, y, 1, true );
* // e.g., returns <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
*
* var bool = ( out === y );
* // returns true
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var DataView = require( '@stdlib/array/dataview' );
*
* var x = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] );
* var view = new DataView( x.buffer );
*
* var y = new Float64Array( x.length );
* var out = ns.readDataView.ndarray( x.length, view, 8, 0, y, 1, 0, true );
* // e.g., returns <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
*
* var bool = ( out === y );
* // returns true
*/
readDataView: typeof readDataView;

/**
* Reinterprets a `BooleanArray` as a `Uint8Array`.
*
Expand Down Expand Up @@ -1304,6 +1348,51 @@ interface Namespace {
*/
stride2offset: typeof stride2offset;

/**
* Converts a strided array and associated metadata to an object likely to have the same "shape".
*
* ## Notes
*
* - This function is intended as a potential performance optimization. In V8, for example, even if two objects share common properties, if those properties were added in different orders or if one object has additional properties not shared by the other object, then those objects will have different "hidden" classes. If a function is provided many objects having different "shapes", some JavaScript VMs (e.g., V8) will consider the function "megamorphic" and fail to perform various runtime optimizations. Accordingly, the intent of this function is to standardize the "shape" of the object holding strided array metadata to ensure that internal functions operating on strided arrays are provided consistent argument "shapes".
*
* - The returned object has the following properties:
*
* - **data**: reference to the input array.
* - **dtype**: array data type.
* - **length**: number of indexed elements.
* - **stride**: index increment.
* - **offset**: starting index.
* - **accessorProtocol**: boolean indicating whether the input array uses accessors for getting and setting elements.
* - **accessors**: a two-element array whose first element is an accessor for retrieving an array element and whose second element is an accessor for setting an array element.
*
* @param N - number of indexed elements
* @param x - input array
* @param stride - index increment
* @param offset - index offset
* @returns object containing strided array data
*
* @example
* var x = {
* '0': 1,
* '1': 2,
* '2': 3,
* '4': 4,
* 'length': 4
* };
* var obj = ns.strided2object( 4, x, 1, 0 );
* // returns {...}
*
* var bool = obj.accessorProtocol;
* // returns false
*
* var fcns = obj.accessors;
* // returns [ <Function>, <Function> ]
*
* var v = fcns[ 0 ]( x.data, 2 );
* // returns 3
*/
strided2object: typeof strided2object;

/**
* Applies a ternary callback to strided input array elements and assigns results to elements in a strided output array.
*
Expand Down Expand Up @@ -1558,6 +1647,55 @@ interface Namespace {
*/
unarySignatureCallbacks: typeof unarySignatureCallbacks;

/**
* Copies elements from an input strided array to elements in a strided DataView.
*
* @param N - number of indexed elements
* @param x - input array
* @param strideX - `x` stride length
* @param view - output DataView
* @param strideView - `view` stride length (in bytes)
* @param littleEndian - boolean indicating whether to store the data in little-endian format
* @returns output DataView
*
* @example
* var ArrayBuffer = require( '@stdlib/array/buffer' );
* var DataView = require( '@stdlib/array/dataview' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0 ];
*
* var buf = new ArrayBuffer( 32 );
* var view = new DataView( buf );
*
* var out = ns.writeDataView( 4, x, 1, view, 8, true );
* // returns <DataView>
*
* var bool = ( out === view );
* // returns true
*
* var v = view.getFloat64( 0, true );
* // returns 1.0
*
* @example
* var ArrayBuffer = require( '@stdlib/array/buffer' );
* var DataView = require( '@stdlib/array/dataview' );
*
* var x = [ 1.0, 2.0, 3.0, 4.0 ];
*
* var buf = new ArrayBuffer( 32 );
* var view = new DataView( buf );
*
* var out = ns.writeDataView.ndarray( 4, x, 1, 0, view, 8, 0, true );
* // returns <DataView>
*
* var bool = ( out === view );
* // returns true
*
* var v = view.getFloat64( 0, true );
* // returns 1.0
*/
writeDataView: typeof writeDataView;

/**
* Applies a unary function to a double-precision complex floating-point strided input array and assigns results to a double-precision complex floating-point strided output array.
*
Expand Down

0 comments on commit be55521

Please sign in to comment.