Skip to content

docs: improve doctests for ndarray instances in ndarray/fill#12248

Merged
kgryte merged 1 commit into
stdlib-js:developfrom
nightt5879:nightt5879/improve-ndarray-fill-doctest
May 24, 2026
Merged

docs: improve doctests for ndarray instances in ndarray/fill#12248
kgryte merged 1 commit into
stdlib-js:developfrom
nightt5879:nightt5879/improve-ndarray-fill-doctest

Conversation

@nightt5879
Copy link
Copy Markdown
Contributor

@nightt5879 nightt5879 commented May 23, 2026

Progresses #9329

Summary

  • Replace the ndarray/fill usage doctest's explicit ndarray2array conversion with ndarray instance notation.
  • Remove the now-unused @stdlib/ndarray/to-array import from that doctest.

Impact

This keeps the example focused on the returned ndarray while preserving the existing fill identity check.

Validation

  • git diff --check - passed
  • NODE_PATH=lib/node_modules node -e "const fill=require('@stdlib/ndarray/fill'); const zeros=require('@stdlib/ndarray/zeros'); const ndarray2array=require('@stdlib/ndarray/to-array'); const x=zeros([3,1,2], {'dtype':'float64'}); const y=fill(x,10.0); if (y !== x) { throw new Error('fill did not return input ndarray'); } const expected=[[[10,10]],[[10,10]],[[10,10]]]; const actual=ndarray2array(x); if (JSON.stringify(actual)!==JSON.stringify(expected)) { throw new Error('unexpected filled values: '+JSON.stringify(actual)); }" - passed

Checklist

@stdlib-bot
Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot added the Good First PR A pull request resolving a Good First Issue. label May 23, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented May 23, 2026

Coverage Report

Package Statements Branches Functions Lines
ndarray/fill $\color{green}116/116$
$\color{green}+100.00%$
$\color{green}7/7$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}116/116$
$\color{green}+100.00%$

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

@nightt5879 nightt5879 marked this pull request as ready for review May 23, 2026 02:57
@nightt5879 nightt5879 requested a review from a team May 23, 2026 02:57
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 23, 2026
Copy link
Copy Markdown
Member

⚠️ Issue Reference Review

An automated check found potentially unrelated issue/PR references in this PR:

Reference Assessment Reasoning
#9329 suspicious #9329 is a tracking issue listing many packages to update with ndarray doctest improvements; this PR only updates ndarray/fill. Using "Closes" will auto-close the entire tracking issue when this PR is merged, which would prevent other contributors from seeing it and contributing additional package updates.

Why this matters: GitHub automatically closes issues referenced with closing keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect references can accidentally close unrelated issues.

What to do:

  • If the reference is correct, no action needed. This check may produce false positives.
  • If the reference is incorrect, please update your PR description.

This assessment was generated by an AI model and is informational only.


Generated by Claude Code

@stdlib-bot
Copy link
Copy Markdown
Contributor

⚠️ Tracking Issue Closure Warning ⚠️

I noticed your PR description contains closing keywords ("Resolves", "Closes", or "Fixes") referencing a "Tracking Issue".

Why this matters:
Tracking issues should typically remain open until all related sub-issues are completed. GitHub automatically closes issues with such closing keywords when the PR is merged. For more information, see GitHub's documentation on using keywords in issues and pull requests.

Required action:
Use "Progresses" instead to reference the tracking issue without automatically closing it.

Thank you for your contribution to the project!

@kgryte kgryte added Documentation Improvements, additions, or changes to documentation. difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 5 and removed Needs Review A pull request which needs code review. labels May 24, 2026
@kgryte kgryte merged commit a2fcfdb into stdlib-js:develop May 24, 2026
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. Documentation Improvements, additions, or changes to documentation. Good First PR A pull request resolving a Good First Issue. review: 5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants