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

Method for cloning local NASIS tables into static SQLite file #154

Merged
merged 6 commits into from
Jan 29, 2021

Conversation

brownag
Copy link
Member

@brownag brownag commented Jan 7, 2021

Running the NASIS validation on the SQLite backend created by createStaticNASIS not 100% there yet, but this has also identified some methods that do not respect the SS argument.

> test <- lapply(fnames, function(fname) {
+     lapply(fname, function(FUN) {
+       message(sprintf("Testing: %s", FUN))
+       try(get(FUN, envir = as.environment("package:soilDB"))(SS = FALSE, static_path = "testStatic.sqlite"))
+     })
+   })
Testing: fetchNASIS
multiple horizontal datums present, consider using WGS84 coordinates (x_std, y_std)
NOTICE: multiple `labsampnum` values / horizons; see pedon IDs:
S1969NE013001,S1980OK015001
mixing dry colors ... [184 of 8169 horizons]
mixing moist colors ... [284 of 8856 horizons]
-> QC: some fragsize_h values == 76mm, may be mis-classified as cobbles [356 / 11859 records]
replacing missing lower horizon depths with top depth + 1cm ... [140 horizons]
top/bottom depths equal, adding 1cm to bottom depth ... [70 horizons]
-> QC: sites without pedons: use `get('sites.missing.pedons', envir=soilDB.env)` for related usersiteid values
-> QC: duplicate pedons: use `get('dup.pedon.ids', envir=soilDB.env)` for related peiid values
-> QC: horizon errors detected, use `get('bad.pedon.ids', envir=soilDB.env)` for related userpedonid values or `get('bad.horizons', envir=soilDB.env)` for related horizon designations
-> QC: pedons missing bottom hz depths: use `get('missing.bottom.depths', envir=soilDB.env)` for related pedon IDs
-> QC: equal hz top and bottom depths: use `get('top.bottom.equal', envir=soilDB.env)` for related pedon IDs
Testing: getHzErrorsNASIS
Error in get(FUN, envir = as.environment("package:soilDB"))(SS = FALSE,  : 
  unused arguments (SS = FALSE, static_path = "testStatic.sqlite")
In addition: Warning messages:
1: some records are missing rock fragment volume, these have been removed 
2: fragment volume >= 100%
phiid:
4081839
677471
932280
932930 
3: some records are missing artifact volume, these have been removed 
4: all records are missing artifact volume (NULL). buffering result with NA. will be converted to zero if nullFragsAreZero = TRUE. 
Testing: get_RMF_from_NASIS_db
Testing: get_colors_from_NASIS_db
mixing dry colors ... [184 of 8169 horizons]
mixing moist colors ... [284 of 8856 horizons]
Testing: get_component_copm_data_from_NASIS_db
Testing: get_lmuaoverlap_from_NASIS
Testing: get_component_horizon_data_from_NASIS_db
Testing: get_component_data_from_NASIS_db
Testing: get_legend_from_NASIS
Testing: get_mutext_from_NASIS_db
Testing: get_comonth_from_NASIS_db
Testing: get_mapunit_from_NASIS
Testing: get_component_diaghz_from_NASIS_db
Testing: get_component_correlation_data_from_NASIS_db
Testing: get_copedon_from_NASIS_db
some linked pedons not in selected set or local database
Testing: get_component_otherveg_data_from_NASIS_db
Testing: get_component_restrictions_from_NASIS_db
Testing: get_component_cogeomorph_data_from_NASIS_db
Testing: get_component_esd_data_from_NASIS_db
Testing: get_concentrations_from_NASIS_db
Testing: get_cosoilmoist_from_NASIS
Error in get(FUN, envir = as.environment("package:soilDB"))(SS = FALSE,  : 
  unused argument (SS = FALSE)
Testing: get_extended_data_from_NASIS_db
-> QC: some fragsize_h values == 76mm, may be mis-classified as cobbles [356 / 11859 records]
Testing: get_hz_data_from_NASIS_db
NOTICE: multiple `labsampnum` values / horizons; see pedon IDs:
S1969NE013001,S1980OK015001
Testing: get_lablayer_data_from_NASIS_db
Testing: get_labpedon_data_from_NASIS_db
Testing: get_phfmp_from_NASIS_db
Testing: get_projectmapunit_from_NASIS
Testing: get_site_data_from_NASIS_db
multiple horizontal datums present, consider using WGS84 coordinates (x_std, y_std)
Testing: get_text_notes_from_NASIS_db
Testing: get_veg_data_from_NASIS_db
Testing: get_vegplot_location_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
In addition: Warning messages:
1: some records are missing rock fragment volume, these have been removed 
2: fragment volume >= 100%
phiid:
4081839
677471
932280
932930 
3: some records are missing artifact volume, these have been removed 
4: all records are missing artifact volume (NULL). buffering result with NA. will be converted to zero if nullFragsAreZero = TRUE. 
5: In order to query this data you'll need to load all related vegplots to your sites and pedons in NASIS. 
Testing: get_vegplot_tree_si_details_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_species_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_transpecies_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_tree_si_summary_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_textnote_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_trhi_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: get_vegplot_transect_from_NASIS_db
Error in as.character(x) : 
  cannot coerce type 'closure' to vector of type 'character'
Testing: local_NASIS_defined
Error in get(FUN, envir = as.environment("package:soilDB"))(SS = FALSE,  : 
  unused arguments (SS = FALSE, static_path = "testStatic.sqlite")

@brownag brownag added the NASIS-local This tag is used for pull requests, issues, discussions etc. for soilDB local NASIS functions label Jan 7, 2021
@brownag
Copy link
Member Author

brownag commented Jan 7, 2021

OK, clean bill of health (at least everything runs now with SS = FALSE and static_path = "testStatic.sqlite")

> test <- lapply(fnames, function(fname) {
+     lapply(fname, function(FUN) {
+       message(sprintf("Testing: %s", FUN))
+       if (FUN == "local_NASIS_defined") try(get(FUN, envir = as.environment("package:soilDB"))(static_path = "testStatic.sqlite"))
+       else try(get(FUN, envir = as.environment("package:soilDB"))(SS = selected_set, static_path = "testStatic.sqlite"))
+       # try(get(FUN, envir = as.environment("package:soilDB"))())
+     })
+   })
Testing: fetchNASIS
multiple horizontal datums present, consider using WGS84 coordinates (x_std, y_std)
NOTICE: multiple `labsampnum` values / horizons; see pedon IDs:
S1969NE013001,S1980OK015001
mixing dry colors ... [184 of 8169 horizons]
mixing moist colors ... [284 of 8856 horizons]
-> QC: some fragsize_h values == 76mm, may be mis-classified as cobbles [356 / 11859 records]
replacing missing lower horizon depths with top depth + 1cm ... [140 horizons]
top/bottom depths equal, adding 1cm to bottom depth ... [70 horizons]
-> QC: sites without pedons: use `get('sites.missing.pedons', envir=soilDB.env)` for related usersiteid values
-> QC: duplicate pedons: use `get('dup.pedon.ids', envir=soilDB.env)` for related peiid values
-> QC: horizon errors detected, use `get('bad.pedon.ids', envir=soilDB.env)` for related userpedonid values or `get('bad.horizons', envir=soilDB.env)` for related horizon designations
-> QC: pedons missing bottom hz depths: use `get('missing.bottom.depths', envir=soilDB.env)` for related pedon IDs
-> QC: equal hz top and bottom depths: use `get('top.bottom.equal', envir=soilDB.env)` for related pedon IDs
Testing: getHzErrorsNASIS
multiple horizontal datums present, consider using WGS84 coordinates (x_std, y_std)
NOTICE: multiple `labsampnum` values / horizons; see pedon IDs:
S1969NE013001,S1980OK015001
Testing: get_RMF_from_NASIS_db
Testing: get_colors_from_NASIS_db
mixing dry colors ... [184 of 8169 horizons]
mixing moist colors ... [284 of 8856 horizons]
Testing: get_component_copm_data_from_NASIS_db
Loading required namespace: RODBC
Testing: get_lmuaoverlap_from_NASIS
Testing: get_component_horizon_data_from_NASIS_db
Testing: get_component_data_from_NASIS_db
Testing: get_legend_from_NASIS
Testing: get_mutext_from_NASIS_db
Testing: get_comonth_from_NASIS_db
Testing: get_mapunit_from_NASIS
Testing: get_component_diaghz_from_NASIS_db
Testing: get_component_correlation_data_from_NASIS_db
Testing: get_copedon_from_NASIS_db
some linked pedons not in selected set or local database
Testing: get_component_otherveg_data_from_NASIS_db
Testing: get_component_restrictions_from_NASIS_db
Testing: get_component_cogeomorph_data_from_NASIS_db
Testing: get_component_esd_data_from_NASIS_db
Testing: get_concentrations_from_NASIS_db
Testing: get_cosoilmoist_from_NASIS
Testing: get_extended_data_from_NASIS_db
-> QC: some fragsize_h values == 76mm, may be mis-classified as cobbles [356 / 11859 records]
Testing: get_hz_data_from_NASIS_db
NOTICE: multiple `labsampnum` values / horizons; see pedon IDs:
S1969NE013001,S1980OK015001
Testing: get_lablayer_data_from_NASIS_db
Testing: get_labpedon_data_from_NASIS_db
Testing: get_phfmp_from_NASIS_db
Testing: get_projectmapunit_from_NASIS
Testing: get_site_data_from_NASIS_db
multiple horizontal datums present, consider using WGS84 coordinates (x_std, y_std)
Testing: get_text_notes_from_NASIS_db
Testing: get_veg_data_from_NASIS_db
Testing: get_vegplot_location_from_NASIS_db
Testing: get_vegplot_tree_si_details_from_NASIS_db
Testing: get_vegplot_species_from_NASIS_db
Testing: get_vegplot_transpecies_from_NASIS_db
Testing: get_vegplot_tree_si_summary_from_NASIS_db
Testing: get_vegplot_textnote_from_NASIS_db
Testing: get_vegplot_trhi_from_NASIS_db
Testing: get_vegplot_from_NASIS_db
Testing: get_vegplot_transect_from_NASIS_db
Testing: local_NASIS_defined
There were 11 warnings (use warnings() to see them)
> warnings()
Warning messages:
1: some records are missing rock fragment volume, these have been removed
2: fragment volume >= 100%
phiid:
4081839
677471
932280
932930
3: some records are missing artifact volume, these have been removed
4: all records are missing artifact volume (NULL). buffering result with NA. will be converted to zero if nullFragsAreZero = TRUE.
5: In eval(substitute(expr), e) : NAs introduced by coercion
6: In eval(substitute(expr), e) : NAs introduced by coercion
7: some records are missing rock fragment volume, these have been removed
8: fragment volume >= 100%
phiid:
4081839
677471
932280
932930
9: some records are missing artifact volume, these have been removed
10: all records are missing artifact volume (NULL). buffering result with NA. will be converted to zero if nullFragsAreZero = TRUE.
11: In order to query this data you'll need to load all related vegplots to your sites and pedons in NASIS.

Now, for updating all impacted non-Roxygen documentation to Roxygen.

==> devtools::check(document = FALSE, args = c('--run-donttest'))

-- Building ------------------------- soilDB --
Setting env vars:
* CFLAGS    : -Wall -pedantic
* CXXFLAGS  : -Wall -pedantic
* CXX11FLAGS: -Wall -pedantic
-----------------------------------------------
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools 4.0 from https://cran.r-project.org/bin/windows/Rtools/.
v  checking for file 'E:\workspace\soilDB/DESCRIPTION' (442ms)
-  preparing 'soilDB': (28.9s)
v  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts (2.2s)
-  checking for empty or unneeded directories
-  looking to see if a 'data/datalist' file should be added
-  building 'soilDB_2.6.1.tar.gz'
   
-- Checking ------------------------- soilDB --
Setting env vars:
* _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
* _R_CHECK_CRAN_INCOMING_       : FALSE
* _R_CHECK_FORCE_SUGGESTS_      : FALSE
* NOT_CRAN                      : true
-- R CMD check -----------------------------------------------------------------
   R library paths: 
    C:/Users/Andrew.G.Brown/Documents/R/win-library/4.0
    C:/Program Files/R/R-4.0.2/library
-  using log directory 'E:/workspace/soilDB.Rcheck'
-  using R version 4.0.2 (2020-06-22)
-  using platform: x86_64-w64-mingw32 (64-bit)
-  using session charset: ISO8859-1
-  using options '--run-donttest --no-manual --as-cran' (1m 15s)
v  checking for file 'soilDB/DESCRIPTION'
-  checking extension type ... Package
-  this is package 'soilDB' version '2.6.1'
v  checking package namespace information ...
v  checking package dependencies (13.2s)
v  checking if this is a source package ... 
v  checking if there is a namespace
v  checking for .dll and .exe files
v  checking for hidden files and directories ... 
v  checking for portable file names ... 
v  checking whether package 'soilDB' can be installed (36.1s)
v  checking package directory (755ms)
v  checking for future file timestamps (5.9s)
v  checking DESCRIPTION meta-information (565ms)
N  checking top-level files
   Non-standard files/directories found at top level:
     'nasis-targets-master.rda' 'testStatic.sqlite'
v  checking for left-over files ... 
v  checking index information
v  checking package subdirectories ... 
v  checking R files for non-ASCII characters ... 
v  checking R files for syntax errors ... 
v  checking whether the package can be loaded (2.3s)
v  checking whether the package can be loaded with stated dependencies (2.3s)
v  checking whether the package can be unloaded cleanly (2.5s)
v  checking whether the namespace can be loaded with stated dependencies (2.4s)
v  checking whether the namespace can be unloaded cleanly (2.4s)
v  checking loading without being on the library search path (2.6s)
v  checking dependencies in R code (3.4s)
v  checking S3 generic/method consistency (3.9s)
v  checking replacement functions (2.4s)
v  checking foreign function calls (3s)
N  checking R code for possible problems (20.3s)
   fetchNASISLabData: no visible binding for global variable 'static_path'
   fetchVegdata: no visible binding for global variable 'static_path'
   Undefined global functions or variables:
     static_path
v  checking Rd files (1.1s)
v  checking Rd metadata ... 
v  checking Rd line widths ... 
v  checking Rd cross-references (519ms)
v  checking for missing documentation entries (2.5s)
W  checking for code/documentation mismatches (2.9s)
   Codoc mismatches from documentation object 'get_colors_from_NASIS_db':
   get_colors_from_NASIS_db
     Code: function(SS = TRUE, static_path = NULL)
     Docs: function(SS = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_comonth_from_NASIS_db':
   get_comonth_from_NASIS_db
     Code: function(SS = TRUE, fill = FALSE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(SS = TRUE, fill = FALSE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_component_data_from_NASIS_db':
   get_component_data_from_NASIS_db
     Code: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   get_component_restrictions_from_NASIS_db
     Code: function(SS = TRUE, static_path = NULL)
     Docs: function(SS = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_cosoilmoist_from_NASIS':
   get_cosoilmoist_from_NASIS
     Code: function(SS = TRUE, impute = TRUE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(impute = TRUE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       SS static_path
     Mismatches in argument names:
       Position: 1 Code: SS Docs: impute
       Position: 2 Code: impute Docs: stringsAsFactors
   
   Codoc mismatches from documentation object 'get_extended_data_from_NASIS_db':
   get_extended_data_from_NASIS_db
     Code: function(SS = TRUE, nullFragsAreZero = TRUE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(SS = TRUE, nullFragsAreZero = TRUE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_hz_data_from_NASIS_db':
   get_hz_data_from_NASIS_db
     Code: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_lablayer_data_from_NASIS_db':
   get_lablayer_data_from_NASIS_db
     Code: function(SS = TRUE, static_path = NULL)
     Docs: function(SS = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_labpedon_data_from_NASIS_db':
   get_labpedon_data_from_NASIS_db
     Code: function(SS = TRUE, static_path = NULL)
     Docs: function(SS = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_site_data_from_NASIS_db':
   get_site_data_from_NASIS_db
     Code: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors(), static_path = NULL)
     Docs: function(SS = TRUE, stringsAsFactors =
                    default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_soilseries_from_NASIS':
   get_soilseries_from_NASIS
     Code: function(stringsAsFactors = default.stringsAsFactors(),
                    static_path = NULL)
     Docs: function(stringsAsFactors = default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_text_notes_from_NASIS_db':
   get_text_notes_from_NASIS_db
     Code: function(SS = TRUE, fixLineEndings = TRUE, static_path = NULL)
     Docs: function(SS = TRUE, fixLineEndings = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'get_veg_data_from_NASIS_db':
   get_veg_data_from_NASIS_db
     Code: function(SS = TRUE, static_path = NULL)
     Docs: function(SS = TRUE)
     Argument names in code not in docs:
       static_path
   
   Codoc mismatches from documentation object 'uncode':
   uncode
     Code: function(df, invert = FALSE, db = "NASIS", droplevels = FALSE,
                    stringsAsFactors = default.stringsAsFactors(),
                    static_path = NULL)
     Docs: function(df, invert = FALSE, db = "NASIS", droplevels = FALSE,
                    stringsAsFactors = default.stringsAsFactors())
     Argument names in code not in docs:
       static_path
   
W  checking Rd \usage sections (5.6s)
   Undocumented arguments in documentation object 'local_NASIS_defined'
     'static_path'
   
   Functions with \usage entries need to have the appropriate \alias
   entries, and all their arguments documented.
   The \usage entries must correspond to syntactically valid R code.
   See chapter 'Writing R documentation files' in the 'Writing R
   Extensions' manual.
v  checking Rd contents (4.8s)
v  checking for unstated dependencies in examples (921ms)
v  checking contents of 'data' directory (2.9s)
v  checking data for non-ASCII characters (1.2s)
v  checking data for ASCII and uncompressed saves ... 
v  checking examples (4m 8.4s)
   Examples with CPU (user + system) or elapsed time > 5s
                            user system elapsed
   taxaExtent              18.40   3.70   33.15
   fetchHenry               8.98   0.22   16.98
   fetchNASISWebReport      4.82   0.13   20.57
   fetchSDA_component       2.92   0.02   22.61
   SDA_spatialQuery         2.28   0.51   28.19
   fetchSCAN                1.44   0.02   10.51
   fetchSoilGrids           1.16   0.00    7.68
   OSDquery                 0.93   0.07    6.67
   fetchSDA_spatial         0.82   0.18    7.97
   SDA_query                0.96   0.03    8.53
   fetchKSSL                0.45   0.03   13.86
   fetchOSD                 0.27   0.03    8.68
   uncode                   0.20   0.03   11.94
   fetchRaCA                0.06   0.01   10.04
   mapunit_geom_by_ll_bbox  0.02   0.01    7.28
v  checking for unstated dependencies in 'tests' ... 
-  checking tests ...
E  Running 'testthat.R' [202s] (3m 21.8s)
   Running the tests in 'tests/testthat.R' failed.
   Last 13 lines of output:
       |===================================                                   |  50%
       |                                                                            
       |======================================================================| 100%
     == testthat results  ===========================================================
     [ OK: 289 | SKIPPED: 1 | WARNINGS: 0 | FAILED: 7 ]
     1. Failure: ROSETTA() works (@test-ROSETTA.R#59) 
     2. Failure: ROSETTA() works (@test-ROSETTA.R#62) 
     3. Failure: ROSETTA() works (@test-ROSETTA.R#65) 
     4. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#94) 
     5. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#97) 
     6. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#100) 
     7. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#106) 
     
     Error: testthat unit tests failed
     Execution halted
v  checking for non-standard things in the check directory
v  checking for detritus in the temp directory
   
   See
     'E:/workspace/soilDB.Rcheck/00check.log'
   for details.
   
-- R CMD check results --------------------------------------- soilDB 2.6.1 ----
Duration: 11m 26.7s

> checking tests ...
  See below...

> checking for code/documentation mismatches ... WARNING
  Codoc mismatches from documentation object 'get_colors_from_NASIS_db':
  get_colors_from_NASIS_db
    Code: function(SS = TRUE, static_path = NULL)
    Docs: function(SS = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_comonth_from_NASIS_db':
  get_comonth_from_NASIS_db
    Code: function(SS = TRUE, fill = FALSE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(SS = TRUE, fill = FALSE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_component_data_from_NASIS_db':
  get_component_data_from_NASIS_db
    Code: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  get_component_restrictions_from_NASIS_db
    Code: function(SS = TRUE, static_path = NULL)
    Docs: function(SS = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_cosoilmoist_from_NASIS':
  get_cosoilmoist_from_NASIS
    Code: function(SS = TRUE, impute = TRUE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(impute = TRUE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      SS static_path
    Mismatches in argument names:
      Position: 1 Code: SS Docs: impute
      Position: 2 Code: impute Docs: stringsAsFactors
  
  Codoc mismatches from documentation object 'get_extended_data_from_NASIS_db':
  get_extended_data_from_NASIS_db
    Code: function(SS = TRUE, nullFragsAreZero = TRUE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(SS = TRUE, nullFragsAreZero = TRUE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_hz_data_from_NASIS_db':
  get_hz_data_from_NASIS_db
    Code: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_lablayer_data_from_NASIS_db':
  get_lablayer_data_from_NASIS_db
    Code: function(SS = TRUE, static_path = NULL)
    Docs: function(SS = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_labpedon_data_from_NASIS_db':
  get_labpedon_data_from_NASIS_db
    Code: function(SS = TRUE, static_path = NULL)
    Docs: function(SS = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_site_data_from_NASIS_db':
  get_site_data_from_NASIS_db
    Code: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors(), static_path = NULL)
    Docs: function(SS = TRUE, stringsAsFactors =
                   default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_soilseries_from_NASIS':
  get_soilseries_from_NASIS
    Code: function(stringsAsFactors = default.stringsAsFactors(),
                   static_path = NULL)
    Docs: function(stringsAsFactors = default.stringsAsFactors())
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_text_notes_from_NASIS_db':
  get_text_notes_from_NASIS_db
    Code: function(SS = TRUE, fixLineEndings = TRUE, static_path = NULL)
    Docs: function(SS = TRUE, fixLineEndings = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'get_veg_data_from_NASIS_db':
  get_veg_data_from_NASIS_db
    Code: function(SS = TRUE, static_path = NULL)
    Docs: function(SS = TRUE)
    Argument names in code not in docs:
      static_path
  
  Codoc mismatches from documentation object 'uncode':
  uncode
    Code: function(df, invert = FALSE, db = "NASIS", droplevels = FALSE,
                   stringsAsFactors = default.stringsAsFactors(),
                   static_path = NULL)
    Docs: function(df, invert = FALSE, db = "NASIS", droplevels = FALSE,
                   stringsAsFactors = default.stringsAsFactors())
    Argument names in code not in docs:
      static_path

> checking Rd \usage sections ... WARNING
  Undocumented arguments in documentation object 'local_NASIS_defined'
    'static_path'
  
  Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapter 'Writing R documentation files' in the 'Writing R
  Extensions' manual.

> checking top-level files ... NOTE
  Non-standard files/directories found at top level:
    'nasis-targets-master.rda' 'testStatic.sqlite'

> checking R code for possible problems ... NOTE
  fetchNASISLabData: no visible binding for global variable 'static_path'
  fetchVegdata: no visible binding for global variable 'static_path'
  Undefined global functions or variables:
    static_path

-- Test failures ------------------------------------------------- testthat ----

> library(testthat)
> library(soilDB)
> 
> test_check("soilDB")
-- 1. Failure: ROSETTA() works (@test-ROSETTA.R#59)  ---------------------------
inherits(r, "data.frame") isn't true.

-- 2. Failure: ROSETTA() works (@test-ROSETTA.R#62)  ---------------------------
nrow(r) == nrow(x) isn't true.

-- 3. Failure: ROSETTA() works (@test-ROSETTA.R#65)  ---------------------------
all(c("theta_r", "theta_s", "alpha", "npar", "ksat") %in% names(r)) isn't true.

-- 4. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#94
r$.rosetta.model[1] == 2 isn't true.

-- 5. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#97
r$.rosetta.model[2] == 3 isn't true.

-- 6. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#10
r$.rosetta.model[3] == 4 isn't true.

-- 7. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#10
is.na(r$theta_r[9]) & (r$.rosetta.model[9] == -1) isn't true.

  |======================================================================| 100%
== testthat results  ===========================================================
[ OK: 289 | SKIPPED: 1 | WARNINGS: 0 | FAILED: 7 ]
1. Failure: ROSETTA() works (@test-ROSETTA.R#59) 
2. Failure: ROSETTA() works (@test-ROSETTA.R#62) 
3. Failure: ROSETTA() works (@test-ROSETTA.R#65) 
4. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#94) 
5. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#97) 
6. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#100) 
7. Failure: correct model selection in the presence of NA (@test-ROSETTA.R#106) 

Error: testthat unit tests failed
Execution halted

1 error x | 2 warnings x | 2 notes x
Error: R CMD check found ERRORs
Execution halted

Exited with status 1.

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:

https://cran.rstudio.com/bin/windows/Rtools/

@brownag brownag mentioned this pull request Jan 11, 2021
8 tasks
@brownag brownag marked this pull request as ready for review January 29, 2021 00:06
@brownag brownag merged commit 61c56df into nasisDBI Jan 29, 2021
@brownag brownag deleted the nasisSTATIC branch January 29, 2021 00:09
brownag added a commit that referenced this pull request Jan 29, 2021
* Method for cloning local NASIS tables into static SQLite file #149

* local_NASIS_defined: add static_path arg and use RSQLite::dbCanConnect

* Add selected set and static path to getHzErrorsNASIS

* get_cosoilmoist / get_vegplot should use selected set argument

* Special handling for local_NASIS_defined (does not take SS arg)

* Add static_path to local_NASIS_defined
brownag added a commit that referenced this pull request Mar 23, 2021
* Convert NASIS-related queries from RODBC->DBI #146

* remove require RODBC

* roxygen for fetchNASIS

* Color data NA moist state handling

* use_sqlite = FALSE is the default for .openNASISchannel

* Move VARCHAR(MAX) fields to end of query, per MSSQL specs

* fix getHzErrorsNASIS

* Validations and tests RE: #149 #146

* Move to fetchNASIS tests (skip on remote)

* Add skip() and better handling of missing DB/no data

* Use local_NASIS_defined everywhere w/ odbc::odbcListDataSources

* cherry-pick: make a proper interface to sqlite NASIS queries

cherry-pick: 🧬 Stitch SQLite data source API up to fetchNASIS

cherry-pick: Update demo

cherry-pick: Default code use 25cm, as proposed

Validate/fix NASIS methods

* Change name of path argument

* fetchNASIS: Remove RIGHT JOIN in geomorphic features query and turn off the MSSQL specific syntax used for `d.rf.data.v2`

* Method for cloning local NASIS tables into static SQLite file (#154)

* Method for cloning local NASIS tables into static SQLite file #149

* local_NASIS_defined: add static_path arg and use RSQLite::dbCanConnect

* Add selected set and static path to getHzErrorsNASIS

* get_cosoilmoist / get_vegplot should use selected set argument

* Special handling for local_NASIS_defined (does not take SS arg)

* Add static_path to local_NASIS_defined

* Roxygen: markdown = TRUE

Broken docs

md-doc: Fix single bracket semantics

* Update docs

* forgot to commit this one

* NEWS / version 2.6.x

* Rd2roxygen initial conversion; old in ./manbak

* fix \href{}

* passing check_man

* Rd2roxygen (#162)

* Rd2roxygen initial conversion; old in ./manbak

* fix \href{}

* passing check_man

* fixes for R CMD check

* deprecate old manpages

* Revert existing roxygen back to human-made

* get_extended_data_from_NASIS_db: artifact data query should respect SS=FALSE

* get extended NASIS photo text notes: check for paths >260 chars

* proper sequence to get SQLite pedon snapshot fetchNASIS-ready

* Use checkHzDepthLogic (fast=TRUE) in fetchNASIS_pedons

* .fetchNASIS_pedons: Use data.table for extended data processing

* get_extended_data_from_NASIS_db: Replace plyr::join

* dbQueryNASIS: vectorize/test; dbConnectNASIS: add NASIS() alias

* docs

* Add test for local NASIS DBI issues

* Fix for get_cosoilmoist_from_NASISWebReport example

* Fix for list output of createStaticNASIS

* Close RODBC connection used in tests

* Testing some pedon_table_column checks @jskovlin

* aqp::union has been removed from namespace

* test-fetchKSSL: hide txtProgressBar when running tests

* Refactoring utils.R for data.table in fetchNASIS flattening

* Docs

* Oops DBI/odbc/RSQLite back in Imports

* Missing comma

* Docs

* Mopping up

* Move driver packages (odbc, RSQLite) to Suggests

* get_cotext_from_NASIS_db: Add support for static_path argument and use dbQueryNASIS

* get_cotext_from_NASIS_db: check for try-error

* .formatParentMaterialString: Return NA_character_ for conformal data.frame with NULL data

* Remove dangling require RODBC

* fetchNASIS: extended data flattening handle NULL table contents

* createStaticNASIS: better default arguments

* Fixes for selected set argument  (found by drop all _View_1 tables in a static DB)

* Updates to nasisDBI "demo" that runs all the NASIS methods by all the methods

* Remove requireNamespace("RODBC")--merge artifact?

* demo createStaticNASIS workflow

* Add WCS/SDA viz to demo

* Fix bug in decoding of horizon data; thanks @dylanbeaudette

* Pass through static_path argument to uncode()

* Fix get_comonth_from_NASIS_db fill=TRUE

* Update demos

* Small adjustments to default args for demo/comparisons

* Rename static_path arg to dsn

* Rename static_path arg to dsn (docs)

* Version bump + update README

* Update NEWS.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NASIS-local This tag is used for pull requests, issues, discussions etc. for soilDB local NASIS functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant