Skip to content

Commit

Permalink
Merge pull request #22 from TidierOrg/export_not_vectorized
Browse files Browse the repository at this point in the history
  • Loading branch information
Karandeep Singh committed Aug 6, 2023
2 parents a6ba718 + 8dbf525 commit 5600778
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# TidierData.jl updates

## v0.9.1 - 2023-08-06
- Export `TidierData_not_vectorized[]` to make it easier for other packages to access it

## v0.9.0 - 2023-08-04
- Exposed `not_vectorized[]` as a package global variable so that the user or other packages can modify it
- Added `@separate`, `@unite`, and `@summary`
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TidierData"
uuid = "fe2206b3-d496-4ee9-a338-6a095c4ece80"
authors = ["Karandeep Singh"]
version = "0.9.0"
version = "0.9.1"

[deps]
Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc"
Expand Down
2 changes: 2 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ nav:
- "Joins" : "examples/generated/UserGuide/joins.md"
- "Binding" : "examples/generated/UserGuide/binding.md"
- "Pivoting": "examples/generated/UserGuide/pivots.md"
- "Separating" : "examples/generated/UserGuide/sep_unite.md"
- "@summary" : "examples/generated/UserGuide/summary.md"
- "Column names": "examples/generated/UserGuide/column_names.md"
- "Interpolation" : "examples/generated/UserGuide/interpolation.md"
- "Auto-vectorization" : "examples/generated/UserGuide/autovec.md"
Expand Down
4 changes: 2 additions & 2 deletions src/TidierData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export TidierData_set, across, desc, n, row_number, starts_with, ends_with, matc
as_float, as_integer, as_string, @select, @transmute, @rename, @mutate, @summarize, @summarise, @filter,
@group_by, @ungroup, @slice, @arrange, @distinct, @pull, @left_join, @right_join, @inner_join, @full_join,
@pivot_wider, @pivot_longer, @bind_rows, @bind_cols, @clean_names, @count, @tally, @drop_na, @glimpse, @separate,
@unite, @summary
@unite, @summary, TidierData_not_vectorized

# Package global variables
const code = Ref{Bool}(false) # output DataFrames.jl code?
const log = Ref{Bool}(false) # output tidylog output? (not yet implemented)

# Expose the global do-not-vectorize "list"
const not_vectorized = Ref{Vector{Symbol}}([:Ref, :Set, :Cols, :(:), :, :lag, :lead, :ntile, :repeat, :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :cumsum, :cumprod, :accumulate])
const TidierData_not_vectorized = Ref{Vector{Symbol}}([:Ref, :Set, :Cols, :(:), :, :lag, :lead, :ntile, :repeat, :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :cumsum, :cumprod, :accumulate])

# Includes
include("docstrings.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ function parse_autovec(tidy_expr::Union{Expr,Symbol})
elseif @capture(x, fn_(args__))
# This is the do-not-vectorize "list"
# `in` should be vectorized so do not add to this exclusion list
if fn in not_vectorized[]
if fn in TidierData_not_vectorized[]
return x
elseif contains(string(fn), r"[^\W0-9]\w*$") # valid variable name
return :($fn.($(args...)))
Expand Down

2 comments on commit 5600778

@kdpsingh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/89144

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.1 -m "<description of version>" 56007783ff6a857b28af182c284c3ede991d41aa
git push origin v0.9.1

Please sign in to comment.