ropensci / software-review

rOpenSci Software Peer Review.
286 stars 104 forks source link

rpigpior #640

Closed mnr closed 1 month ago

mnr commented 2 months ago

Submitting Author Name: Mark Niemann-Ross Submitting Author Github Handle: !--author1-->@mnr<!--end-author1-- Other Package Authors Github handles: (comma separated, delete if none) Repository: https://github.com/mnr/rpigpior Version submitted:0.0.0.1 Submission type: Standard Editor: TBD Reviewers: TBD

Archive: TBD Version accepted: TBD Language: en


This provides R with access to the Raspberry Pi General Purpose Input Output (GPIO) via 'libgpiod'. This includes detecting a gpio chip as well as turning pins on and off via [gpioset()] and reading the state of pins via [gpioget()]. No additional libraries need to be installed; Raspbian includes 'libgpiod' as part of the standard installation.

Scope

Technical checks

Confirm each of the following by checking the box.

This package:

Publication options

MEE Options - [ ] The package is novel and will be of interest to the broad readership of the journal. - [ ] The manuscript describing the package is no longer than 3000 words. - [ ] You intend to archive the code for the package in a long-term repository which meets the requirements of the journal (see [MEE's Policy on Publishing Code](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/journal-resources/policy-on-publishing-code.html)) - (*Scope: Do consider MEE's [Aims and Scope](http://besjournals.onlinelibrary.wiley.com/hub/journal/10.1111/(ISSN)2041-210X/aims-and-scope/read-full-aims-and-scope.html) for your manuscript. We make no guarantee that your manuscript will be within MEE scope.*) - (*Although not required, we strongly recommend having a full manuscript prepared when you submit here.*) - (*Please do not submit your package separately to Methods in Ecology and Evolution*)

Code of conduct

ropensci-review-bot commented 2 months ago

Thanks for submitting to rOpenSci, our editors and @ropensci-review-bot will reply soon. Type @ropensci-review-bot help for help.

ropensci-review-bot commented 2 months ago

:rocket:

Editor check started

:wave:

ropensci-review-bot commented 2 months ago

Checks for rpigpior (v0.1.0)

git hash: 30e4ba66

Important: All failing checks above must be addressed prior to proceeding

Package License: MIT + file LICENSE


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate. |type |package | ncalls| |:----------|:---------|------:| |internal |base | 21| |internal |rpigpior | 10| |internal |utils | 1| |imports |NA | NA| |suggests |knitr | NA| |suggests |rmarkdown | NA| |suggests |testthat | NA| |linking_to |NA | NA| Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats()', and examining the 'external_calls' table.

base

paste (6), system (3), c (2), for (2), as.integer (1), if (1), length (1), names (1), paste0 (1), regexec (1), regmatches (1), tryCatch (1)

rpigpior

rpi_pinToBCM (4), is.rpi (1), pwm_func (1), rpi_get (1), rpi_i2c_get (1), rpi_i2c_set (1), rpi_pin_desc (1)

utils

read.table (1)

**NOTE:** No imported packages appear to have associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has: - code in R (100% in 10 files) and - 1 authors - 6 vignettes - 1 internal data file - 1 imported package - 8 exported functions (median 19 lines of code) - 10 non-exported functions in R (median 29 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|-----:|----------:|:----------| |files_R | 10| 59.0| | |files_vignettes | 6| 97.9| | |files_tests | 10| 90.7| | |loc_R | 266| 29.4| | |loc_vignettes | 293| 62.8| | |loc_tests | 137| 46.6| | |num_vignettes | 6| 98.7|TRUE | |data_size_total | 483| 58.5| | |data_size_median | 483| 60.2| | |n_fns_r | 18| 25.1| | |n_fns_r_exported | 8| 38.3| | |n_fns_r_not_exported | 10| 22.3| | |n_fns_per_file_r | 1| 16.1| | |num_params_per_fn | 2| 30.8| | |loc_per_fn_r | 22| 63.6| | |loc_per_fn_r_exp | 20| 46.3| | |loc_per_fn_r_not_exp | 30| 78.0| | |rel_whitespace_R | 17| 32.6| | |rel_whitespace_vignettes | 60| 81.6| | |rel_whitespace_tests | 6| 18.6| | |doclines_per_fn_exp | 22| 17.3| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 9| 30.9| | ---

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

#### 3a. Continuous Integration Badges [![R-CMD-check.yaml](https://github.com/mnr/rpigpior/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mnr/rpigpior/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 8832736528|pages build and deployment |success |b265f5 | 121|2024-04-25 | | 8832871972|pkgdown |failure |30e4ba | 151|2024-04-25 | | 8832871969|R-CMD-check |failure |30e4ba | 146|2024-04-25 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) R CMD check generated the following error: 1. checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: 'test-rpi_i2c_get.R:11:3', 'test-rpi_i2c_get.R:20:3', 'test-rpi_i2c_get.R:29:3', 'test-rpi_monitor.R:2:3', 'test-rpi_pwm.R:2:3', 'test-rpi_pwm.R:7:3', 'test-rpi_pwm.R:12:3', 'test-rpi_pwm.R:17:3', 'test-rpi_set.R:3:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-is.R:2:3'): is.rpi confirms/denies RPi ─────────────────────── if (...) NULL is not TRUE `actual` is NULL `expected` is a logical vector (TRUE) [ FAIL 1 | WARN 0 | SKIP 10 | PASS 43 ] Error: Test failures Execution halted R CMD check generated the following warning: 1. checking package subdirectories ... WARNING Invalid citation information in ‘inst/CITATION’: Error in bibentry(bibtype = entry, textVersion = textVersion, header = header, footer = footer, ...): argument is missing, with no default R CMD check generated the following test_fail: 1. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(rpigpior) > > test_check("rpigpior") Real world test of setting board pin 11 [ FAIL 1 | WARN 0 | SKIP 10 | PASS 43 ] ══ Skipped tests (10) ══════════════════════════════════════════════════════════ • is.rpi() is not TRUE (10): 'test-rpi_i2c_get.R:2:3', 'test-rpi_i2c_get.R:11:3', 'test-rpi_i2c_get.R:20:3', 'test-rpi_i2c_get.R:29:3', 'test-rpi_monitor.R:2:3', 'test-rpi_pwm.R:2:3', 'test-rpi_pwm.R:7:3', 'test-rpi_pwm.R:12:3', 'test-rpi_pwm.R:17:3', 'test-rpi_set.R:3:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-is.R:2:3'): is.rpi confirms/denies RPi ─────────────────────── if (...) NULL is not TRUE `actual` is NULL `expected` is a logical vector (TRUE) [ FAIL 1 | WARN 0 | SKIP 10 | PASS 43 ] Error: Test failures Execution halted R CMD check generated the following check_fail: 1. rcmdcheck_tests_pass #### Test coverage with [covr](https://covr.r-lib.org/) ERROR: Test Coverage Failed #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following function have cyclocomplexity >= 15: function | cyclocomplexity --- | --- rpi_pwm | 29 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 50 potential issues: message | number of times --- | --- Avoid library() and require() calls in packages | 6 Lines should not be more than 80 characters. | 43 unexpected symbol | 1


Package Versions

|package |version | |:--------|:--------| |pkgstats |0.1.3.13 | |pkgcheck |0.1.2.21 |


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.

ldecicco-USGS commented 2 months ago

Hi @mnr ! Please click the 3 dots in the upper right corner of your original comment to edit, then fill in the response to the fields. A quick glance at your package makes me think it could fit in the "field and laboratory reproducibility tools" category. Playing with a Raspberry Pi is high on my list of things to do, so I'm excited to see this submission.

Once the grey "X"'s are fixed and the original submission fields are updated, I'll take a closer look. Thanks for your submission.

mnr commented 2 months ago

Thanks for the advice. I missed the questions below the scroll and have filled those out.

I was also able to clean up the R CMD checks.

So...I think we are good to go?

MNR

ldecicco-USGS commented 2 months ago

@ropensci-review-bot check package

ropensci-review-bot commented 2 months ago

Thanks, about to send the query.

ropensci-review-bot commented 2 months ago

:rocket:

Editor check started

:wave:

ropensci-review-bot commented 2 months ago

Checks for rpigpior (v0.1.0)

git hash: 6885db4d

Important: All failing checks above must be addressed prior to proceeding

Package License: MIT + file LICENSE


1. Package Dependencies

Details of Package Dependency Usage (click to open)

The table below tallies all function calls to all packages ('ncalls'), both internal (r-base + recommended, along with the package itself), and external (imported and suggested packages). 'NA' values indicate packages to which no identified calls to R functions could be found. Note that these results are generated by an automated code-tagging system which may not be entirely accurate. |type |package | ncalls| |:----------|:---------|------:| |internal |base | 21| |internal |rpigpior | 10| |internal |utils | 1| |imports |NA | NA| |suggests |knitr | NA| |suggests |rmarkdown | NA| |suggests |testthat | NA| |linking_to |NA | NA| Click below for tallies of functions used in each package. Locations of each call within this package may be generated locally by running 's <- pkgstats::pkgstats()', and examining the 'external_calls' table.

base

paste (6), system (3), c (2), for (2), as.integer (1), if (1), length (1), names (1), paste0 (1), regexec (1), regmatches (1), tryCatch (1)

rpigpior

rpi_pinToBCM (4), is.rpi (1), pwm_func (1), rpi_get (1), rpi_i2c_get (1), rpi_i2c_set (1), rpi_pin_desc (1)

utils

read.table (1)

**NOTE:** No imported packages appear to have associated function calls; please ensure with author that these 'Imports' are listed appropriately.


2. Statistical Properties

This package features some noteworthy statistical properties which may need to be clarified by a handling editor prior to progressing.

Details of statistical properties (click to open)

The package has: - code in R (100% in 10 files) and - 1 authors - 6 vignettes - 1 internal data file - 1 imported package - 8 exported functions (median 19 lines of code) - 10 non-exported functions in R (median 29 lines of code) --- Statistical properties of package structure as distributional percentiles in relation to all current CRAN packages The following terminology is used: - `loc` = "Lines of Code" - `fn` = "function" - `exp`/`not_exp` = exported / not exported All parameters are explained as tooltips in the locally-rendered HTML version of this report generated by [the `checks_to_markdown()` function](https://docs.ropensci.org/pkgcheck/reference/checks_to_markdown.html) The final measure (`fn_call_network_size`) is the total number of calls between functions (in R), or more abstract relationships between code objects in other languages. Values are flagged as "noteworthy" when they lie in the upper or lower 5th percentile. |measure | value| percentile|noteworthy | |:------------------------|-----:|----------:|:----------| |files_R | 10| 59.0| | |files_vignettes | 6| 97.9| | |files_tests | 10| 90.7| | |loc_R | 266| 29.4| | |loc_vignettes | 293| 62.8| | |loc_tests | 138| 46.7| | |num_vignettes | 6| 98.7|TRUE | |data_size_total | 483| 58.5| | |data_size_median | 483| 60.2| | |n_fns_r | 18| 25.1| | |n_fns_r_exported | 8| 38.3| | |n_fns_r_not_exported | 10| 22.3| | |n_fns_per_file_r | 1| 16.1| | |num_params_per_fn | 2| 30.8| | |loc_per_fn_r | 22| 63.6| | |loc_per_fn_r_exp | 20| 46.3| | |loc_per_fn_r_not_exp | 30| 78.0| | |rel_whitespace_R | 18| 33.1| | |rel_whitespace_vignettes | 60| 81.6| | |rel_whitespace_tests | 6| 18.6| | |doclines_per_fn_exp | 22| 17.3| | |doclines_per_fn_not_exp | 0| 0.0|TRUE | |fn_call_network_size | 9| 30.9| | ---

2a. Network visualisation

Click to see the interactive network visualisation of calls between objects in package


3. goodpractice and other checks

Details of goodpractice checks (click to open)

#### 3a. Continuous Integration Badges [![R-CMD-check.yaml](https://github.com/mnr/rpigpior/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/mnr/rpigpior/actions) **GitHub Workflow Results** | id|name |conclusion |sha | run_number|date | |----------:|:--------------------------|:----------|:------|----------:|:----------| | 8871392503|pages build and deployment |success |d9ee99 | 134|2024-04-29 | | 8871375569|pkgdown |success |6885db | 164|2024-04-29 | | 8871375565|R-CMD-check |success |6885db | 159|2024-04-29 | --- #### 3b. `goodpractice` results #### `R CMD check` with [rcmdcheck](https://r-lib.github.io/rcmdcheck/) rcmdcheck found no errors, warnings, or notes #### Test coverage with [covr](https://covr.r-lib.org/) Package coverage: 14.36 The following files are not completely covered by tests: file | coverage --- | --- R/rpi_get.R | 0% R/rpi_i2c_get.R | 0% R/rpi_i2c_set.R | 0% R/rpi_monitor.R | 0% R/rpi_pwm.R | 0% R/rpi_set.R | 0% #### Cyclocomplexity with [cyclocomp](https://github.com/MangoTheCat/cyclocomp) The following function have cyclocomplexity >= 15: function | cyclocomplexity --- | --- rpi_pwm | 29 #### Static code analyses with [lintr](https://github.com/jimhester/lintr) [lintr](https://github.com/jimhester/lintr) found the following 50 potential issues: message | number of times --- | --- Avoid library() and require() calls in packages | 6 Lines should not be more than 80 characters. | 43 unexpected symbol | 1


Package Versions

|package |version | |:--------|:--------| |pkgstats |0.1.3.13 | |pkgcheck |0.1.2.21 |


Editor-in-Chief Instructions:

Processing may not proceed until the items marked with :heavy_multiplication_x: have been resolved.

mnr commented 2 months ago

So - I need some guidance on this. It appears that covr doesn't like my unit tests.

Here's the problem:

Because I'm avoiding obvious failures, covr states "The following files are not completely covered by tests:"

In some cases, there is a robust set of tests - but requires significant set-up to test. For example, rpi_i2c_get includes this test...

` test_that("rpi_i2c_get err chip address", {

skip_if_not(is.rpi(), message = "Not a Raspberry Pi")

expect_error(rpi_i2c_get(

    chip_address = 0x07,

    data_address = 0xf0,

    data_size = "b"

  ))

 }) `

...which means a successful test requires an i2c device is connected to the RPi and is configured to appear at chip address 0x77 and produces expected data at 0xf0

Your help is appreciated. MNR

mpadge commented 1 month ago

@mnr The inability to test coverage is in your case not a problem. Special hardware requirements are not something we even thought about in developing this system. I might have a play on my own pi, but other than that we can just wait for Editor-in-Chief @jooolia to make a judgement on scope here and proceed regardless of reported coverage.

jooolia commented 1 month ago

Thank you for your submission to rOpenSci.

After careful consideration, we have determined that your submission is out of scope for our "field and lab reproducibility tools" category. While we recognise the utility of your package for many users, it is not specifically aligned to rOpenSci's focus on reproducibility in lab and field through the standardization and automation of real-world workflows.

Thank you again for considering rOpenSci, and please feel free to submit other packages for consideration in the future.

Sincerely, Julia Gustavsen

jooolia commented 1 month ago

@ropensci-review-bot out of scope