Code Monkey home page Code Monkey logo

codecheck's Introduction

codecheck

Lifecycle: experimental R build status DOI

codecheck is an assistant for conducting CODECHECKs, written in the R language and distributed as an R package. The goal of codecheck is to ease the process to create a CODECHECK-ready workspace, and to conduct the actual CODECHECK. Furthermore, the package contains some helper functions for managing the CODECHECK register.

Learn more about CODECHECK on https://codecheck.org.uk/.

Installation

The package is not on CRAN yet. Install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("codecheckers/codecheck")

Usage

See the main vignette.

Development

The package uses tinytest for tests. Run test_all("/path/to/package") to run all tests interactively. Even better, run the tests in a fresh install/temporary directory using

# assuming . is the package path
build_install_test(".")

License

Copyright 2022 S. Eglen & D. Nüst. The codecheck package is published under the MIT license, see file LICENSE.

codecheck's People

Contributors

angelina-momin avatar nuest avatar sje30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

codecheck's Issues

Add automated checking of code repository to help codecheckers or (CODECHECK) editors

Let's try to capture some steps of the human evaluation process in a tool so that we can "pre-check" the contents of a workflow repository:

  • Is there a README?
  • Is there a license?
  • Does the README mention the figures and tables from the paper (clear connection between outputs and code files)?
  • Is there an environment documentation or file (cf. repo2docker REES spec)
  • Do all links (and DOIs) resolve?
  • Are execution times mentioned in the README?
  • If HPC is mentioned, is a sample dataset also mentioned?
  • Are any full paths in documentation or code files (/home/.., C:\Users\.., etc.)
  • ...

Tools that show how the interaction could work:

More fine grained Zenodo interaction and metadata export

  • Add paper authors as "Contributors" (role "other"?)
  • Allow to pre-reserve a DOI without filling in all the metadata
  • Make filling out the metadata in Zenodo online (which might be more accessible to users) and then retrieving these changes before making any updates works well
  • Some metadata, suchs as the paper reference, might not be available the first time - should we not publish the report until then?

metadata not uploading / incorrect licence?

I couldn't get much joy from zen4R today. It didn't upload metadata, and was complaining about the licence being unrecognised.

> codecheck:::set_zenodo_metadata(zenodo, record, metadata)
[zen4R][ERROR] ZenodoRecord - License with id 'other-open' doesn't exist in Zenodo 
Error in draft$setLicense(licenseId = "other-open") : 
  License with id 'other-open' doesn't exist in Zenodo

changing the code to use 'MIT' as licence did not work.... removing the line to setLicense silenced the error, but no metadata were uploaded....

shrug...

Simple collection of outputs in certificate

I'd love to replace the kind of crufy solution I have now for including manifest files in the certificate, e.g. I have :

{r, echo=FALSE, fig.cap=manifest_df[1:4,"comment"]}
knitr::include_graphics(manifest_df[1, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[2, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[3, "dest"])
cat('\n\n')
knitr::include_graphics(manifest_df[4, "dest"])
cat('\n\n')

whereas what I'd like is a simple chunk that by default will include all the manifest files intelligently into the Rmd. e.g. if given a figure (png/pdf/jpg), it calls include_graphics, else for csv it shows a tiblle summary of the data frame... just need some R magic to get it working.

rename citation()

Currently citation() generates a citation of the current codecheck certificate. the function name clashes though with base::citation() which should be left alone. (incidentally, citation("codecheck") is already half-usable.)

should we simply not export the function, and rely on codecheck:::citation() or rename the function to something like codecheck_cite_cert() or cite_certificate()? My preference would be option 3.

Add Shiny-based UI for writing the report

It would be great if the codecheck package can also be helpful for reviews conducted by non-R users. For this, we could try a Shiny-based UI. The shiny app could either run in the cloud (free with RStudio) or as a Binder.

The Shiny app would focus on editing the report and pushing metadata to Zenodo.

Where to put the source repo?

Currently I see no place in codecheck.yml for where we should list the URL of the original code repository that we are checking.

how about a new field source: to point to a URL of where the software came from? Or that might need to be an open string, as sometimes we will need to describe several URLs, one for the code, one for the data, ....

Validate ORCIDs in codecheck.yml

Only existing ORCIDs should be used.

rorcid::orcid_id(orcid = "0000-0002-9341-7985")
# should not be empty

Also, we can point to rorcid package in the documentaiton, which might streamline lookup of ORCIDs for names. Note when I tried this in a container, the callback for the authentication did not work :-/.

Also add rorcid to Suggests in the DESCRIPTION file.

Add function to update register deposit on Zenodo

First, manually deposit the register once on Zenodo to preserve it. Then add a function to update that deposit with one function call.

Eventually, when the register rendering is moved to CI, the function could be extended with a check of how recent the deposit is and then update regularly, e.g. once every quarter.

Validate Zenodo metadata for register check

The register validation function should check that

  • the deposit title contains the check number
  • the deposit metadata contains a reference to the published article
  • the deposit metadata contains a reference to the GitHub repository
  • the file listing contains a file codecheck.pdf
  • the deposit is part of the codecheck community
  • ...

Related to #14 and #19

upload not working (for me)

codecheck:::set_zenodo_certificate(zenodo, record, "codecheck.pdf")

didn't work for me. I got this error:

Error in record$id : $ operator is invalid for atomic vectors

not loading packages

it doesn't automatically load 'zen4R'or 'yaml' when the package is
loaded. yet, those packages are listed on the Imports: part of
DESCRIPTION. What am I missing?




> setwd('/Users/stephen/proj/2020/codecheckers/rmr-solver/codecheck')
> library("codecheck")
Loading required package: gh
Loading required package: R.cache
R.cache v0.16.0 (2022-07-21 16:20:02 UTC) successfully loaded. See ?R.cache for help.
Loading required package: parsedate
Loading required package: git2r
> metadata = read_yaml( "../codecheck.yml")
Error in read_yaml("../codecheck.yml") : 
  could not find function "read_yaml"

template codecheck.Rmd should "just work"

The template codecheck.Rmd is useful, but doesn't work out of the box ("make" will fail.) I think this is bad for us, as we can't even test that the template works.

I propose a simple change to create_codecheck_files() that will generate two pngs, called "codecheck-deleteme1.png" and "codecheck-deleteme2.png" in the root of the project. They can be included in the template manifest so that the template works. The manifest will then have comments to indicate the pngs should be deleted once the codecheck has started.

one zenodo record, two ids...

There is an oddity with the zenodo DOIs.

e.g.
report: https://doi.org/10.5281/zenodo.10213244

the id, 10213244, is the latest DOI. But there is also a DOI 10213243, which is the 'master DOI' and will automatically link to the latest version of the report. It might be a good idea to explicitly document this. End users might prefer refering to the 'master DOI' rather than the first version.

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.