Skip to content

style: add whitespace - #15394

Merged
kgryte merged 4 commits into
developfrom
philipp/fix-commit-review-2026-09-21
Sep 22, 2026
Merged

kgryte merged 4 commits into
developfrom
philipp/fix-commit-review-2026-09-21

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Follow-up fixes for commits merged to develop between 2026-09-20 23:56:55 -0700 (32b82d9f2) and 2026-09-21 01:04:16 -0700 (1a20e0293).

Description

What is the purpose of this pull request?

This pull request:

  • Corrects array-index spacing in the isAlmostSameValue assertions introduced by four of the ULP-migration commits in that window. docs/style-guides/javascript/README.md ("Rule: Include spaces around array indices") requires expected[ i ]; these four commits wrote expected[i]. Commit 48f3eda37 applied exactly this fix to math/base/special/roundnf in the same window, so this is the same cleanup carried across the packages it missed.

Fixes, grouped by package (22 occurrences, 10 files, one commit per package):

stats/base/dists/bradford/skewness

  • f6cb35602 swapped in isAlmostSameValue but wrote expected[i] instead of expected[ i ] in stats/base/dists/bradford/skewness/test/test.js:78 and test.native.js:87; fixed the spacing per the style guide, tolerance (36250 ULP) unchanged.

stats/base/dists/cauchy/logcdf

  • Fixed spacing in stats/base/dists/cauchy/logcdf/test/test.logcdf.js, test.factory.js, and test.native.js (5415582c2): expected[i] -> expected[ i ] per our array-index style rule; same drive-by we did in math/base/special/roundnf (48f3eda37) the same day. No changes to the ULP tolerances.

stats/base/dists/halfnormal/mean

  • Whitespace fix: expected[i]expected[ i ] in stats/base/dists/halfnormal/mean/test/test.js (L75) and test.native.js (L80), missed in 48ecece37 per the array-index spacing rule; ULP tolerance untouched. Same fix landed in math/base/special/roundnf via 48f3eda37.

stats/base/dists/triangular/quantile

  • Whitespace fix in stats/base/dists/triangular/quantile (dfbd4c5c8): the isAlmostSameValue assertions in test.quantile.js, test.factory.js, and test.native.js used expected[i] instead of expected[ i ], violating the array-index spacing rule; fixed all nine occurrences, no change to ULP tolerance.

Related Issues

Does this pull request have any related issues?

No. The originating commits reference #11352 (ULP-based assertion migration); this is follow-up cleanup only.

Questions

Any questions for reviewers of this pull request?

The expected[i] form appears roughly 340 times repo-wide in tests migrated before this window. This PR deliberately touches only the lines introduced in the 2026-09-20/21 window rather than doing a repo-wide sweep. Say the word if you'd rather have the sweep as a separate PR.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Window audited. 27 commits, 60 files, +380/−829. 19 of the commits are the test: migrate ... to ULP-based assertions effort (#11352); the outliers are float16 support in ndarray/ones (46f04ebe0), a BLAS benchmark require-path normalization (4eff2519e), the ndarray/nans-like doc fix (71758bb36), roundnf spacing (48f3eda37), a git note (f23042f13), and a bot equation-URL refresh (32b82d9f2).

Validation. Four independent reviewers ran over the window: two for style-guide compliance against established reference packages, two for bugs. Checks that came back clean and produced no changes here:

  • Loop bounds in every rewritten ULP loop — no bound was altered by any commit; each loop still indexes the arrays it did before.
  • Dropping the isnan branch in stats/incr/mgmean — safe, since @stdlib/assert/is-almost-same-value implements SameValue and NaN compares equal to NaN. The null guards in gumbel/entropy, lognormal/skewness, and incr/nankurtosis were all retained.
  • ULP tolerances — none is wide enough to be unfalsifiable; bradford's 36250 is the measured max ULP difference over its 1000-point fixture.
  • ndarray/ones float16 — the new benchmark.size.float16.js is byte-identical to benchmark.size.float32.js apart from the dtype and label, the .d.ts overload sits in the same position as in ndarray/zeros, and the new tests exercise both orders.
  • BLAS require paths — all 11 packages export ndarray from lib/ndarray.js via setReadOnly, so require( './../lib/ndarray.js' ) is the identical function object.
  • No unused requires, dangling delta/tol/EPS references, or syntax errors in any changed file.

Deliberately excluded. Anything needing interpretation: per-assertion ULP constants (the migration's whole point is that these are chosen per function), removal of the verbose interpolated failure messages in favor of 'returns expected value', and the pre-existing expected[i] occurrences outside this window's diff.

Not executed. The repository has no installed dev dependencies in this environment, so the tape suites were not run here. The changes are whitespace-only inside an argument expression and every modified file passes node --check.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".

This PR was produced by Claude Code running as a scheduled daily review of commits merged to develop. It enumerated the 24-hour commit window, dispatched four independent reviewer agents (two for style-guide compliance, two for bugs), cross-checked and filtered their findings, and applied the surviving ones. Every change here is whitespace-only and was re-read against the proposed fix before committing. Opened as a draft for human audit before promotion.


@stdlib-js/reviewers

🤖 Generated with Claude Code

https://claude.ai/code/session_01VH6Gk9z9xEyB6DyiJAj9x2


Generated by Claude Code

…skewness` tests

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VH6Gk9z9xEyB6DyiJAj9x2
…gcdf` tests

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VH6Gk9z9xEyB6DyiJAj9x2
…l/mean` tests

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VH6Gk9z9xEyB6DyiJAj9x2
…r/quantile` tests

Ref: #11352

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VH6Gk9z9xEyB6DyiJAj9x2
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality. and removed Good First PR A pull request resolving a Good First Issue. labels Sep 21, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/bradford/skewness $\\color{green}185/185$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}185/185$
$\\color{green}+100.00\\%$
stats/base/dists/cauchy/logcdf $\\color{green}289/289$
$\\color{green}+100.00\\%$
$\\color{green}19/19$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}289/289$
$\\color{green}+100.00\\%$
stats/base/dists/halfnormal/mean $\\color{green}168/168$
$\\color{green}+100.00\\%$
$\\color{green}8/8$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}168/168$
$\\color{green}+100.00\\%$
stats/base/dists/triangular/quantile $\\color{green}356/356$
$\\color{green}+100.00\\%$
$\\color{green}35/35$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}356/356$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

@kgryte
kgryte marked this pull request as ready for review September 22, 2026 10:00
@kgryte
kgryte requested a review from a team September 22, 2026 10:00
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Sep 22, 2026
@kgryte kgryte changed the title style: add spaces around array indices in ULP-migrated distribution tests style: add whitespace Sep 22, 2026
@kgryte
kgryte merged commit a3e3463 into develop Sep 22, 2026
67 checks passed
@kgryte
kgryte deleted the philipp/fix-commit-review-2026-09-21 branch September 22, 2026 10:01
@stdlib-bot stdlib-bot added Good First PR A pull request resolving a Good First Issue. and removed Needs Review A pull request which needs code review. labels Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First PR A pull request resolving a Good First Issue. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants