Skip to content

Commit 3fb6535

Browse files
mbaumantkelman
authored andcommitted
NEWS for to_indices (#19730) (#22152)
* NEWS for to_indices (#19730) (cherry picked from commit 91f08bb)
1 parent 91d83c3 commit 3fb6535

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

NEWS.md

+17
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,22 @@ Library improvements
328328
that dimension's length will be computed such that its product with all the other dimensions is equal
329329
to the length of the original array ([#19919]).
330330
331+
* The new `to_indices` function provides a uniform interface for index conversions,
332+
taking an array and a tuple of indices as arguments and returning a tuple of
333+
integers and/or arrays of supported scalar indices. It will throw an `ArgumentError`
334+
for any unsupported indices, and the returned arrays should be iterated over (and
335+
not indexed into) to support more efficient logical indexing ([#19730]).
336+
337+
+ Using colons (`:`) to represent a collection of indices is deprecated. They now must be
338+
explicitly converted to a specialized array of integers with the `to_indices` function.
339+
   As a result, the type of `SubArray`s that represent views over colon indices has changed.
340+
341+
+ Logical indexing is now more efficient. Logical arrays are converted by `to_indices` to
342+
a lazy, iterable collection of indices that doesn't support indexing. A deprecation
343+
provides indexing support with O(n) lookup.
344+
345+
+ The performance of indexing with `CartesianIndex`es is also improved in many situations.
346+
331347
* A new `titlecase` function was added, to capitalize the first character of each word within a string ([#19469]).
332348
333349
* `any` and `all` now always short-circuit, and `mapreduce` never short-circuits ([#19543]).
@@ -671,6 +687,7 @@ Command-line option changes
671687
[#19721]: https://github.com/JuliaLang/julia/issues/19721
672688
[#19722]: https://github.com/JuliaLang/julia/issues/19722
673689
[#19724]: https://github.com/JuliaLang/julia/issues/19724
690+
[#19730]: https://github.com/JuliaLang/julia/issues/19730
674691
[#19737]: https://github.com/JuliaLang/julia/issues/19737
675692
[#19741]: https://github.com/JuliaLang/julia/issues/19741
676693
[#19766]: https://github.com/JuliaLang/julia/issues/19766

0 commit comments

Comments
 (0)