diff --git a/DESCRIPTION b/DESCRIPTION index b66f520..b56c8c0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -33,7 +33,7 @@ Imports: tibble, tidyr, CFtime (>= 1.4.0) -RoxygenNote: 7.3.1 +RoxygenNote: 7.3.2 Suggests: ggplot2, knitr, rmarkdown, diff --git a/README.Rmd b/README.Rmd index c756b5f..6d4fc17 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,9 +17,10 @@ knitr::opts_chunk$set( # tidync -[![](https://badges.ropensci.org/174_status.svg)](https://github.com/ropensci/software-review/issues/174) [![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidync)](https://cran.r-project.org/package=tidync) -[![CRAN_Download_Badge](http://cranlogs.r-pkg.org/badges/tidync)](https://cran.r-project.org/package=tidync) -[![R-CMD-check](https://github.com/ropensci/tidync/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tidync/actions) +[![](https://badges.ropensci.org/174_status.svg)](https://github.com/ropensci/software-review/issues/174) +[![CRAN status](https://www.r-pkg.org/badges/version/tidync)](https://CRAN.R-project.org/package=tidync) + +[![R-CMD-check](https://github.com/ropensci/tidync/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/tidync/actions/workflows/R-CMD-check.yaml) diff --git a/README.md b/README.md index 46db39b..f9f3f4a 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ [![](https://badges.ropensci.org/174_status.svg)](https://github.com/ropensci/software-review/issues/174) -[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidync)](https://cran.r-project.org/package=tidync) -[![CRAN_Download_Badge](http://cranlogs.r-pkg.org/badges/tidync)](https://cran.r-project.org/package=tidync) -[![R-CMD-check](https://github.com/ropensci/tidync/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/tidync/actions) +[![CRAN +status](https://www.r-pkg.org/badges/version/tidync)](https://CRAN.R-project.org/package=tidync) + +[![R-CMD-check](https://github.com/ropensci/tidync/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ropensci/tidync/actions/workflows/R-CMD-check.yaml) The goal of tidync is to ease exploring the contents of a NetCDF source @@ -19,11 +20,11 @@ data frame. In contrast to other packages tidync helps reduce the volume of code required to discover and read the contents of NetCDF, with simple steps: -- Connect and summarize `tidync()`. -- (optionally) Specify source variables `activate()`. -- (optionally) Specify array sub-setting (slicing) `hyper_filter()`. -- Read array data in native form `hyper_array()` or long-form - `hyper_tibble()` or bespoke form `hyper_tbl_cube()`. +- Connect and summarize `tidync()`. +- (optionally) Specify source variables `activate()`. +- (optionally) Specify array sub-setting (slicing) `hyper_filter()`. +- Read array data in native form `hyper_array()` or long-form + `hyper_tibble()` or bespoke form `hyper_tbl_cube()`. NetCDF is **Network Common Data Form** a very common, and very general way to store and work with scientific array-based data. NetCDF is @@ -130,10 +131,11 @@ tidync(file) #> #> Dimensions 4 (2 active): #> -#> dim name length min max start count dmin dmax unlim coord_dim -#> -#> 1 D0 lat 2160 -90.0 90.0 1 2160 -90.0 90.0 FALSE TRUE -#> 2 D1 lon 4320 -180. 180. 1 4320 -180. 180. FALSE TRUE +#> dim name length min max start count dmin dmax unlim +#> +#> 1 D0 lat 2160 -89.958 89.958 1 2160 -89.958 89.958 FALSE +#> 2 D1 lon 4320 -179.96 179.96 1 4320 -179.96 179.96 FALSE +#> # ℹ 1 more variable: coord_dim #> #> Inactive dimensions: #> @@ -206,6 +208,9 @@ tidync(filename) #> 10 D11 N_CALIB 1 1 1 FALSE FALSE #> 11 D12 N_HISTORY 0 NA NA TRUE FALSE #> 12 D13 N_VALUES41 41 NA NA FALSE FALSE +``` + +``` r ## activate a different grid grid_identifier <- "D7,D9,D11,D8" @@ -255,6 +260,9 @@ tidync(filename) %>% activate(grid_identifier) #> 8 D10 N_LEVELS 493 1 493 FALSE FALSE #> 9 D12 N_HISTORY 0 NA NA TRUE FALSE #> 10 D13 N_VALUES41 41 NA NA FALSE FALSE +``` + +``` r ## pass named expressions to subset dimension by value or index (step) (subs <- tidync(filename) %>% hyper_filter(N_PROF = N_PROF > 1, STRING256 = index > 10)) @@ -305,36 +313,42 @@ tidync(filename) %>% activate(grid_identifier) #> 10 D11 N_CALIB 1 1 1 FALSE FALSE #> 11 D12 N_HISTORY 0 NA NA TRUE FALSE #> 12 D13 N_VALUES41 41 NA NA FALSE FALSE +``` + +``` r ## with the saved filtering from above, choose data frame or tbl_cube output ## optionally with only selected variables subs %>% hyper_tibble() -#> # A tibble: 493 × 37 -#> PRES PRES_QC PRES_AD…¹ PRES_…² PRES_…³ TEMP TEMP_QC TEMP_…⁴ TEMP_…⁵ TEMP_…⁶ -#> -#> 1 7.70 1 7.79 1 2.40 13.2 1 13.2 1 0.00200 -#> 2 11.8 1 11.9 1 2.40 13.2 1 13.2 1 0.00200 -#> 3 16.3 1 16.4 1 2.40 13.2 1 13.2 1 0.00200 -#> 4 21.6 1 21.7 1 2.40 13.2 1 13.2 1 0.00200 -#> 5 26.7 1 26.8 1 2.40 13.2 1 13.2 1 0.00200 -#> 6 31.7 1 31.8 1 2.40 13.2 1 13.2 1 0.00200 -#> 7 36.6 1 36.7 1 2.40 13.2 1 13.2 1 0.00200 -#> 8 41.4 1 41.5 1 2.40 13.2 1 13.2 1 0.00200 -#> 9 46.5 1 46.6 1 2.40 13.2 1 13.2 1 0.00200 -#> 10 51.8 1 51.9 1 2.40 13.2 1 13.2 1 0.00200 -#> # … with 483 more rows, 27 more variables: PSAL , PSAL_QC , -#> # PSAL_ADJUSTED , PSAL_ADJUSTED_QC , PSAL_ADJUSTED_ERROR , -#> # DOXY , DOXY_QC , DOXY_ADJUSTED , DOXY_ADJUSTED_QC , -#> # DOXY_ADJUSTED_ERROR , CHLA , CHLA_QC , CHLA_ADJUSTED , -#> # CHLA_ADJUSTED_QC , CHLA_ADJUSTED_ERROR , BBP700 , -#> # BBP700_QC , BBP700_ADJUSTED , BBP700_ADJUSTED_QC , -#> # BBP700_ADJUSTED_ERROR , NITRATE , NITRATE_QC , … +#> # A tibble: 493 × 35 +#> PRES PRES_QC PRES_ADJUSTED PRES_ADJUSTED_QC PRES_ADJUSTED_ERROR TEMP +#> +#> 1 7.7000 1 7.7900 1 2.4000 13.184 +#> 2 11.800 1 11.890 1 2.4000 13.184 +#> 3 16.300 1 16.390 1 2.4000 13.184 +#> 4 21.600 1 21.690 1 2.4000 13.184 +#> 5 26.700 1 26.790 1 2.4000 13.186 +#> 6 31.700 1 31.790 1 2.4000 13.186 +#> 7 36.600 1 36.690 1 2.4000 13.187 +#> 8 41.400 1 41.490 1 2.4000 13.187 +#> 9 46.5 1 46.590 1 2.4000 13.187 +#> 10 51.800 1 51.890 1 2.4000 13.187 +#> # ℹ 483 more rows +#> # ℹ 29 more variables: TEMP_QC , TEMP_ADJUSTED , +#> # TEMP_ADJUSTED_QC , TEMP_ADJUSTED_ERROR , PSAL , +#> # PSAL_QC , PSAL_ADJUSTED , PSAL_ADJUSTED_QC , +#> # PSAL_ADJUSTED_ERROR , DOXY , DOXY_QC , DOXY_ADJUSTED , +#> # DOXY_ADJUSTED_QC , DOXY_ADJUSTED_ERROR , CHLA , +#> # CHLA_QC , CHLA_ADJUSTED , CHLA_ADJUSTED_QC , … +``` + +``` r subs %>% hyper_tbl_cube(select_var = c("PRES", "PRES_QC", "PSAL_ADJUSTED")) #> $mets #> Class: tidync_data (list of tidync data arrays) #> Variables (3): 'PRES', 'PRES_QC', 'PSAL_ADJUSTED' -#> Dimension (1): N_LEVELS,N_PROF (493) -#> Source: /perm_storage/home/mdsumner/R/x86_64-pc-linux-gnu-library/4.2/tidync/extdata/argo/MD5903593_001.nc +#> Dimension (0): N_LEVELS,N_PROF () +#> Source: /perm_storage/home/mdsumner/R/x86_64-pc-linux-gnu-library/4.4/tidync/extdata/argo/MD5903593_001.nc #> #> $dims #> $dims$N_LEVELS @@ -409,10 +423,13 @@ frame or raw-array (hyper slice) form. tidync(filename) %>% activate("JULD") %>% hyper_filter(N_PROF = N_PROF == 1) %>% hyper_tibble() -#> # A tibble: 1 × 2 -#> JULD N_PROF -#> -#> 1 22719. 1 +#> # A tibble: 1 × 1 +#> JULD +#> +#> 1 22719. +``` + +``` r ## native array form, we'll see a (list of) R arrays with a dimension for @@ -422,8 +439,8 @@ tidync(filename) %>% activate("JULD") %>% hyper_array() #> Class: tidync_data (list of tidync data arrays) #> Variables (1): 'JULD' -#> Dimension (1): N_PROF (1) -#> Source: /perm_storage/home/mdsumner/R/x86_64-pc-linux-gnu-library/4.2/tidync/extdata/argo/MD5903593_001.nc +#> Dimension (0): N_PROF () +#> Source: /perm_storage/home/mdsumner/R/x86_64-pc-linux-gnu-library/4.4/tidync/extdata/argo/MD5903593_001.nc ``` It’s important to not actual request the data extraction until the @@ -448,12 +465,12 @@ browseVignettes(package = "tidync") Please get in touch if you have specific workflows that `tidync` is not providing. There’s a lot of room for improvement! -- we can’t do “grouped filters”” (i.e. polygon-overlay extraction), - but it’s in the works -- compound types are not supported, though see the “rhdf5” branch on - Github -- NetCDF groups are not exposed (groups are like a “files within a - file”, analogous to a file system directory) +- we can’t do “grouped filters”” (i.e. polygon-overlay extraction), but + it’s in the works +- compound types are not supported, though see the “rhdf5” branch on + Github +- NetCDF groups are not exposed (groups are like a “files within a + file”, analogous to a file system directory) I’m interested in lighter and rawer access to the NetCDF library, I’ve explored that here and it may or may not be a good idea: @@ -462,12 +479,12 @@ explored that here and it may or may not be a good idea: ## Terminology -- **slab**, **hyperslab** - array variable that may be read from a - NetCDF -- **shape**, **grid** - set of dimensions that define variables in - NetCDF -- **activation** - choice of a given grid to apply subsetting and read - operations to +- **slab**, **hyperslab** - array variable that may be read from a + NetCDF +- **shape**, **grid** - set of dimensions that define variables in + NetCDF +- **activation** - choice of a given grid to apply subsetting and read + operations to ------------------------------------------------------------------------ diff --git a/codemeta.json b/codemeta.json deleted file mode 100644 index ca7e8b2..0000000 --- a/codemeta.json +++ /dev/null @@ -1,281 +0,0 @@ -{ - "@context": [ - "https://doi.org/10.5063/schema/codemeta-2.0", - "http://schema.org" - ], - "@type": "SoftwareSourceCode", - "identifier": "tidync", - "description": "Tidy tools for 'NetCDF' data sources. Explore the contents of a \n 'NetCDF' source (file or URL) presented as variables organized by grid with a \n database-like interface. The hyper_filter() interactive function translates the \n filter value or index expressions to array-slicing form. No data is read until \n explicitly requested, as a data frame or list of arrays via hyper_tibble() or \n hyper_array(). ", - "name": "tidync: A Tidy Approach to 'NetCDF' Data Exploration and Extraction", - "codeRepository": "https://github.com/ropensci/tidync", - "issueTracker": "https://github.com/ropensci/tidync/issues", - "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.2.1", - "programmingLanguage": { - "@type": "ComputerLanguage", - "name": "R", - "version": "3.6.0", - "url": "https://r-project.org" - }, - "runtimePlatform": "R version 3.6.0 (2019-04-26)", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "author": [ - { - "@type": "Person", - "givenName": "Michael", - "familyName": "Sumner", - "email": "mdsumner@gmail.com" - } - ], - "contributor": [ - { - "@type": "Person", - "givenName": "Simon", - "familyName": "Wotherspoon" - }, - { - "@type": "Person", - "givenName": "Tomas", - "familyName": "Remenyi" - }, - { - "@type": "Person", - "givenName": "Ben", - "familyName": "Raymond" - }, - { - "@type": "Person", - "givenName": "Jakub", - "familyName": "Nowosad" - }, - { - "@type": "Person", - "givenName": "Tim", - "familyName": "Lucas" - } - ], - "copyrightHolder": {}, - "funder": {}, - "maintainer": [ - { - "@type": "Person", - "givenName": "Michael", - "familyName": "Sumner", - "email": "mdsumner@gmail.com" - } - ], - "softwareSuggestions": [ - { - "@type": "SoftwareApplication", - "identifier": "ggplot2", - "name": "ggplot2", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=ggplot2" - }, - { - "@type": "SoftwareApplication", - "identifier": "knitr", - "name": "knitr", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=knitr" - }, - { - "@type": "SoftwareApplication", - "identifier": "rmarkdown", - "name": "rmarkdown", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=rmarkdown" - }, - { - "@type": "SoftwareApplication", - "identifier": "testthat", - "name": "testthat", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=testthat" - }, - { - "@type": "SoftwareApplication", - "identifier": "covr", - "name": "covr", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=covr" - } - ], - "softwareRequirements": [ - { - "@type": "SoftwareApplication", - "identifier": "R", - "name": "R", - "version": ">= 3.5.0" - }, - { - "@type": "SoftwareApplication", - "identifier": "dplyr", - "name": "dplyr", - "version": ">= 0.7.0", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=dplyr" - }, - { - "@type": "SoftwareApplication", - "identifier": "forcats", - "name": "forcats", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=forcats" - }, - { - "@type": "SoftwareApplication", - "identifier": "magrittr", - "name": "magrittr", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=magrittr" - }, - { - "@type": "SoftwareApplication", - "identifier": "ncdf4", - "name": "ncdf4", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=ncdf4" - }, - { - "@type": "SoftwareApplication", - "identifier": "ncmeta", - "name": "ncmeta", - "version": ">= 0.0.4", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=ncmeta" - }, - { - "@type": "SoftwareApplication", - "identifier": "purrr", - "name": "purrr", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=purrr" - }, - { - "@type": "SoftwareApplication", - "identifier": "RNetCDF", - "name": "RNetCDF", - "version": ">= 1.9-1", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=RNetCDF" - }, - { - "@type": "SoftwareApplication", - "identifier": "rlang", - "name": "rlang", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=rlang" - }, - { - "@type": "SoftwareApplication", - "identifier": "tibble", - "name": "tibble", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=tibble" - }, - { - "@type": "SoftwareApplication", - "identifier": "tidyr", - "name": "tidyr", - "provider": { - "@id": "https://cran.r-project.org", - "@type": "Organization", - "name": "Comprehensive R Archive Network (CRAN)", - "url": "https://cran.r-project.org" - }, - "sameAs": "https://CRAN.R-project.org/package=tidyr" - } - ], - "releaseNotes": "https://github.com/ropensci/tidync/blob/master/NEWS.md", - "readme": "https://github.com/ropensci/tidync/blob/master/README.md", - "fileSize": "352.398KB", - "contIntegration": [ - "https://travis-ci.org/ropensci/tidync", - "https://travis-ci.org/ropensci/tidync", - "https://ci.appveyor.com/project/mdsumner/tidync-3m5h7", - "https://codecov.io/github/ropensci/tidync?branch=master" - ], - "developmentStatus": "https://www.tidyverse.org/lifecycle/#maturing", - "review": { - "@type": "Review", - "url": "https://github.com/ropensci/onboarding/issues/174", - "provider": "http://ropensci.org" - }, - "relatedLink": "https://CRAN.R-project.org/package=tidync" -} diff --git a/cran-comments.md b/cran-comments.md index 3c5cc82..d4cff0c 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,20 +1,7 @@ -## tidync 0.3.0 +## tidync 0.4.0 -Hello, update to silence messages from tidync, and fix unused LazyData setting. +Resubmit 0.4.0, very sorry: stray file in first attempt. -Thank you. +## Reverse dependencies -## Test environments -* local Ubuntu -* win-builder (release and devel) - -## R CMD check results - -0 errors | 0 warnings | 0 notes - -## Reverse depencies - -These are passing check with this version. - -* cft -* heatwaveR +cft and heatwaveR both pass check with this version. \ No newline at end of file diff --git a/man/nc_get.Rd b/man/nc_get.Rd index 772dc2c..5f81014 100644 --- a/man/nc_get.Rd +++ b/man/nc_get.Rd @@ -11,7 +11,7 @@ nc_get(x, v, test = FALSE) \item{v}{variable name} -\item{test}{if true we make sure the connection can be open} +\item{test}{if true we make sure the connection can be open, not applied for connections themselves} } \description{ This exists so we can (internally) use a file path, uri, or open