Skip to content

Commit ad7358e

Browse files
authored
Merge pull request #32 from databio/dev
Release PR for v 0.4.0
2 parents 137a9ed + f70f195 commit ad7358e

32 files changed

+625
-201
lines changed

.Rbuildignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
^\.travis\.yml$
44
^cran-comments.md$
55
^CONDUCT\.md$
6-
^paper$
6+
^paper$
7+
.github
8+
^_pkgdown\.yaml$

.github/CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# CONTRIBUTING #
2+
3+
### Please contribute!
4+
5+
We love collaboration.
6+
7+
### Bugs?
8+
9+
* Submit an issue on the [Issues page](https://github.com/databio/simpleCache/issues)
10+
11+
### Code contributions
12+
13+
* Fork this repo to your Github account
14+
* Clone your version on your account down to your machine from your account, e.g,. `git clone https://github.com/databio/simpleCache.git`
15+
* Make sure to track progress upstream (i.e., on our version of `simpleCache` at `databio/simpleCache`) by doing `git remote add upstream https://github.com/databio/simpleCache.git`. Before making changes make sure to pull changes in from upstream by doing either `git fetch upstream` then merge later or `git pull upstream` to fetch and merge in one step
16+
* Make your changes (bonus points for making changes on a new feature branch)
17+
* Push up to your account
18+
* Submit a pull request to home base (likely master branch, but check to make sure) at `databio/simpleCache`
19+
20+
### Thanks for contributing!

.github/issue_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- If this issue relates to usage of the package, whether a question, bug or similar, along with your query, please paste your devtools::session_info() or sessionInfo() into the code block below, AND include a reproducible example. If not, delete all this and proceed :) -->
2+
3+
<details> <summary><strong>Session Info</strong></summary>
4+
5+
```r
6+
7+
```
8+
</details>

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Related Issue
7+
<!--- if this closes an issue make sure include e.g., "fix #4"
8+
or similar - or if just relates to an issue make sure to mention
9+
it like "#4" -->
10+
11+
## Example
12+
<!--- if introducing a new feature or changing behavior of existing
13+
methods/functions, include an example if possible to do in brief form -->
14+
15+
<!--- Did you remember to include tests? Unless you're just changing
16+
grammar, please include new tests for your change -->

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: simpleCache
2-
Version: 0.3.1
2+
Version: 0.4.0
33
Date: 2017-08-21
44
Title: Simply Caching R Objects
55
Description: Provides intuitive functions for caching R objects, encouraging
@@ -13,14 +13,13 @@ Description: Provides intuitive functions for caching R objects, encouraging
1313
Authors@R: c(person("VP", "Nagraj", email = "[email protected]", role =
1414
c("aut")), person("Nathan", "Sheffield", email = "[email protected]",
1515
role = c("aut", "cre")))
16-
Maintainer: Nathan Sheffield <[email protected]>
1716
Suggests:
1817
knitr,
1918
testthat
2019
Enhances: batchtools
2120
VignetteBuilder: knitr
2221
License: BSD_2_clause + file LICENSE
2322
Encoding: UTF-8
24-
URL: http://www.github.com/databio/simpleCache
25-
BugReports: http://www.github.com/databio/simpleCache
23+
URL: https://www.github.com/databio/simpleCache
24+
BugReports: https://www.github.com/databio/simpleCache
2625
RoxygenNote: 6.0.1.9000

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export(setCacheDir)
1010
export(setSharedCacheDir)
1111
export(simpleCache)
1212
export(simpleCacheGlobal)
13+
export(simpleCacheOptions)
1314
export(simpleCacheShared)
1415
export(simpleCacheSharedGlobal)
1516
export(storeCache)
16-
export(viewCacheDirs)

NEWS

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,31 @@
11
# Change log
22
All notable changes to this project will be documented in this file.
33

4+
## [0.4.0] -- Unreleased
5+
6+
- adds a lifespan arg to simpleCache() to create auto-expiring caches
7+
- remove unnecessary parse argument to simpleCache()
8+
- viewCacheDirs() renamed to simpleCacheOptions()
9+
10+
## [0.3.1] -- 2017-08-21
11+
12+
- fixed a bug in unit tests that left behind a test cache in user home dir.
13+
- changes cache building to happen in parent.frame()
14+
- repaired vignette so R code is displayed properly
15+
- added deleteCaches() function and docs
16+
- reduced size of unit test cache for speed increase
17+
418
## [0.3.0] -- 2017-08-21
519

6-
- Switched default cache dir to tempdir()
20+
- switched default cache dir to tempdir()
721
- changed availCaches() to listCaches()
8-
- changes cache building to happen in parent.frame(), so that any loaded
22+
- changes cache building to happen in globalenv(), so that any loaded
923
packages are available for cache building
1024

1125

1226
## [0.2.1] -- 2017-07-30
1327

14-
- Added examples
28+
- added examples
1529

1630
## [0.2.0] -- 2017-07-30
1731

@@ -20,4 +34,4 @@ All notable changes to this project will be documented in this file.
2034

2135
## [0.0.1]
2236

23-
- Long-term stable version
37+
- long-term stable version

R/cacheDirectories.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# caches.
77

88
#' Sets a global variable specifying the default cache directory for
9-
#' simpleCache() calls.
9+
#' \code{\link{simpleCache}} calls.
1010
#'
1111
#' @param cacheDir Directory where caches should be stored
1212
#' @export
@@ -19,7 +19,7 @@ setCacheDir = function(cacheDir) {
1919
#' Set shared cache directory
2020
#'
2121
#' Sets global variable specifying the default cache directory for
22-
#' simpleCacheShared() calls; this function is simply a helper alias for caching
22+
#' \code{\link{simpleCacheShared}} calls; this function is simply a helper alias for caching
2323
#' results that will be used across projects.
2424
#'
2525
#' @param sharedCacheDir Directory where shared caches should be stored
@@ -36,11 +36,11 @@ setCacheBuildDir = function(cacheBuildDir) {
3636
options(RBUILD.DIR=cacheBuildDir)
3737
}
3838

39-
#' View cache directories
39+
#' View simpleCache options
4040
#'
41-
#' Views cache directory global variables
41+
#' Views simpleCache global variables
4242
#' @export
43-
viewCacheDirs = function() {
43+
simpleCacheOptions = function() {
4444
message("RESOURCES.RCACHE:\t", getOption("RESOURCES.RCACHE"))
4545
message("RCACHE.DIR:\t", getOption("RCACHE.DIR"))
4646
message("RBUILD.DIR:\t", getOption("RBUILD.DIR"))
@@ -59,7 +59,7 @@ addCacheSearchEnvironment = function(addEnv) {
5959
options(SIMPLECACHE.ENV=append(addEnv, getOption("SIMPLECACHE.ENV")))
6060
}
6161

62-
#' Sets global option of cache search environments to NULL.
62+
#' Sets global option of cache search environments to \code{NULL}.
6363
#'
6464
#' @export
6565
resetCacheSearchEnvironment = function() {

R/loadCaches.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
#' for stuff you already cached previously, so it won't build any caches.
55
#'
66
#' @param cacheNames Vector of caches to load.
7+
#' @param loadEnvir Environment into which to load each cache.
78
#' @param ... Additional parameters passed to simpleCache.
89
#' @export
910
#' @example
1011
#' R/examples/example.R
11-
loadCaches = function(cacheNames, ...) {
12+
loadCaches = function(cacheNames, loadEnvir=NULL, ...) {
13+
if (is.null(loadEnvir)) { loadEnvir = parent.frame(n=2) }
1214
for (i in 1:length(cacheNames)) {
1315
# By default, load these caches into the environment that
1416
# calls loadCaches (which is the grandparent, n=2, of the call to
1517
# simpleCache.
16-
simpleCache(cacheNames[i], loadEnvir=parent.frame(n=2), ...)
18+
simpleCache(cacheNames[i], loadEnvir=loadEnvir, ...)
1719
}
1820
}

R/sharedCaches.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#' (instead of the typical default PROJECT directory)
99

1010
#'
11-
#' @param ... Parameters passed to simpleCache().
11+
#' @param ... Parameters passed to \code{\link{simpleCache}}.
1212
#' @export
1313
simpleCacheShared = function(...) {
1414
# Since this is a function calling this, I have to set the loadEnvir here,
@@ -22,15 +22,15 @@ simpleCacheShared = function(...) {
2222
#' simpleCache normally loads variables into the calling environment; this
2323
#' ensures that the variables are loaded in the global environment.
2424
#'
25-
#' @param ... Parameters passed to simpleCache().
25+
#' @param ... Parameters passed to \code{\link{simpleCache}}.
2626
#' @export
2727
simpleCacheGlobal = function(...) {
2828
simpleCache(..., loadEnvir=globalenv())
2929
}
3030

3131
#' Helper alias for loading shared caches into the global environment.
3232
#'
33-
#' @param ... Parameters passed to simpleCache().
33+
#' @param ... Parameters passed to \code{\link{simpleCache}}.
3434
#' @export
3535
simpleCacheSharedGlobal = function(...) {
3636
simpleCache(..., cacheDir=getOption("RESOURCES.RCACHE"), loadEnvir=globalenv())

0 commit comments

Comments
 (0)