DSL for array and data-frame slices
Table of Contents
About the Project
This library provides:
- An API for taking slices (elements selected by the Cartesian product of vectors of subscripts for each axis) of array-like objects. The most important function is
select. Unless you want to define additional methods for
select, this is pretty much all you need from this library. See the documentation for a tutorial.
- An extensible DSL for selecting a subset of valid subscripts. This is useful if, for example, you want to resolve column names in a data frame in your implementation of select.
- A set of utility functions for traversing selections in array-like objects.
To get a local copy up and running follow these steps:
- Clone the repository
cd ~/quicklisp/local-projects && git clone https://github.com/Lisp-Stat/select.git
- Reset the ASDF source-registry to find the new system (from the REPL)
- Load the system
The API documentation is in the
docs/ directory and is available in
emacs info format, PDF and HTML. You can also view the documentation
The most frequently used form is:
(select object selection1 selection2 ...)
where each selection specifies a set of subscripts along the corresponding axis. The selection specifications are found in the documentation.
For more examples, please refer to the Reference Manual
See the open issues for a list of proposed features (and known issues).
Select is known to pass all tests on SBCL and ACL (Allegro Common Lisp), and fails two tests on CCL related to vector/array representations. The specifics are described in issue #3. I suspect this to be a bug somewhere in CCL. Version 1.12 of CCL doesn't run on MS Windows, so the obvious next step is not available (install 1.12 and try). It could also be specific to MS Windows. If someone successfully gets this to run on another platform, I'd appreciate hearing about it.
Changes from cl-slice
- Move to HTML based documentation system
- Reference docs now on github.io
- Documented selection iteration
- Improved examples and explanations
- Ported to FiveAM and refactored
- Improved test coverage
- Added failure messages to aid debugging
- Added tests for selection iteration
- Renamed 'cons' to 'range'
- Range now handles (range x x) => nil
- Selections work identically on sequences; previously differed between lists and vectors
- Vector selections may be specified using a list; previously could only be a vector. See also issue #2
- Sequence selections now honor fill-pointer (fixes first issue on Papp's issue 3)
- Range now handles END = (length SEQUENCE)
- Selecting from a list no longer drops dimension
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Please see CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.
Distributed under the MS-PL License. See
LICENSE for more information.
Project Link: https://github.com/lisp-stat/select