Skip to content
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

release: Release 0.7.0 #308

Merged
merged 80 commits into from
Jul 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
a45507e
bump minor
sorhawell Jul 4, 2023
4357fab
docs(README): about installation from CRAN
eitsupi Jul 4, 2023
227cc87
https://github.com/ThinkR-open/prepare-for-cran#do-not-put-in-r-or-wi…
sorhawell Jul 4, 2023
dbe609e
subjective aestehtic changes to DESCRIPTION
sorhawell Jul 4, 2023
195f6ea
https://github.com/ThinkR-open/prepare-for-cran#do-not-put-this-packa…
sorhawell Jul 4, 2023
861847d
https://github.com/ThinkR-open/prepare-for-cran#do-not-put-this-packa…
sorhawell Jul 4, 2023
b579cd7
rhub_check bring down compile time, opt-level = 1
sorhawell Jul 4, 2023
dd420f2
new author
sorhawell Jul 4, 2023
ddaa6ff
opt-level = 1 on release-optimized also
sorhawell Jul 4, 2023
cccf20c
disable polars_info() test of pkg version
sorhawell Jul 4, 2023
b267525
update news
sorhawell Jul 4, 2023
a61ec88
merge in read-scan refactor + new polars_info test
sorhawell Jul 4, 2023
133e80b
update ExprDT .Rd files
sorhawell Jul 4, 2023
c7b9969
correct merge of test-info
sorhawell Jul 4, 2023
18973b2
merge in license + update news
sorhawell Jul 4, 2023
0a0119c
obey CRAN title case
sorhawell Jul 5, 2023
335ad15
add back opt-level = 3
sorhawell Jul 5, 2023
87318ef
add ctb Bacher
sorhawell Jul 5, 2023
46366c6
run make build not rextendr::document() to fix doc
sorhawell Jul 5, 2023
626ac61
ExprDT lock usage with @usage NULL
sorhawell Jul 5, 2023
7cd3ddf
docs: minor update of person's name notation
eitsupi Jul 5, 2023
beed959
chore: add cran-comments.md by `usethis::use_cran_comments()`
eitsupi Jul 5, 2023
2411040
test: enable polars_info snapshot test
eitsupi Jul 5, 2023
b609701
CRAN capitalize title
sorhawell Jul 6, 2023
85a71bf
drop arr to list in news
sorhawell Jul 6, 2023
ff116b6
CRAN quote use of <>-brackets in docs
sorhawell Jul 6, 2023
57d0187
CRAN use final redirected site
sorhawell Jul 6, 2023
a522890
fix more url
sorhawell Jul 6, 2023
4b56e70
cran submission file as is
sorhawell Jul 6, 2023
571d604
quote DataFrame
sorhawell Jul 6, 2023
3d1082e
update .Rd files
sorhawell Jul 6, 2023
f28ed4e
fix link in news
sorhawell Jul 6, 2023
45d825b
try avoid url links to binaries
sorhawell Jul 6, 2023
5687878
add first submission comments
sorhawell Jul 6, 2023
45a6aac
update cran comments
sorhawell Jul 6, 2023
8b4e04e
submitted again
sorhawell Jul 6, 2023
56e3859
quote software and package names in DESCRIPTION
etiennebacher Jul 7, 2023
257aa1a
remove a \dontrun call
etiennebacher Jul 7, 2023
9f335de
remove some of the `:::` in examples
etiennebacher Jul 7, 2023
569e7b9
Merge branch 'main' into 0.7.0rc
etiennebacher Jul 7, 2023
1f760f4
minor in DESCRIPTION
etiennebacher Jul 7, 2023
0a674e2
better dev comments, add @noRd to any internal function
sorhawell Jul 7, 2023
1b3c6a2
tidy ns, drop :::, fix examples, drop intl docs
sorhawell Jul 7, 2023
cb4b0d5
add missing `@return` (or fix it)
etiennebacher Jul 8, 2023
653bbd9
remove last `:::`
etiennebacher Jul 8, 2023
8478130
fix missing return values
etiennebacher Jul 8, 2023
f20d76b
update cran-comments
etiennebacher Jul 8, 2023
b3258d4
typos
etiennebacher Jul 8, 2023
176433b
docs: fix docs of as.charactor.Series
eitsupi Jul 8, 2023
87183fe
docs: fix of read_csv
eitsupi Jul 8, 2023
28ce1b4
test: test read_csv
eitsupi Jul 8, 2023
e30099f
refactor: should not use `:::` in functions
eitsupi Jul 8, 2023
1937207
let show_all_public_methods all show by single class
sorhawell Jul 8, 2023
559075e
remove last :::, add to cran-comments
sorhawell Jul 8, 2023
c61b82a
add missing docs for 3 DollarNames methods
sorhawell Jul 8, 2023
ca38be5
more accurate claim in comments, 500 -> 324methods
sorhawell Jul 9, 2023
70a6a4d
typo "which many" + rephrase
sorhawell Jul 9, 2023
597a633
include 103 subnamespace functions in count
sorhawell Jul 9, 2023
211e9b7
reword some cran-comments [skip ci]
etiennebacher Jul 9, 2023
5b62ff0
Merge branch 'main' into 0.7.0rc
eitsupi Jul 10, 2023
41f1e70
Merge branch 'main' into 0.7.0rc
eitsupi Jul 10, 2023
570017d
update CRAN-SUBMISSION
sorhawell Jul 10, 2023
95d0e2f
CRAN-SUBMISSION with correct nanoarrow
sorhawell Jul 10, 2023
0593b2b
add @return everywhere
sorhawell Jul 12, 2023
434136e
prune cran-comments
sorhawell Jul 12, 2023
cbf7057
drop old R cmd check filters
sorhawell Jul 12, 2023
8d1f0e8
LICENSE polars authors (polars the R package)
sorhawell Jul 12, 2023
bbf633a
develop_polars.R provides load_polars(), check_polars() and build_pol…
sorhawell Jul 12, 2023
1d18b27
submit_polars() 20 min faster than submit_cran()
sorhawell Jul 12, 2023
e0998d9
drop a browser()
sorhawell Jul 12, 2023
7595f0e
did not delete submission temp bug
sorhawell Jul 12, 2023
6d7139a
add has_recursive
sorhawell Jul 12, 2023
1bf3635
update cran-comments
sorhawell Jul 13, 2023
9ea534e
compile cran vignettes not with all features
sorhawell Jul 13, 2023
2d8799e
Try make comments more readable
sorhawell Jul 14, 2023
19ee9bc
optinoal keep temp build
sorhawell Jul 14, 2023
e72f4e8
chore: change cre [skip ci]
eitsupi Jul 15, 2023
29a57de
chore: autoformatting [skip ci]
eitsupi Jul 15, 2023
8c2aec5
chore: should ignore .devcontainer [skip ci]
eitsupi Jul 15, 2023
da1c48e
chore: add CRAN-SUBMISSION [skip ci]
eitsupi Jul 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
^\.venv$
^Makefile$
^src/\.cargo$
^cran-comments\.md$
^CRAN-SUBMISSION$
^\.devcontainer$
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.7.0
Date: 2023-07-15 22:14:51 UTC
SHA: 8c2aec5466018d0c51dde9b14c1e6503590e0332
15 changes: 9 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
Package: polars
Title: 'Polars' Ported to R
Version: 0.6.1.9000
Title: Lightning-Fast 'DataFrame' Library
Version: 0.7.0
Depends: R (>= 4.1.0)
Imports: utils, codetools
Authors@R:
c(person("Ritchie", "Vink", , "ritchie46@gmail.com", role = c("aut")),
person("Soren", "Welling", , "sorhawell@gmail.com", role = c("aut","cre")))
Description: 'Polars' is a lightning fast Data Frame library written in Rust.
This package allows converting R data to 'Polars' data and vice versa,
and enabling fast data processing with 'Polars'.
person("Soren", "Welling", , "sorhawell@gmail.com", role = c("aut")),
person("Tatsuya", "Shima", , "ts1s1andn@gmail.com", role = c("aut", "cre")),
person("Etienne", "Bacher", , "etienne.bacher@protonmail.com", role = c("ctb")))
Description: Lightning-fast 'DataFrame' library written in 'Rust'. Convert R data
to 'Polars' data and vice versa. Perform fast, lazy, larger-than-memory and
optimized data queries. 'Polars' is interoperable with the package 'arrow',
as both are based on the 'Apache Arrow' Columnar Format.
License: MIT + file LICENSE
Language: en-US
Encoding: UTF-8
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: rpolars authors
COPYRIGHT HOLDER: polars authors (polars the R package)
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 rpolars authors
Copyright (c) 2023 polars authors (polars the R package)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 7 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# polars (development version)
# polars 0.7.0

## BREAKING CHANGES

- Replace the argument `reverse` by `descending` in all sorting functions. This
is for consistency with the upstream Polars (#291, #293).
- Bump rust-polars from 2023-04-20 unreleased version to version 0.30.0 released in 2023-05-30 (#289).
- Rename `concat_lst` to `concat_list`.
<!-- TODO: - Rename `arr` to `list`. -->
- Rename `$str$explode` to `$str$str_explode`.
- Remove `tz_aware` and `utc` arguments from `str_parse`.
- in `$date_range`'s the `lazy` argument is now `TRUE` by default.
Expand Down Expand Up @@ -38,7 +37,11 @@ for demonstration purposes (#240).
- `<DataFrame>$glimpse()` is a fast `str()`-like view of a `DataFrame` (#277).
- `$over()` now accepts a vector of column names (#287).
- New method `<DataFrame>$describe()` (#268).
- Cross joining is now possible with `how = "cross"` in `$join()`
- Cross joining is now possible with `how = "cross"` in `$join()` (#310).
- Add license info of all rust crates to `LICENSE.note` (#309).
- With CRAN 0.7.0 release candidate (#308).
- New author accredited, SHIMA Tatsuya (@eitsupi).
- DESCRIPTION revised.

# polars 0.6.1

Expand Down Expand Up @@ -139,7 +142,7 @@ Release date: 2023-02-21. Full Changelog: [v0.4.3...v0.4.5](https://github.com/p
- Customize **extendr** to better support cross Rust-R/R-Rust error handling
- bump extendr_api by @sorhawell in #44
- Str even more by @sorhawell in #47
- **rpolars** is now available for install from [rpolars.r-universe.dev](https://rpolars.r-universe.dev/rpolars#install) @eitsupi
- **rpolars** is now available for install from [rpolars.r-universe.dev](https://rpolars.r-universe.dev/polars#install) @eitsupi
- advertise R-universe by @sorhawell in #39
- Includes reasonably easy pre-compiled installation for arm64-MacBooks
- All string Expressions available
Expand Down
8 changes: 7 additions & 1 deletion R/Field.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,18 @@ pl$Field = function(name, datatype) {
#' @examples
#' print(pl$Field("foo", pl$List(pl$UInt64)))
print.RField = function(x, ...) {
cat("")
x$print()
invisible(x)
}


#' @title auto complete $-access into a polars object
#' @description called by the interactive R session internally
#' @param x string name of an RField
#' @param pattern code-stump as string to auto-complete
#' @export
#' @inherit .DollarNames.DataFrame return
#' @keywords internal
.DollarNames.RField = function(x, pattern = "") {
get_method_usages(RField, pattern = pattern)
}
Expand Down
108 changes: 86 additions & 22 deletions R/after-wrappers.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
## after-wrappers.R
## THIS FILE IS SOURCED IMMEDIATELY AFTER extendr-wrappers.R . THIS FILE EXTENDS THE BEHAVIOUR
## OF EXTENDR-CLASS-SYSTEM WITH:
## 1. SEPARATE PRIVATE (.pr$) AND PUBLIC (pl$) METHODS/FUNCTIONS
## 2. ADD INTERNAL PROFILER, pl$set_polars_options(debug_polars = TRUE)
## 3. ADD build_debug_print TO DEBUG CLASS CONSTRUCTION DURING PACKAGE BUILDTIME (rarely used)
## 4. ADD BETTER METHOD LOOKUP ERR MSGS macro_add_syntax_check_to_class(), HELPS END USER
## 5. ADD OPTION TO FLAG A METHOD TO BEHAVE LIKE A PROPERTY method_as_property()


# Build time options
build_debug_print = FALSE

#' extendr methods into pure functions
#'
#' @noRd
#' @param env environment object output from extendr-wrappers.R classes
#' @param class_name optional class string, only used for debug printing
#' Default NULL, will infer class_name automatically
Expand Down Expand Up @@ -31,6 +41,7 @@ extendr_method_to_pure_functions = function(env, class_name = NULL) {

#' get private method from Class
#' @details This method if polars_optenv$debug_polars == TRUE will print what methods are called
#' @noRd
#' @export
#' @keywords internal
"$.private_polars_env" = function(self, name) {
Expand All @@ -50,15 +61,21 @@ extendr_method_to_pure_functions = function(env, class_name = NULL) {
#' @title polars-API: private calls to rust-polars
#' @description `.pr`
#' Original extendr bindings converted into pure functions
#' @details
#' .pr gives access to all private methods of package polars. Use at own discretion.
#' The polars package may introduce breaking changes to any private method in a patch with no
#' deprecation warning. Most private methods takes `self` as a first argument, the object the
#' method should be called upon.
#' @aliases .pr
#' @keywords internal api_private
#' @return not applicable
#' @export
#' @examples
#' # .pr$DataFrame$print() is an external function where self is passed as arg
#' polars:::.pr$DataFrame$print(self = pl$DataFrame(iris))
#' @keywords internal
#' @examples
#' polars:::print_env(.pr, ".pr the collection of private method calls to rust-polars")
#' .pr$DataFrame$print(self = pl$DataFrame(iris))
#'
#' # show all content of .pr
#' .pr$print_env(.pr, ".pr the collection of private method calls to rust-polars")
.pr = new.env(parent = emptyenv())
.pr$Series = extendr_method_to_pure_functions(Series)
.pr$DataFrame = extendr_method_to_pure_functions(DataFrame)
Expand All @@ -78,17 +95,24 @@ extendr_method_to_pure_functions = function(env, class_name = NULL) {
.pr$RNullValues = extendr_method_to_pure_functions(RNullValues)
.pr$RPolarsErr = extendr_method_to_pure_functions(RPolarsErr)

# TODO remove export


# add package environment to .pr, this can be used as replacement for :::, where cran does not
# allow that. Ok use :
# - internal documentation (noRd) to show case inner workings of code.
# - unit tests, which needs to verify an internal state.
.pr$env = getNamespace("polars")
.pr$print_env = print_env

## this macro must be defined now

#' @title add syntax verification to class

##### ----- MACROS used at package build time

#' @title add syntax verification to a class
#' @include utils.R
#' @param Class_name string name of env class
#' @rdname macro_add_syntax_check_to
#'
#' @noRd
#' @keywords internal
#' @return dollarsign method with syntax verification
#'
Expand Down Expand Up @@ -139,6 +163,7 @@ if (build_debug_print) cat("\n")

#' Give a class method property behavior
#' @description Internal function, see use in source
#' @noRd
#' @param f a function
#' @param setter bool, if true a property method can be modified by user
#' @keywords internal
Expand All @@ -165,29 +190,61 @@ method_as_property = function(f, setter = FALSE) {
#' @keywords api
#' @details If someone do not particularly like the letter combination `pl`, they are free to
#' bind the environment to another variable name as `simon_says = pl` or even do `attach(pl)`
#'
#' @return not applicable
#' @export
#' @examples
#' # how to use polars via `pl`
#' pl$col("colname")$sum() / pl$lit(42L) # expression ~ chain-method / literal-expression
#'
#' # pl inventory
#' polars:::print_env(pl, "polars public functions")
#'
#' # all accessible classes and their public methods
#' polars:::print_env(
#' polars:::pl_pub_class_env,
#' "polars public class methods, access via object$method()"
#' )
#' # show all public functions, RPolarsDataTypes, classes and methods
#' pl$show_all_public_functions()
#' pl$show_all_public_methods()
pl = new.env(parent = emptyenv())

class(pl) = c("pl_polars_env", "environment")


#' show all public functions / objects
#' @name show_all_public_functions
#' @description print any object(function, RPolarsDataType) available via `pl$`.
#' @return NULL
#' @keywords functions
#' @examples
#' pl$show_all_public_functions()
pl$show_all_public_functions = function() {
print_env(pl, "polars public functions via pl$...")
}

#' show all public methods
#' @name show_all_public_methods
#' @description methods are listed by their Class
#' @param class_names character vector of polars class names to show, Default NULL is all.
#' @return NULL
#' @keywords functions
#' @examples
#' pl$show_all_public_methods()
pl$show_all_public_methods = function(class_names = NULL) {

#subset classes to show
show_this_env = if(!is.null(class_names)) {
as.environment(mget(class_names, envir = pl_pub_class_env))
} else {
pl_pub_class_env
}

print_env(
show_this_env,
paste(
paste(class_names, collapse = ", "),
"class methods, access via object$method()"
)
)
}

#' get public function from pl namespace/env
#' @details This method if polars_optenv$debug_polars == TRUE will print what methods are called
#' @return an element from the public namespace `pl` polars. Likely a function or an RPolarsDataType
#' @export
#' @noRd
#' @keywords internal
"$.pl_polars_env" = function(self, name) {
# print called private class in debug mode
Expand Down Expand Up @@ -218,18 +275,25 @@ pl_pub_class_env = as.environment(mget(pl_class_names, envir = pl_pub_env))


#' @title Any polars class object is made of this
#' @name polars_class_object
#' @description One SEXP of Rtype: "externalptr" + a class attribute
#' @keywords api_object
#'
#' @details
#' - `object$method()` calls are facilitated by a `$.ClassName`- s3method see 'R/after-wrappers.R'
#' - Code completion is facilitated by `.DollarNames.ClassName`-s3method see e.g. 'R/dataframe__frame.R'
#' - Implementation of property-methods as DataFrame_columns() and syntax checking is an extension to `$.ClassName`
#' See function macro_add_syntax_check_to_class().
#'
#' @importFrom utils .DollarNames
#' @return not applicable
#' @examples
#' # all a polars object is made of:
#' # all a polars object is only made of:
#' some_polars_object = pl$DataFrame(iris)
#' str(some_polars_object) # External Pointer tagged with a class attribute.
object = "place_holder"
#'
#' # All state is stored on rust side.
#'
#' # The single exception from the rule is class "GroupBy", where objects also have
#' # two private attributes "groupby_input" and "maintain_order".
#' str(pl$DataFrame(iris)$groupby("Species"))
NULL
10 changes: 6 additions & 4 deletions R/autocompletion.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Extra polars auto completion
#' @param activate bool default TRUE, enable chained auto-completion
#' @name extra_auto_completion
#' @return NULL
#' @return invisible NULL
#'
#' @details polars always supports auto completion via .DollarNames.
#' However chained methods like x$a()$b()$? are not supported vi .DollarNames.
Expand Down Expand Up @@ -32,12 +32,14 @@ pl$extra_auto_completion = function(activate = TRUE) {
rc.options("custom.completer" = NULL)
# function running base auto complete.
# It will dump suggestion into mutable .CompletionEnv$comps
utils:::.completeToken()
.completeToken = utils::getFromNamespace(".completeToken", "utils")
.completeToken()

rc.options("custom.completer" = f)

# get line buffer
CE = utils:::.CompletionEnv
.CompletionEnv = utils::getFromNamespace(".CompletionEnv", "utils")
CE = .CompletionEnv
lb = CE$linebuffer

# skip custom completion if token completion already yielded suggestions.
Expand All @@ -51,7 +53,7 @@ pl$extra_auto_completion = function(activate = TRUE) {
last_char = substr(lb, nchar(lb), nchar(lb))
if (last_char == "$" && nchar(lb) > 1L) {
x = eval(parse(text = substr(lb, 1, nchar(lb) - 1)))
if (inherits(x, c(polars:::pl_class_names, "method_environment"))) {
if (inherits(x, c(pl_class_names, "method_environment"))) {
your_comps = .DollarNames(x)
# append your suggestions to the vanilla suggestions/completions
CE$comps = c(your_comps, CE$comps)
Expand Down
Loading