nushell/crates
Ian Manske 0918050ac8
Deprecate group in favor of chunks (#13377)
# Description
The name of the `group` command is a little unclear/ambiguous.
Everything I look at it, I think of `group-by`. I think `chunks` more
clearly conveys what the `group` command does. Namely, it divides the
input list into chunks of a certain size. For example,
[`slice::chunks`](https://doc.rust-lang.org/std/primitive.slice.html#method.chunks)
has the same name. So, this PR adds a new `chunks` command to replace
the now deprecated `group` command.

The `chunks` command is a refactored version of `group`. As such, there
is a small performance improvement:
```nushell
# $data is a very large list
> bench { $data | chunks 2 } --rounds 30 | get mean
474ms 921µs 190ns

# deprecation warning was disabled here for fairness
> bench { $data | group 2 } --rounds 30 | get mean
592ms 702µs 440ns



> bench { $data | chunks 200 } --rounds 30 | get mean
374ms 188µs 318ns

> bench { $data | group 200 } --rounds 30 | get mean
481ms 264µs 869ns 



> bench { $data | chunks 1 } --rounds 30 | get mean
642ms 574µs 42ns

> bench { $data | group 1 } --rounds 30 | get mean
981ms 602µs 513ns
```

# User-Facing Changes
- `group` command has been deprecated in favor of new `chunks` command.
- `chunks` errors when given a chunk size of `0` whereas `group` returns
chunks with one element.

# Tests + Formatting
Added tests for `chunks`, since `group` did not have any tests.

# After Submitting
Update book if necessary.
2024-07-16 03:49:00 +00:00
..
nu_plugin_custom_values Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu_plugin_example Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
nu_plugin_formats remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00
nu_plugin_gstat remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00
nu_plugin_inc remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00
nu_plugin_nu_example Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu_plugin_polars Make polars unpivot consistent with polars pivot (#13335) 2024-07-10 16:36:38 -05:00
nu_plugin_python remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00
nu_plugin_query Use conventional generic bounds (#13360) 2024-07-12 17:13:07 +08:00
nu_plugin_stress_internals Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu-cli Report parse warns and compile errs when running script files (#13369) 2024-07-14 10:12:55 +02:00
nu-cmd-base Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-cmd-extra Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-cmd-lang Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-cmd-plugin remove the deprecated register command (#13297) 2024-07-05 07:16:50 -05:00
nu-color-config Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-command Deprecate group in favor of chunks (#13377) 2024-07-16 03:49:00 +00:00
nu-derive-value Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu-engine Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-explore Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-glob Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu-json Fix CI test failure on main (nu-json) (#13374) 2024-07-14 10:37:57 +02:00
nu-lsp Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-parser Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-path Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-plugin Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
nu-plugin-core Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
nu-plugin-engine Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
nu-plugin-protocol Update config directly at assignment (#13332) 2024-07-11 06:09:33 -07:00
nu-plugin-test-support Add and use new Signals struct (#13314) 2024-07-07 22:29:01 +00:00
nu-pretty-hex Bumping version to 0.95.1 (#13231) 2024-06-25 18:26:07 -07:00
nu-protocol Deprecate group in favor of chunks (#13377) 2024-07-16 03:49:00 +00:00
nu-std Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-system Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-table Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-term-grid Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nu-test-support Fix CI test failure on main (nu-json) (#13374) 2024-07-14 10:37:57 +02:00
nu-utils Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
nuon Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00
README.md

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.