Commit 25f2441
authored
chore(deps): bump ndarray from 0.16.1 to 0.17.1 (#113)
Bumps [ndarray](https://github.com/rust-ndarray/ndarray) from 0.16.1 to
0.17.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-ndarray/ndarray/releases">ndarray's
releases</a>.</em></p>
<blockquote>
<h2>0.17.1</h2>
<p>Version 0.17.1 provides a patch to fix the originally-unsound
implementation of the new array reference types.</p>
<p>The reference types are now all unsized. Practically speaking, this
has one major implication: writing functions and traits that accept
<code>RawRef</code> and <code>LayoutRef</code> will now need a <code>+
?Sized</code> bound to work ergonomically with <code>ArrayRef</code>.
For example, the release notes for 0.17.0 said</p>
<blockquote>
<h4>Reading / Writing Shape: <code>LayoutRef<A, D></code></h4>
<p>LayoutRef lets functions view or modify shape/stride information
without touching data.
This replaces verbose signatures like:</p>
<pre lang="rust"><code>fn alter_view<S>(a: &mut
ArrayBase<S, Ix1>)
where S: Data<Elem = f64>;
</code></pre>
<p>Use AsRef / AsMut for best compatibility:</p>
<pre lang="rust"><code>fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>>;
</code></pre>
</blockquote>
<p>However, these functions now need an additional bound to allow for
callers to pass in <code>&ArrayRef</code> types:</p>
<pre lang="rust"><code>fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>> + ?Sized; // Added bound here
</code></pre>
<p>A huge thank you to Sarah Quiñones (<a
href="https://github.com/sarah-quinones"><code>@sarah-quinones</code></a>)
for catching the original unsound bug and helping to fix it. She does
truly excellent work with <a
href="https://codeberg.org/sarah-quinones/faer"><code>faer-rs</code></a>;
check it out!</p>
<h2>0.17.0 [YANKED]</h2>
<h1>Version 0.17.0 (2025-10-14) [YANKED]</h1>
<p>Version 0.17.0 introduces a new <strong>array reference type</strong>
— the preferred way to write functions and extension traits in
<code>ndarray</code>. This release is fully backwards-compatible but
represents a major usability improvement. The first section of this
changelog explains the change in detail.</p>
<p>It also includes numerous new methods, math functions, and internal
improvements — all credited below.</p>
<h2>A New Way to Write Functions</h2>
<h3>TL;DR</h3>
<p><code>ndarray</code> 0.17.0 adds new reference types for writing
functions and traits that work seamlessly with owned arrays and
views.</p>
<p>When writing functions that accept array arguments:</p>
<ul>
<li><strong>Use <code>&ArrayRef<A, D></code></strong> to read
elements from any array.</li>
<li><strong>Use <code>&mut ArrayRef<A, D></code></strong> to
modify elements.</li>
<li><strong>Use <code>&T where T: AsRef<LayoutRef<A,
D>></code></strong> to inspect shape/stride only.</li>
<li><strong>Use <code>&mut T where T: AsMut<LayoutRef<A,
D>></code></strong> to modify shape/stride only.</li>
</ul>
<p>All existing function signatures continue to work; these new types
are fully opt-in.</p>
<h3>Background</h3>
<p>ndarray has multiple ways to write functions that take arrays (a
problem captured well in issue <a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1059">#1059</a>).
For example:</p>
<pre lang="rust"><code>fn sum(a: ArrayView1<f64>) -> f64;
fn sum(a: &ArrayView1<f64>) -> f64;
</tr></table>
</code></pre>
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-ndarray/ndarray/blob/master/RELEASES.md">ndarray's
changelog</a>.</em></p>
<blockquote>
<h1>Version 0.17.1 (2025-11-02)</h1>
<p>Version 0.17.1 provides a patch to fix the originally-unsound
implementation of the new array reference types.</p>
<p>The reference types are now all unsized.
Practically speaking, this has one major implication: writing functions
and traits that accept <code>RawRef</code> and <code>LayoutRef</code>
will now need a <code>+ ?Sized</code> bound to work ergonomically with
<code>ArrayRef</code>.
For example, the release notes for 0.17.0 said</p>
<blockquote>
<h4>Reading / Writing Shape: <code>LayoutRef<A, D></code></h4>
<p>LayoutRef lets functions view or modify shape/stride information
without touching data.
This replaces verbose signatures like:</p>
<pre lang="rust"><code>fn alter_view<S>(a: &mut
ArrayBase<S, Ix1>)
where S: Data<Elem = f64>;
</code></pre>
<p>Use AsRef / AsMut for best compatibility:</p>
<pre lang="rust"><code>fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>>;
</code></pre>
</blockquote>
<p>However, these functions now need an additional bound to allow for
callers to pass in <code>&ArrayRef</code> types:</p>
<pre lang="rust"><code>fn alter_shape<T>(a: &mut T)
where T: AsMut<LayoutRef<f64>> + ?Sized; // Added bound here
</code></pre>
<p>A huge thank you to Sarah Quiñones (<a
href="https://github.com/sarah-quinones"><code>@sarah-quinones</code></a>)
for catching the original unsound bug and helping to fix it.
She does truly excellent work with <a
href="https://codeberg.org/sarah-quinones/faer"><code>faer-rs</code></a>;
check it out!</p>
<h1>Version 0.17.0 (2025-10-14) [YANKED]</h1>
<p>Version 0.17.0 introduces a new <strong>array reference type</strong>
— the preferred way to write functions and extension traits in
<code>ndarray</code>.<br />
This release is fully backwards-compatible but represents a major
usability improvement.<br />
The first section of this changelog explains the change in detail.</p>
<p>It also includes numerous new methods, math functions, and internal
improvements — all credited below.</p>
<h2>A New Way to Write Functions</h2>
<h3>TL;DR</h3>
<p><code>ndarray</code> 0.17.0 adds new reference types for writing
functions and traits that work seamlessly with owned arrays and
views.</p>
<p>When writing functions that accept array arguments:</p>
<ul>
<li><strong>Use <code>&ArrayRef<A, D></code></strong> to read
elements from any array.</li>
<li><strong>Use <code>&mut ArrayRef<A, D></code></strong> to
modify elements.</li>
<li><strong>Use <code>&T where T: AsRef<LayoutRef<A,
D>></code></strong> to inspect shape/stride only.</li>
<li><strong>Use <code>&mut T where T: AsMut<LayoutRef<A,
D>></code></strong> to modify shape/stride only.</li>
</ul>
<p>All existing function signatures continue to work; these new types
are fully opt-in.</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/66dc0e16a5323408102a8f7c1e5b70183f1a3634"><code>66dc0e1</code></a>
chore: Release</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/85e712f65c714888adbd9405e35aed8edbe107b4"><code>85e712f</code></a>
Add a changelog for 0.17.1 (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1538">#1538</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/1579da4faaf25cf3375b3201164c1a03fbf0cc2a"><code>1579da4</code></a>
Document + ?Sized in a few more places (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1537">#1537</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/dc331a7416e5de32b40b417a5397620f8e918056"><code>dc331a7</code></a>
Fix clippy lint <code>cast_slice_from_raw_parts</code> (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1536">#1536</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/7c56e84f04e3f0f29267b952fc252699cd70391a"><code>7c56e84</code></a>
Update the docs and examples for the new <code>Sized</code>
implementation (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1535">#1535</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/a3b3537788c799025fc7317a15869efbf7ec69e4"><code>a3b3537</code></a>
Makes the reference types sound via a DST (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1532">#1532</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/e6bf80445525ded975cef8f456daad3142b09ccc"><code>e6bf804</code></a>
Mention the used rand version 0.9 in ndarray-rand (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1533">#1533</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/6cd209bd02a0916b9c418ec4bfd81aa7addb8c4f"><code>6cd209b</code></a>
Release ndarray 0.17.0 (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1529">#1529</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/b4e76582d19bf756394eb6e5723889d8995e5306"><code>b4e7658</code></a>
Update configurations for cargo-release (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1528">#1528</a>)</li>
<li><a
href="https://github.com/rust-ndarray/ndarray/commit/8a39cadfe80e95b522616ed76d257225411be7d2"><code>8a39cad</code></a>
Add a changelog for Version 0.17.0 (<a
href="https://redirect.github.com/rust-ndarray/ndarray/issues/1527">#1527</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-ndarray/ndarray/compare/0.16.1...0.17.1">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
You can trigger a rebase of this PR by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
> **Note**
> Automatic rebases have been disabled on this pull request as it has
been open for over 30 days.2 files changed
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments