Skip to content

Commit b758790

Browse files
Merge branch 'shubham2204-tukey/mode' of https://github.com/shubham220420/stdlib into shubham2204-tukey/mode
2 parents f94eb01 + 4b690ad commit b758790

5,992 files changed

Lines changed: 327733 additions & 21911 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/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ body:
5757
- a
5858
- b
5959
- c
60-
render: shell
6160
- type: textarea
6261
id: expected
6362
attributes:
@@ -86,12 +85,14 @@ body:
8685
options:
8786
- N/A
8887
- Node.js
88+
- Deno
8989
- Firefox
9090
- Chrome
9191
- Safari
9292
- Microsoft Edge
9393
- Internet Explorer
9494
- Other Browser
95+
- Other Server Runtime
9596
validations:
9697
required: true
9798
- type: input

.github/workflows/lint_changed_files.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,24 @@ jobs:
147147
- name: 'Lint Markdown files'
148148
if: success() || failure()
149149
run: |
150-
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep -E '\.md$' | grep -v '^\.github/workflows/.*\.md$' | tr '\n' ' ' | sed 's/ $//')
150+
files=$(echo "${{ steps.changed-files.outputs.files }}" | tr ' ' '\n' | grep '\.md$' | tr '\n' ' ' | sed 's/ $//')
151151
if [ -n "${files}" ]; then
152-
make lint-markdown-files FILES="${files}"
152+
# Partition Markdown files by scope to match remark configs:
153+
pkg_readme_files=$(echo "${files}" | tr ' ' '\n' | grep '^lib/node_modules/@stdlib/.*/README\.md$' | tr '\n' ' ' | sed 's/ $//' || true)
154+
docs_files=$(echo "${files}" | tr ' ' '\n' | grep '^docs/' | tr '\n' ' ' | sed 's/ $//' || true)
155+
other_files=$(echo "${files}" | tr ' ' '\n' | grep -v '\.github/workflows/.*\.md$' | grep -v 'lib/node_modules/@stdlib/.*/README\.md$' | grep -v '^docs/' | tr '\n' ' ' | sed 's/ $//' || true)
156+
157+
status=0
158+
if [ -n "${pkg_readme_files}" ]; then
159+
make lint-markdown-package-readme-files FILES="${pkg_readme_files}" || status=$?
160+
fi
161+
if [ -n "${docs_files}" ]; then
162+
make lint-markdown-docs-files FILES="${docs_files}" || status=$?
163+
fi
164+
if [ -n "${other_files}" ]; then
165+
make lint-markdown-files FILES="${other_files}" || status=$?
166+
fi
167+
exit $status
153168
fi
154169
155170
# Lint shell script files:

.github/workflows/lint_random_files.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,24 @@ jobs:
250250
- name: 'Lint Markdown files'
251251
if: ( github.event.inputs.markdown != 'false' ) && ( success() || failure() )
252252
run: |
253-
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -E '\.md$' | tr '\n' ' ')
253+
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep '\.md$' | tr '\n' ' ')
254254
if [ -n "${files}" ]; then
255-
make lint-markdown-files FAST_FAIL=0 FILES="${files}"
255+
# Partition Markdown files by scope to match remark configs:
256+
pkg_readme_files=$(echo "${files}" | tr ' ' '\n' | grep '^lib/node_modules/@stdlib/.*/README\.md$' | tr '\n' ' ' | sed 's/ $//' || true)
257+
docs_files=$(echo "${files}" | tr ' ' '\n' | grep '^docs/' | tr '\n' ' ' | sed 's/ $//' || true)
258+
other_files=$(echo "${files}" | tr ' ' '\n' | grep -v 'lib/node_modules/@stdlib/.*/README\.md$' | grep -v '^docs/' | tr '\n' ' ' | sed 's/ $//' || true)
259+
260+
status=0
261+
if [ -n "${pkg_readme_files}" ]; then
262+
make lint-markdown-package-readme-files FAST_FAIL=0 FILES="${pkg_readme_files}" || status=$?
263+
fi
264+
if [ -n "${docs_files}" ]; then
265+
make lint-markdown-docs-files FAST_FAIL=0 FILES="${docs_files}" || status=$?
266+
fi
267+
if [ -n "${other_files}" ]; then
268+
make lint-markdown-files FAST_FAIL=0 FILES="${other_files}" || status=$?
269+
fi
270+
exit $status
256271
fi
257272
258273
# Lint package.json files:
@@ -505,7 +520,6 @@ jobs:
505520
id: lint-typescript-declarations
506521
if: ( github.event.inputs.javascript != 'false' ) && ( success() || failure() )
507522
run: |
508-
set -o pipefail
509523
files=$(echo "${{ steps.random-files.outputs.files }}" | tr ',' '\n' | grep -E '\.d\.ts$' | tr '\n' ' ')
510524
if [[ -n "${files}" ]]; then
511525
make TYPESCRIPT_DECLARATIONS_LINTER=eslint lint-typescript-declarations-files FAST_FAIL=0 FILES="${files}" 2>&1 | tee lint_typescript_declarations_errors.txt

.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:

.npmrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ save = false
2929

3030
# Do not generate provenance metadata:
3131
provenance = false
32+
33+
# Prefer cached dependencies during install:
34+
prefer-offline = true
35+
36+
# Require signing Git commits and tags when using `npm version`:
37+
sign-git-commit = true
38+
sign-git-tag = true
39+
40+
# Run Git commit hooks when using `npm version`:
41+
commit-hooks = true
42+
43+
# Require that dependencies within the dependency tree have a minimum release age (in days) in order to guard against supply chain attacks:
44+
min-release-age = 90
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ea0701a6bc256405b03975908a6a92d0ffecdd18579e8484b8d789c8bd561787

deps/test/fftpack/test_install.c

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 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+
#include <stdio.h>
20+
#include <stdlib.h>
21+
22+
extern void rffti( int n, double *wsave );
23+
24+
int main( void ) {
25+
double wsave[ 2*8 + 15 ]; // 2*n + 15
26+
int n = 8;
27+
int i;
28+
29+
rffti( n, wsave );
30+
31+
printf( "rffti( %d, wsave )\n", n );
32+
for ( i = n; i < 2*n; i++ ) {
33+
printf( "wsave[%2d] = %f\n", i, wsave[i] );
34+
}
35+
printf( "\n" );
36+
}

docs/contributing/zen_of_stdlib.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ limitations under the License.
2222

2323
# Zen of stdlib
2424

25+
```text
2526
Do one thing. Do it well.
2627
Embrace radical modularity.
2728
Favor composition over configuration.
@@ -56,6 +57,7 @@ Mistakes are infectious.
5657
Fix them early.
5758
5859
Simple is beautiful.
60+
```
5961

6062
* * *
6163

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
type: amend-message
3+
---
4+
bench: refactor to use dynamic memory allocation in `stats/base/snanstdev`
5+
6+
PR-URL: https://github.com/stdlib-js/stdlib/pull/11607
7+
Ref: https://github.com/stdlib-js/stdlib/issues/8643
8+
9+
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>

0 commit comments

Comments
 (0)