Skip to content

Commit ab2c29b

Browse files
committed
Auto-generated commit
1 parent 13fc788 commit ab2c29b

File tree

14 files changed

+148
-37
lines changed

14 files changed

+148
-37
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: test_published_package
21+
22+
# Workflow triggers:
23+
on:
24+
# Run workflow on a weekly schedule:
25+
schedule:
26+
# * is a special character in YAML so you have to quote this string
27+
- cron: '39 3 * * 5'
28+
29+
# Run workflow upon completion of `publish` workflow run:
30+
workflow_run:
31+
workflows: ["publish"]
32+
types: [completed]
33+
34+
# Allow workflow to be manually run:
35+
workflow_dispatch:
36+
37+
# Workflow jobs:
38+
jobs:
39+
test-published:
40+
# Define a display name:
41+
name: 'Test running examples of published package'
42+
43+
# Define the type of virtual host machine:
44+
runs-on: ubuntu-latest
45+
46+
# Define environment variables:
47+
env:
48+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
49+
50+
# Run workflow job if `publish` workflow run is successful or when the workflow is manually run:
51+
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
52+
53+
# Define the job's steps:
54+
steps:
55+
# Checkout the repository:
56+
- name: 'Checkout repository'
57+
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
58+
59+
# Install Node.js:
60+
- name: 'Install Node.js'
61+
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
62+
with:
63+
node-version: 20
64+
timeout-minutes: 5
65+
66+
# Create test directory and run examples:
67+
- name: 'Create test directory and run examples'
68+
run: |
69+
cd ..
70+
mkdir test-published
71+
cd test-published
72+
73+
# Copy example file:
74+
cp $GITHUB_WORKSPACE/examples/index.js .
75+
76+
# Create a minimal package.json
77+
echo '{
78+
"name": "test-published",
79+
"version": "1.0.0",
80+
"main": "index.js",
81+
"dependencies": {}
82+
}' > package.json
83+
84+
# Get package name and modify example file:
85+
PACKAGE_NAME=$(jq -r '.name' $GITHUB_WORKSPACE/package.json)
86+
ESCAPED_PACKAGE_NAME=$(echo "$PACKAGE_NAME" | sed 's/[\/&]/\\&/g')
87+
88+
sed -i "s/require( '.\/..\/lib' )/require( '$ESCAPED_PACKAGE_NAME' )/g" index.js
89+
90+
# Extract and install dependencies:
91+
DEPS=$(grep -oP "require\(\s*'([^']+)'\s*\)" index.js | sed "s/require(\s*'//" | sed "s/'\s*)//" | grep -v "^\.")
92+
for dep in $DEPS; do
93+
npm install $dep --save
94+
done
95+
96+
# Run the example:
97+
node index.js
98+
99+
# Send Slack notification if job fails:
100+
- name: 'Send notification to Slack in case of failure'
101+
uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 # v3.16.2
102+
with:
103+
status: ${{ job.status }}
104+
channel: '#npm-ci'
105+
if: failure()

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2024-11-01)
7+
## Unreleased (2024-11-23)
88

99
<section class="features">
1010

@@ -32,6 +32,7 @@
3232

3333
<details>
3434

35+
- [`9c913e5`](https://github.com/stdlib-js/stdlib/commit/9c913e504f964aa729ec1f19abbaae30174ddbd8) - **docs:** update descriptions of the function and its parameters in `blas/ext/base/dapx` [(#3226)](https://github.com/stdlib-js/stdlib/pull/3226) _(by Muhammad Haris)_
3536
- [`a187bfc`](https://github.com/stdlib-js/stdlib/commit/a187bfc1f71912625823d786f7b1234b224b323d) - **feat:** add C `ndarray` API and refactor `blas/ext/base/dapx` [(#2929)](https://github.com/stdlib-js/stdlib/pull/2929) _(by Muhammad Haris, Athan Reines)_
3637
- [`e4de24f`](https://github.com/stdlib-js/stdlib/commit/e4de24f1e086063876214e73f1f6b659dc624eb1) - **fix:** resolve bugs in addon.c files _(by Philipp Burckhardt)_
3738
- [`272ae7a`](https://github.com/stdlib-js/stdlib/commit/272ae7ac5c576c68cfab1b6e304c86407faa20cd) - **docs:** remove comment _(by Athan Reines)_

CONTRIBUTORS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Mohammad Kaif <98884589+Kaif987@users.noreply.github.com>
5959
Momtchil Momtchev <momtchil@momtchev.com>
6060
Muhammad Haris <harriskhan047@outlook.com>
6161
Naresh Jagadeesan <naresh.naresh000@gmail.com>
62+
Neeraj Pathak <neerajrpathak710@gmail.com>
6263
NightKnight <Ahmedatwa866@yahoo.com>
6364
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
6465
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
@@ -69,6 +70,7 @@ Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
6970
Pranav Goswami <goswami.4@iitj.ac.in>
7071
Praneki <97080887+PraneGIT@users.noreply.github.com>
7172
Pratik <97464067+Pratik772846@users.noreply.github.com>
73+
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
7274
Priyansh <88396544+itsspriyansh@users.noreply.github.com>
7375
Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
7476
RISHAV <115060907+rishav2404@users.noreply.github.com>
@@ -79,9 +81,11 @@ Ridam Garg <67867319+RidamGarg@users.noreply.github.com>
7981
Robert Gislason <gztown2216@yahoo.com>
8082
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
8183
Rutam <138517416+performant23@users.noreply.github.com>
84+
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
8285
Ryan Seal <splrk@users.noreply.github.com>
8386
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
8487
SarthakPaandey <145528240+SarthakPaandey@users.noreply.github.com>
88+
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
8589
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
8690
Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
8791
Shivam <11shivam00@gmail.com>

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ limitations under the License.
3333

3434
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
3535

36-
> Add a constant to each element in a double-precision floating-point strided array.
36+
> Add a scalar constant to each element in a double-precision floating-point strided array.
3737
3838
<section class="installation">
3939

@@ -65,7 +65,7 @@ var dapx = require( '@stdlib/blas-ext-base-dapx' );
6565

6666
#### dapx( N, alpha, x, strideX )
6767

68-
Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array.
68+
Adds a scalar constant to each element in a double-precision floating-point strided array.
6969

7070
```javascript
7171
var Float64Array = require( '@stdlib/array-float64' );
@@ -81,9 +81,9 @@ The function has the following parameters:
8181
- **N**: number of indexed elements.
8282
- **alpha**: scalar constant.
8383
- **x**: input [`Float64Array`][@stdlib/array/float64].
84-
- **strideX**: index increment.
84+
- **strideX**: stride length for `x`.
8585

86-
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element
86+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to add a constant to every other element:
8787

8888
```javascript
8989
var Float64Array = require( '@stdlib/array-float64' );
@@ -112,7 +112,7 @@ dapx( 3, 5.0, x1, 2 );
112112

113113
#### dapx.ndarray( N, alpha, x, strideX, offsetX )
114114

115-
Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array using alternative indexing semantics.
115+
Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.
116116

117117
```javascript
118118
var Float64Array = require( '@stdlib/array-float64' );
@@ -127,7 +127,7 @@ The function has the following additional parameters:
127127

128128
- **offsetX**: starting index.
129129

130-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements of the strided array
130+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:
131131

132132
```javascript
133133
var Float64Array = require( '@stdlib/array-float64' );
@@ -203,7 +203,7 @@ console.log( x );
203203

204204
#### c_dapx( N, alpha, \*X, strideX )
205205

206-
Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array.
206+
Adds a scalar constant to each element in a double-precision floating-point strided array.
207207

208208
```c
209209
double x[] = { 1.0, 2.0, 3.0, 4.0 };
@@ -217,15 +217,15 @@ The function accepts the following arguments:
217217
- **N**: `[in] CBLAS_INT` number of indexed elements.
218218
- **alpha**: `[in] double` scalar constant.
219219
- **X**: `[inout] double*` input array.
220-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
220+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
221221
222222
```c
223223
void c_dapx( const CBLAS_INT N, const double alpha, double *X, const CBLAS_INT strideX );
224224
```
225225

226226
#### c_dapx_ndarray( N, alpha, \*X, strideX, offsetX )
227227

228-
Adds a scalar constant `alpha` to each element in a double-precision floating-point strided array `X` using alternative indexing semantics.
228+
Adds a scalar constant to each element in a double-precision floating-point strided array using alternative indexing semantics.
229229

230230
```c
231231
double x[] = { 1.0, 2.0, 3.0, 4.0 };
@@ -238,7 +238,7 @@ The function accepts the following arguments:
238238
- **N**: `[in] CBLAS_INT` number of indexed elements.
239239
- **alpha**: `[in] double` scalar constant.
240240
- **X**: `[inout] double*` input array.
241-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
241+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
242242
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
243243
244244
```c
@@ -293,7 +293,7 @@ int main( void ) {
293293
294294
</section>
295295
296-
<!-- /.c -->
296+
W<!-- /.c -->
297297
298298
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
299299

benchmark/c/benchmark.length.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ static double benchmark1( int iterations, int len ) {
105105
}
106106
t = tic();
107107
for ( i = 0; i < iterations; i++ ) {
108+
// cppcheck-suppress uninitvar
108109
c_dapx( len, 5.0, x, 1 );
109110
if ( x[ 0 ] != x[ 0 ] ) {
110111
printf( "should not return NaN\n" );
@@ -129,6 +130,7 @@ static double benchmark2( int iterations, int len ) {
129130
}
130131
t = tic();
131132
for ( i = 0; i < iterations; i++ ) {
133+
// cppcheck-suppress uninitvar
132134
c_dapx_ndarray( len, 5.0, x, 1, 0 );
133135
if ( x[ 0 ] != x[ 0 ] ) {
134136
printf( "should not return NaN\n" );

0 commit comments

Comments
 (0)