Git Product home page Git Product logo

rattains's Issues

Release rATTAINS 0.1.2

Prepare for release:

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()

Release rATTAINS 0.1.3

Prepare for release:

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()

CRAN check errors

Errors on r-devel-linux-x86_64-debian-gcc, r-release-macos-x86_64, r-oldrel-macos-x86_64 during CRAN checks.

Flavor: r-devel-linux-x86_64-debian-gcc:

Version: 0.1.0
Check: tests
Result: ERROR
     Running β€˜testthat.R’ [10s/15s]
    Running the tests in β€˜tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(rATTAINS)
     >
     > test_check("rATTAINS")
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/actions/R8-ND-2018-03_N_Nactions.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessmentUnits/AL03150201-0107-200assessmentUnits.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessmentUnits/AL03150201-0107-200assessmentUnits.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessments/SDDENR_GRAZING_IN_RIPARIAN_OR_SHORELINE_ZONES_N_Nassessments.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/assessments/SDDENR_GRAZING_IN_RIPARIAN_OR_SHORELINE_ZONES_N_Nassessments.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/huc12summary/020700100204huc12.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/huc12summary/020700100204huc12.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/plans/020700100103_Nplans.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/plans/020700100103_Nplans.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/surveys/SDDENRsurveys.json
     reading cached file from: /tmp/check-CRAN-regular-hornik/cache/R/attains-public/api/surveys/SDDENRsurveys.json
     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Error (test-actions.R:3:3): actions webservice works ────────────────────────
     Error: Column `agencyCode` not found in `.data`
     Backtrace:
     β–ˆ
     1. β”œβ”€vcr::use_cassette(...) test-actions.R:3:2
     2. β”‚ └─cassette$call_block(...)
     3. β”œβ”€rATTAINS::actions(action_id = "R8-ND-2018-03") test-actions.R:4:4
     4. β”‚ └─rATTAINS:::actions_to_tibble(...)
     5. β”‚ └─`%>%`(...)
     6. β”œβ”€janitor::clean_names(.)
     7. β”œβ”€tibble::as_tibble(.)
     8. β”œβ”€dplyr::select(., -c(.data$array.index))
     9. β”œβ”€tidyjson::spread_all(., recursive = TRUE)
     10. β”‚ └─tidyjson::is.tbl_json(.x)
     11. β”œβ”€tidyjson::gather_array(.)
     12. β”‚ β”œβ”€assertthat::assert_that(!("..name" %in% names(.x)))
     13. β”‚ β”‚ └─assertthat::see_if(..., env = env, msg = msg)
     14. β”‚ β”‚ β”œβ”€base::tryCatch(...)
     15. β”‚ β”‚ β”‚ └─base:::tryCatchList(expr, classes, parentenv, handlers)
     16. β”‚ β”‚ β”‚ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
     17. β”‚ β”‚ β”‚ └─base:::doTryCatch(return(expr), name, parentenv, handler)
     18. β”‚ β”‚ └─base::eval(assertion, env)
     19. β”‚ β”‚ └─base::eval(assertion, env)
     20. β”‚ └─"..name" %in% names(.x)
     21. β”œβ”€tidyjson::enter_object(., "documentTypes")
     22. β”‚ └─tidyjson::is.tbl_json(.x)
     23. β”œβ”€dplyr::select(., -c(.data$array.index))
     24. β”œβ”€tidyjson::spread_all(.)
     25. β”‚ └─tidyjson::is.tbl_json(.x)
     26. β”œβ”€tidyjson::gather_array(.)
     27. β”‚ β”œβ”€assertthat::assert_that(!("..name" %in% names(.x)))
     28. β”‚ β”‚ └─assertthat::see_if(..., env = env, msg = msg)
     29. β”‚ β”‚ β”œβ”€base::tryCatch(...)
     30. β”‚ β”‚ β”‚ └─base:::tryCatchList(expr, classes, parentenv, handlers)
     31. β”‚ β”‚ β”‚ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
     32. β”‚ β”‚ β”‚ └─base:::doTryCatch(return(expr), name, parentenv, handler)
     33. β”‚ β”‚ └─base::eval(assertion, env)
     34. β”‚ β”‚ └─base::eval(assertion, env)
     35. β”‚ └─"..name" %in% names(.x)
     36. β”œβ”€tidyjson::enter_object(., "documents")
     37. β”‚ └─tidyjson::is.tbl_json(.x)
     38. β”œβ”€dplyr::rename(., agencyCode_1 = .data$agencyCode)
     39. β”œβ”€dplyr:::rename.data.frame(., agencyCode_1 = .data$agencyCode)
     40. β”‚ └─tidyselect::eval_rename(expr(c(...)), .data)
     41. β”‚ └─tidyselect:::rename_impl(...)
     42. β”‚ └─tidyselect:::eval_select_impl(...)
     43. β”‚ β”œβ”€tidyselect:::with_subscript_errors(...)
     44. β”‚ β”‚ β”œβ”€base::tryCatch(...)
     45. β”‚ β”‚ β”‚ └─base:::tryCatchList(expr, classes, parentenv, handlers)
     46. β”‚ β”‚ β”‚ └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
     47. β”‚ β”‚ β”‚ └─base:::doTryCatch(return(expr), name, parentenv, handler)
     48. β”‚ β”‚ └─tidyselect:::instrument_base_errors(expr)
     49. β”‚ β”‚ └─base::withCallingHandlers(...)
     50. β”‚ └─tidyselect:::vars_select_eval(...)
     51. β”‚ └─tidyselect:::walk_data_tree(expr, data_mask, context_mask)
     52. β”‚ └─tidyselect:::eval_c(expr, data_mask, context_mask)
     53. β”‚ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
     54. β”‚ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
     55. β”‚ └─base::eval(expr, data_mask)
     56. β”‚ └─base::eval(expr, data_mask)
     57. β”‚ β”œβ”€agencyCode
     58. β”‚ └─rlang:::`$.rlang_data_pronoun`(.data, agencyCode)
     59. β”‚ └─rlang:::data_pronoun_get(x, nm)
     60. └─rlang:::abort_data_pronoun(x)
    
     [ FAIL 1 | WARN 0 | SKIP 0 | PASS 43 ]
     Error: Test failures
     Execution halted

Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64

Version: 0.1.0
Check: tests
Result: ERROR
     Running β€˜testthat.R’ [3s/3s]
    Running the tests in β€˜tests/testthat.R’ failed.
    Last 13 lines of output:
     42. β”‚ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
     43. β”‚ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
     44. β”‚ └─tidyselect:::eval_c(expr, data_mask, context_mask)
     45. β”‚ └─tidyselect:::reduce_sels(node, data_mask, context_mask, init = init)
     46. β”‚ └─tidyselect:::walk_data_tree(new, data_mask, context_mask)
     47. β”‚ └─base::eval(expr, data_mask)
     48. β”‚ └─base::eval(expr, data_mask)
     49. β”‚ β”œβ”€agencyCode
     50. β”‚ └─rlang:::`$.rlang_data_pronoun`(.data, agencyCode)
     51. β”‚ └─rlang:::data_pronoun_get(x, nm)
     52. └─rlang:::abort_data_pronoun(x)
    
     [ FAIL 2 | WARN 0 | SKIP 0 | PASS 39 ]
     Error: Test failures
     Execution halted

Flavors: r-release-macos-x86_64, r-oldrel-macos-x86_64

Version: 0.1.0
Check: re-building of vignette outputs
Result: WARN
    Error(s) in re-building vignettes:
     ...
    --- re-building β€˜Introduction.Rmd’ using rmarkdown
    Warning in engine$weave(file, quiet = quiet, encoding = enc) :
     Pandoc (>= 1.12.3) not available. Falling back to R Markdown v1.
    reading cached file from: ~/Library/Caches/R/attains-public/api/usesStateSummary/TDECWR_2016state_summary.json
    Quitting from lines 60-61 (Introduction.Rmd)
    Error: processing vignette 'Introduction.Rmd' failed with diagnostics:
    subscript out of bounds
    --- failed re-building β€˜Introduction.Rmd’
    
    SUMMARY: processing the following file failed:
     β€˜Introduction.Rmd’
    
    Error: Vignette re-building failed.
    Execution halted

Tasks for v1.0 releases

  • remove tidyjson dependency, switch to tibblify to ensure consistent data structures are returned.
  • eliminate magrittr import/export
  • update docs
  • update pkgdown examples (add example for parsing json manually if errors occur)
  • update mocked tests
  • remove janitor dependency
  • add argument for returning nested data (see #33 )
  • update citation file

Release rATTAINS 0.1.4

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check()
  • Update citation version
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • Wait for purrr 1.0.1
  • tidyjson release?
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Broken Test

Warning message:
package 'testthat' was built under R version 4.2.2 
[ FAIL 0 | WARN 1 | SKIP 0 | PASS 53 ]

══ Warnings ════════════════════════════════════════════════════════════════════
── Warning ('test-plans.R:3'): plans works ─────────────────────────────────────
array.index column name already exists, changing to array.index.2
Backtrace:
  1. vcr::use_cassette(...)
       at test-plans.R:3:2
 11. tidyjson::gather_array(.)

[ FAIL 0 | WARN 1 | SKIP 0 | PASS 53 ]
Warning message:
package 'vcr' was built under R version 4.2.2 

Tests complete

Release rATTAINS 0.1.0

First release:

Prepare for release:

  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release rATTAINS 0.1.1

Prepare for release:

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()

Remove caching?

CRAN seems to have a moving policy on allowing package to write to user directories, or at least where packages can write to.

Suggest removing caching functions and including documentation for users to cache api calls themselves.

leave data nested? [possible breaking change]

Switching to tibblify in the dev version facilitates returning consistent data structures from the API regardless of missing data returned by EPA's API. My initial design choice was to return data as unnested as possible, thinking it is easier for users to avoid unnest operations. tidyr's unnest(), unnest_wider(), unnest_longer(), probably makes it much easier for new users to unnest data now.

It is much harder to go the other direction (nesting data) without knowing what variables to group by however! Currently working on a project where I only want the high level data (nested grouped variables) and it is very much a pain to remember what variables to group by.

Options:

  • leave as is
  • return nested data
  • add argument to return nested data (default would be to keep current behavior)

Error with state_summary() tidy = TRUE

Hi -- I'm interested in exploring EPA ATTAINS records for multiple states in the Northeast US.


## R version 4.1.0
library(rATTAINS) ## 0.1.3.9999
library(dplyr) ## 1.0.7

domain_values(domain_name = "OrgStateCode") %>%
  filter(code %in% c("RI")) %>%
  pull(context)
## [1] "RIDEM" "EPA"  

state_summary(organization_id = "RIDEM") 
## Error: Can't coerce element 10 from a list to a character

## Whereas, when the code is not tidy it returns data
head(state_summary(organization_id = "RIDEM", tidy = FALSE))

Please let me know if you need additional information to make sure the code above is reproducible.

Release rATTAINS 1.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Update cran-comments.md
  • git push
  • Wait for curl check errors to ressolve

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted πŸŽ‰
  • git push
  • usethis::use_github_release()
  • git push

Test Failure on CRAN

Getting the following test failure on CRAN

checking tests ... [17s/44s] ERROR
  Running β€˜testthat.R’ [17s/43s]
Running the tests in β€˜tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rATTAINS)
  >
  > test_check("rATTAINS")
  no files found
  no files found
  no files found
  no files found
  no files found
  no files found
  no files found
  no files found
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  β€’ On CRAN (6)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-huc12_summary.R:14:3): huc_12 works ─────────────────────────────
  Error in `curl::curl_fetch_memory(x$url$url, handle = x$url$handle)`: Timeout was reached: [attains.epa.gov] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received
  Backtrace:
      β–ˆ
   1. └─rATTAINS::huc12_summary(huc = "020700100204", tidy = FALSE) test-huc12_summary.R:14:2
   2. └─rATTAINS:::xGET(path, args, file = NULL, ...)
   3. └─cli$get(path = path, query = args)
   4. └─private$make_request(rr)
   5. └─crul:::crul_fetch(opts)
   6. └─curl::curl_fetch_memory(x$url$url, handle = x$url$handle)
  
  [ FAIL 1 | WARN 0 | SKIP 6 | PASS 38 ]
  Error: Test failures
  Execution halted

This is odd because {vcr} is used and the tests should be returning the information in the cassettes. We aren't actually making external internet calls in the test. This works locally if I don't have an internet connection.
Further, the information returned in the error message is deemed unhelpful by CRAN so in this error case they want improved error messaging. Even with an informative error message, the test would have failed.

Empty folders created

The empty folders created by the caching logic are not allowed by CRAN.

Not 100% sure why this doesn't trigger the other Checks, but possibly try with:
_R_CHECK_DONTTEST_EXAMPLES_=true

Arguments to assessments function cause error

Hello,

I am hoping to use this package to query the ATTAINS data for specific areas across the eastern United States. I think most of the data I'm interested in is in the use_assessment tibble produced by assessments(), but I'm having difficulty using the assessments() function with assessment_unit_id designated. I would also like to know EPA IR categories since ~2010, which I think means I'll need to run assessments() multiple times, as shown in your example tutorial (though at the state level).

I can only get the assessments() function to complete a query with an assessment_unit_id listed when both state_code and organization_id are also listed. Is this the expected function? I also run into an error when I try to specify any reporting cycle other than 2020 (which I think is the most recent one based on the default arguments). Adding any agency_code arguments doesn't affect the error.

assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY') # works assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY', reporting_cycle='2020') # works assessments(assessment_unit_id='KY-1749', state_code='KY', organization_id='21KY', reporting_cycle='2016') # does not work

The error I recieve is : "Error in dplyr::select():
! Can't subset columns that don't exist.
x Column agencyCode doesn't exist.
Run rlang::last_error() to see where the error occurred. "
I downloaded the CRAN version of the package this morning and am running R version 4.1.1 on Windows.

I appreciate your help with this issue and for writing this package! It is going to immensely help and speed up the process -- we have about 70 sites across 13 states. Thanks!
Traci

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.