-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Docs] add missing arrayXYZ functions #62299
Conversation
@justindeguzman @johnnymatthews could one of you please give this a look over when you get a chance. |
This is an automated comment for commit 19916de with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
|
||
## arrayPartialShuffle | ||
|
||
Returns an array of the same size as the original array where elements in range `[1..limit]` are a random subset of the original array. Remaining `(limit..N]` shall contain the elements not in `[1..limit]` range in an undefined order. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please document what N
stands for (=the cardinality/size of the input array).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear to the reader what this function is actually doing.
- [1..limit] is supposed to be a random (aka. shuffled) subset of the input array
- (limit..N] is supposed to be a random subset of the remaining elements.
So function arrayPartialShuffle
basically permutes the whole thing? How is it then different from arrayShuffle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rschu1ze I've tried to make it clearer what this function does - both in the description, and in the examples. How does it look to you now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better now, thank you!
…n alias to the superset
small fixes to wording
|
||
## arrayPartialShuffle | ||
|
||
Given an input array of cardinality `N`, returns an array of size N where elements in the range `[1...limit]` are shuffled and the remaining elements in the range `(limit...n]` are unshuffled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In of size N
, "N" should be quoted.
(really minor, can be fixed in a follow-up PR)
[6,2,3,4,5,1,7,8,9,10] | ||
``` | ||
|
||
In this example, the `limit` is increased to `2` and a `seed` value is provided. The order |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The order" seems a remnant.
Closes #1934 as part of the functions project to document missing functions.
This PR adds documentation for the following functions listed in #1934:
Changelog category (leave one):
Documentation entry for user-facing changes