Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Aug 6, 2024
1 parent 854f7a1 commit 4259085
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 9 deletions.
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidync
Title: A Tidy Approach to 'NetCDF' Data Exploration and Extraction
Version: 0.3.1
Version: 0.4.0
Authors@R: c(person("Michael", "Sumner", email = "[email protected]", role = c("aut", "cre")),
person("Simon", "Wotherspoon", role = "ctb"),
person("Tomas", "Remenyi", role = "ctb"),
Expand All @@ -9,7 +9,8 @@ Authors@R: c(person("Michael", "Sumner", email = "[email protected]", role = c(
person("Tim", "Lucas", role = "ctb"),
person("Hadley", "Wickham", role = "ctb"),
person("Adrian", "Odenweller", role = "ctb"),
person("Patrick", "Van Laake", role = "ctb"))
person("Patrick", "Van Laake", role = "ctb"),
person("Fabian", "Bernhard", role = "ctb"))
Description: Tidy tools for 'NetCDF' data sources. Explore the contents of a
'NetCDF' source (file or URL) presented as variables organized by grid with a
database-like interface. The hyper_filter() interactive function translates the
Expand All @@ -31,8 +32,8 @@ Imports:
rlang,
tibble,
tidyr,
CFtime
RoxygenNote: 7.2.2
CFtime (>= 1.4.0)
RoxygenNote: 7.3.1
Suggests: ggplot2,
knitr,
rmarkdown,
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method("active<-",default)
S3method("active<-",tidync)
S3method(activate,default)
S3method(activate,tidync)
S3method(active,default)
Expand Down Expand Up @@ -55,5 +56,3 @@ importFrom(rlang,.data)
importFrom(stats,setNames)
importFrom(tibble,as_tibble)
importFrom(utils,head)
importFrom(CFtime,CFtime)
importFrom(CFtime,as_timestamp)
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# tidync dev

* Update to CFTime as_timestamp(), thanks to @fabern.

* Support for CF time metadata via package CFtime thanks to @pvanlaake, see https://github.com/ropensci/tidync/pull/124

* Suppress ncdf4 warnings on open, issue #119.
Expand Down
2 changes: 2 additions & 0 deletions R/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ activate.tidync <- function(.data, what, ..., select_var = NULL) {
active.tidync <- function(x) {
attr(x, 'active')
}

#' @export
`active<-.tidync` <- function(x, value) {
#vn <- var_names(x)
sn <- unique(x$grid$grid)
Expand Down
6 changes: 5 additions & 1 deletion R/netcdf-utils.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#' @importFrom ncdf4 nc_open nc_close ncvar_get
#' @importFrom RNetCDF open.nc close.nc var.get.nc
#' @importFrom purrr safely
#' @noRd
nc_get <- function(x, v, test = FALSE, ...) {
UseMethod("nc_get")
}
#' @noRd
nc_get.character <- function(x, v, test = FALSE, ...) {
if (!test) {
con <- RNetCDF::open.nc(x)
Expand All @@ -30,11 +32,13 @@ nc_get.character <- function(x, v, test = FALSE, ...) {
}
stop(sprintf("no variable found %s", v))
}

#' @noRd
nc_get.NetCDF <- function(x, v) {
RNetCDF::var.get.nc(x, v)
}


#' @noRd
nc_get.ncdf4 <- function(x, v) {
ncdf4::ncvar_get(x, v)
}
4 changes: 3 additions & 1 deletion R/tidync-package.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#' @keywords internal
"_PACKAGE"

#' Tidy tools for NetCDF data.
#'
#' Provides easy to use idioms for working with NetCDF data for extraction,
Expand Down Expand Up @@ -31,7 +34,6 @@
#' \code{tidync.silent = FALSE/TRUE} \tab emit warnings,messages or be silent (default `FALSE`) \cr
#' }
#' @name tidync-package
#' @docType package
#' @examples
#' argofile <- system.file("extdata/argo/MD5903593_001.nc", package = "tidync")
#' argo <- tidync(argofile)
Expand Down
30 changes: 29 additions & 1 deletion man/tidync-package.Rd

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

0 comments on commit 4259085

Please sign in to comment.