Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Improve wrapper documentation
Browse files Browse the repository at this point in the history
Closes #59
  • Loading branch information
Raphael Sonabend committed Oct 26, 2020
1 parent 113d2bf commit 89b8db2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions R/SetWrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
#' @rdname SetWrapper
#' @title Abstract SetWrapper Class
#' @description This class should not be constructed directly. Parent class to `SetWrapper`s.
#' @details Wrappers in set6 are utilised to facilitate lazy evaluation and symbolic representation.
#' Each operation has an associated wrapper that will be returned if `simplify = FALSE` or if the
#' result would be too complex to return as a simple [Set]. Wrappers have an identical interface
#' to [Set]. Their primary advantage lies in a neat representation of any set composition (the
#' result of an operation) and the ability to query the set contents without ever directly
#' evaluating the set elements.
SetWrapper <- R6Class("SetWrapper",
inherit = Set,
public = list(
Expand Down
3 changes: 1 addition & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ Whilst the `set6` API is stable, it is considered 'maturing', and therefore whil

* Finalising all methods and fields - some are missing or possibly inaccurate for some wrappers. For example the cardinality of `ComplementSet`s is imprecise at the moment.
* We are considering adding a `simplify` method to wrappers to reduce classes inheriting from `SetWrapper` to simpler sets. This allows users to perform operations with `simplify = FALSE` and then to change their mind.
* There are some inefficient loops implemented that will need refactoring for more efficient code.
* There are known bottlenecks that need to be fixed to massively improve speed and efficiency.
* Adding more tutorials to make the interface easier for beginners, especially people new to R6


At a later stage we may consider adding Venn diagrams for visualisation of sets and intervals, but this is very low priority.

## Similar Packages
Expand Down
8 changes: 8 additions & 0 deletions man/SetWrapper.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions vignettes/set6.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ Set$new(1) & Set$new(2)

Finally we look briefly at wrappers, and the `simplify` argument.
Each operation has an associated wrapper that will be created if `simplify == FALSE` or if the
resulting set is too complicated to return as a single `Set` object. The operations concerned with
resulting set is too complicated to return as a single `Set` object. Wrappers faciliate lazy evaluation
and symbolic representation by providing unique character representations of all sets after operations
and do not evaluate the set elements unless specifically requested. In general wrappers should not
be directly constructed but instead only used as the result of operations. The operations concerned with
products, i.e. `setproduct`, `setpower`, `powerset`, all have `simplify == FALSE` as the default; whereas the others concerned with unions and differences, have `simplify == TRUE` as the default.

```{r}
Expand Down Expand Up @@ -223,6 +226,9 @@ p$contains(Tuple$new(2, 4))

## Going Forward

`set6` is still in its early stages and the API is considered to be maturing, this means that whilst no big changes are expected to the design, minor ones can be expected. `set6` will be considered to be in its version 1 once all methods and fields are finalised (some are missing from wrappers), and when the code has been refactored to be more efficient. See [the website](https://xoopR.github.io/set6/) for more tutorials and
`set6` is still relatively slow compared to other sets packages and most short-term updates
will focus on improving bottlenecks.

See [the website](https://xoopR.github.io/set6/) for more tutorials and
follow/star on [GitHub](https://github.com/xoopR/set6) for updates.

0 comments on commit 89b8db2

Please sign in to comment.