Skip to content

Commit ac13a61

Browse files
authored
Merge branch 'develop' into smskrev
2 parents 2551826 + a6c328d commit ac13a61

165 files changed

Lines changed: 19771 additions & 44 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish_coverage_pr.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,29 @@ jobs:
6767
if: steps.download-metadata.outcome == 'success'
6868
run: |
6969
pr_number=$(cat pr-metadata/pr_number)
70+
71+
# Validate that the PR number is a positive integer; otherwise, abort:
72+
if ! [[ "$pr_number" =~ ^[0-9]+$ ]]; then
73+
echo "Invalid PR number: not a positive integer."
74+
exit 1
75+
fi
7076
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
71-
{
72-
echo 'report<<EOF'
73-
cat pr-metadata/report
74-
echo 'EOF'
75-
} >> $GITHUB_OUTPUT
7677
7778
# Post report as comment to PR:
7879
- name: 'Post report as comment to PR'
7980
if: steps.download-metadata.outcome == 'success'
8081
# Pin action to full length commit SHA
8182
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
83+
env:
84+
PR_NUMBER: ${{ steps.pr-metadata.outputs.pr_number }}
8285
with:
8386
github-token: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
8487
script: |
85-
const prNumber = parseInt('${{ steps.pr-metadata.outputs.pr_number }}');
88+
const fs = require( 'fs' );
89+
90+
const prNumber = parseInt( process.env.PR_NUMBER, 10 );
91+
const report = fs.readFileSync( 'pr-metadata/report', 'utf8' ).replace( /\\n/g, '\n' );
92+
8693
const { data: comments } = await github.rest.issues.listComments({
8794
'issue_number': prNumber,
8895
'owner': context.repo.owner,
@@ -95,14 +102,14 @@ jobs:
95102
'owner': context.repo.owner,
96103
'repo': context.repo.repo,
97104
'comment_id': botComment.id,
98-
'body': `${{ steps.pr-metadata.outputs.report }}`
105+
'body': report
99106
});
100107
} else {
101108
await github.rest.issues.createComment({
102109
'issue_number': prNumber,
103110
'owner': context.repo.owner,
104111
'repo': context.repo.repo,
105-
'body': `${{ steps.pr-metadata.outputs.report }}`
112+
'body': report
106113
});
107114
}
108115
@@ -145,11 +152,13 @@ jobs:
145152
# Checkout coverage repository branch for PR:
146153
- name: 'Checkout coverage repository branch'
147154
if: steps.download-coverage.outcome == 'success'
155+
env:
156+
PR_NUMBER: ${{ steps.pr-metadata.outputs.pr_number }}
148157
run: |
149158
cd ./www-test-code-coverage
150-
BRANCH_NAME="pr-${{ steps.pr-metadata.outputs.pr_number }}"
151-
git fetch origin $BRANCH_NAME || true
152-
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME
159+
BRANCH_NAME="pr-$PR_NUMBER"
160+
git fetch origin "$BRANCH_NAME" || true
161+
git checkout "$BRANCH_NAME" || git checkout -b "$BRANCH_NAME"
153162
154163
# Remove all directories except .github and .git from branch:
155164
find . -mindepth 1 -maxdepth 1 -type d -not -name '.github' -not -name '.git' -exec git rm -rf {} + || true
@@ -166,12 +175,11 @@ jobs:
166175
commit_timestamp=$(date -u +"%Y-%m-%d %H:%M:%S")
167176
168177
# Append coverage to ndjson files:
169-
files=$(find ./artifacts -name 'index.html')
170-
for file in $files; do
171-
file=${file//artifacts/www-test-code-coverage}
172-
coverage=$(echo -n '['; grep -oP "(?<=class='fraction'>)[0-9]+/[0-9]+" $file | awk -F/ '{ if ($2 != 0) print $1 "," $2 "," ($1/$2)*100; else print $1 "," $2 ",100" }' | tr '\n' ',' | sed 's/,$//'; echo -n ",\"$commit_sha\",\"$commit_timestamp\"]")
173-
echo $coverage >> $(dirname $file)/coverage.ndjson
174-
done
178+
while IFS= read -r -d '' file; do
179+
file="${file//artifacts/www-test-code-coverage}"
180+
coverage=$(echo -n '['; grep -oP "(?<=class='fraction'>)[0-9]+/[0-9]+" "$file" | awk -F/ '{ if ($2 != 0) print $1 "," $2 "," ($1/$2)*100; else print $1 "," $2 ",100" }' | tr '\n' ',' | sed 's/,$//'; echo -n ",\"$commit_sha\",\"$commit_timestamp\"]")
181+
echo "$coverage" >> "$(dirname "$file")/coverage.ndjson"
182+
done < <(find ./artifacts -name 'index.html' -print0)
175183
else
176184
echo "The artifacts directory does not exist."
177185
fi
@@ -194,11 +202,12 @@ jobs:
194202
env:
195203
REPO_GITHUB_TOKEN: ${{ secrets.STDLIB_BOT_PAT_REPO_WRITE }}
196204
USER_NAME: stdlib-bot
205+
PR_NUMBER: ${{ steps.pr-metadata.outputs.pr_number }}
197206
run: |
198207
cd ./www-test-code-coverage
199-
BRANCH_NAME="pr-${{ steps.pr-metadata.outputs.pr_number }}"
208+
BRANCH_NAME="pr-$PR_NUMBER"
200209
git config --local user.email "82920195+stdlib-bot@users.noreply.github.com"
201210
git config --local user.name "stdlib-bot"
202211
git add .
203212
git commit -m "Update artifacts" || exit 0
204-
git push "https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git" $BRANCH_NAME
213+
git push "https://$USER_NAME:$REPO_GITHUB_TOKEN@github.com/stdlib-js/www-test-code-coverage.git" "$BRANCH_NAME"

.github/workflows/slash_commands.yml

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ jobs:
9797
needs: [ add_initial_reaction ]
9898

9999
# Define the conditions under which the job should run:
100-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib check-files')
100+
if: |
101+
github.event.issue.pull_request &&
102+
startsWith(github.event.comment.body, '/stdlib check-files') &&
103+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
101104
102105
# Run reusable workflow:
103106
uses: ./.github/workflows/check_required_files.yml
@@ -116,7 +119,10 @@ jobs:
116119
needs: [ add_initial_reaction ]
117120

118121
# Define the conditions under which the job should run:
119-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib make-commands')
122+
if: |
123+
github.event.issue.pull_request &&
124+
startsWith(github.event.comment.body, '/stdlib make-commands') &&
125+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
120126
121127
# Run reusable workflow:
122128
uses: ./.github/workflows/pr_commands_comment.yml
@@ -132,7 +138,10 @@ jobs:
132138
name: 'Update copyright header years'
133139

134140
# Define the conditions under which the job should run:
135-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib update-copyright-years')
141+
if: |
142+
github.event.issue.pull_request &&
143+
startsWith(github.event.comment.body, '/stdlib update-copyright-years') &&
144+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
136145
137146
# Run reusable workflow:
138147
uses: ./.github/workflows/update_pr_copyright_years.yml
@@ -153,7 +162,10 @@ jobs:
153162
needs: [ add_initial_reaction ]
154163

155164
# Define the conditions under which the job should run:
156-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib lint-autofix')
165+
if: |
166+
github.event.issue.pull_request &&
167+
startsWith(github.event.comment.body, '/stdlib lint-autofix') &&
168+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
157169
158170
# Run reusable workflow:
159171
uses: ./.github/workflows/lint_autofix.yml
@@ -174,7 +186,10 @@ jobs:
174186
needs: [ add_initial_reaction ]
175187

176188
# Define the conditions under which the job should run:
177-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib merge')
189+
if: |
190+
github.event.issue.pull_request &&
191+
startsWith(github.event.comment.body, '/stdlib merge') &&
192+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
178193
179194
# Run reusable workflow:
180195
uses: ./.github/workflows/pr_merge_develop.yml
@@ -195,7 +210,10 @@ jobs:
195210
needs: [ add_initial_reaction ]
196211

197212
# Define the conditions under which the job should run:
198-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib rebase')
213+
if: |
214+
github.event.issue.pull_request &&
215+
startsWith(github.event.comment.body, '/stdlib rebase') &&
216+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
199217
200218
# Run reusable workflow:
201219
uses: ./.github/workflows/pr_rebase_develop.yml
@@ -219,7 +237,10 @@ jobs:
219237
needs: [ add_initial_reaction ]
220238

221239
# Define the conditions under which the job should run:
222-
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib help')
240+
if: |
241+
github.event.issue.pull_request &&
242+
startsWith(github.event.comment.body, '/stdlib help') &&
243+
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)
223244
224245
# Define the job's steps:
225246
steps:

lib/node_modules/@stdlib/blas/base/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ var o = blas;
6262
- <span class="signature">[`dscal( N, alpha, x, stride )`][@stdlib/blas/base/dscal]</span><span class="delimiter">: </span><span class="description">multiply a double-precision floating-point vector `x` by a constant `alpha`.</span>
6363
- <span class="signature">[`dsdot( N, x, strideX, y, strideY )`][@stdlib/blas/base/dsdot]</span><span class="delimiter">: </span><span class="description">calculate the dot product with extended accumulation and result of two single-precision floating-point vectors.</span>
6464
- <span class="signature">[`dswap( N, x, strideX, y, strideY )`][@stdlib/blas/base/dswap]</span><span class="delimiter">: </span><span class="description">interchange two double-precision floating-point vectors.</span>
65+
- <span class="signature">[`dzasum( N, x, strideX )`][@stdlib/blas/base/dzasum]</span><span class="delimiter">: </span><span class="description">compute the sum of the absolute values of the real and imaginary components of a double-precision complex floating-point strided array.</span>
6566
- <span class="signature">[`dznrm2( N, x, strideX )`][@stdlib/blas/base/dznrm2]</span><span class="delimiter">: </span><span class="description">compute the L2-norm of a double-precision complex floating-point vector.</span>
6667
- <span class="signature">[`gasum( N, x, stride )`][@stdlib/blas/base/gasum]</span><span class="delimiter">: </span><span class="description">compute the sum of absolute values (_L1_ norm).</span>
6768
- <span class="signature">[`gaxpy( N, alpha, x, strideX, y, strideY )`][@stdlib/blas/base/gaxpy]</span><span class="delimiter">: </span><span class="description">multiply `x` by a constant `alpha` and add the result to `y`.</span>
@@ -392,6 +393,8 @@ console.log( objectKeys( blas ) );
392393

393394
[@stdlib/blas/base/dswap]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dswap
394395

396+
[@stdlib/blas/base/dzasum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dzasum
397+
395398
[@stdlib/blas/base/dznrm2]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/dznrm2
396399

397400
[@stdlib/blas/base/gasum]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/gasum

lib/node_modules/@stdlib/blas/base/docs/types/index.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import dsyr = require( '@stdlib/blas/base/dsyr' );
5555
import dsyr2 = require( '@stdlib/blas/base/dsyr2' );
5656
import dtrmv = require( '@stdlib/blas/base/dtrmv' );
5757
import dtrsv = require( '@stdlib/blas/base/dtrsv' );
58+
import dzasum = require( '@stdlib/blas/base/dzasum' );
5859
import dznrm2 = require( '@stdlib/blas/base/dznrm2' );
5960
import gasum = require( '@stdlib/blas/base/gasum' );
6061
import gaxpy = require( '@stdlib/blas/base/gaxpy' );
@@ -1144,6 +1145,32 @@ interface Namespace {
11441145
*/
11451146
dtrsv: typeof dtrsv;
11461147

1148+
/**
1149+
* Computes the sum of the absolute values of the real and imaginary components of a double-precision complex floating-point strided array.
1150+
*
1151+
* @param N - number of indexed elements
1152+
* @param x - input array
1153+
* @param strideX - stride length
1154+
* @returns out
1155+
*
1156+
* @example
1157+
* var Complex128Array = require( '@stdlib/array/complex128' );
1158+
*
1159+
* var x = new Complex128Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] );
1160+
*
1161+
* var out = ns.dzasum( 4, x, 2 );
1162+
* // returns ~1.6
1163+
*
1164+
* @example
1165+
* var Complex128Array = require( '@stdlib/array/complex128' );
1166+
*
1167+
* var x = new Complex128Array( [ 0.3, 0.1, 5.0, 8.0, 0.5, 0.0, 6.0, 9.0, 0.0, 0.5, 8.0, 3.0, 0.0, 0.2, 9.0, 4.0 ] );
1168+
*
1169+
* var out = ns.dzasum.ndarray( 4, x, 2, 0 );
1170+
* // returns ~1.6
1171+
*/
1172+
dzasum: typeof dzasum;
1173+
11471174
/**
11481175
* Computes the L2-norm of a double-precision complex floating-point vector.
11491176
*

lib/node_modules/@stdlib/blas/ext/base/capx/test/test.ndarray.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ tape( 'the function supports an offset parameter', function test( t ) {
208208
-2.0,
209209
3.0, // 0
210210
-4.0, // 0
211-
0.0,
212-
0.0,
213-
5.0, // 1
214-
6.0, // 1
211+
0.0, // 1
212+
0.0, // 1
213+
5.0,
214+
6.0,
215215
0.0,
216216
0.0,
217217
0.0,
@@ -222,10 +222,10 @@ tape( 'the function supports an offset parameter', function test( t ) {
222222
-2.0,
223223
8.0, // 0
224224
-9.0, // 0
225-
5.0,
226-
-5.0,
227225
5.0, // 1
228-
6.0, // 1
226+
-5.0, // 1
227+
5.0,
228+
6.0,
229229
0.0,
230230
0.0,
231231
0.0,

lib/node_modules/@stdlib/blas/ext/base/capx/test/test.ndarray.native.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,10 @@ tape( 'the function supports an offset parameter', opts, function test( t ) {
217217
-2.0,
218218
3.0, // 0
219219
-4.0, // 0
220-
0.0,
221-
0.0,
222-
5.0, // 1
223-
6.0, // 1
220+
0.0, // 1
221+
0.0, // 1
222+
5.0,
223+
6.0,
224224
0.0,
225225
0.0,
226226
0.0,
@@ -231,10 +231,10 @@ tape( 'the function supports an offset parameter', opts, function test( t ) {
231231
-2.0,
232232
8.0, // 0
233233
-9.0, // 0
234-
5.0,
235-
-5.0,
236234
5.0, // 1
237-
6.0, // 1
235+
-5.0, // 1
236+
5.0,
237+
6.0,
238238
0.0,
239239
0.0,
240240
0.0,

0 commit comments

Comments
 (0)