jranke / chents

Compare c8bfe56 ... +1 ... 898d598

Coverage Reach
chent.R

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 12 files from the diff.
Other files ignored by Codecov
DESCRIPTION has changed.
ChangeLog has changed.
man/pp.Rd has changed.
GNUmakefile has changed.
man/chent.Rd has changed.
test.log has changed.
man/pai.Rd has changed.
man/plot.chent.Rd has changed.

@@ -21,7 +21,6 @@
Loading
21 21
#' the internet. Additionally, it can be generated using RDKit if RDKit and its
22 22
#' python bindings are installed and configured for use with PythonInR.
23 23
#'
24 -
#' @docType class
25 24
#' @export
26 25
#' @format An \code{\link{R6Class}} generator object
27 26
#' @importFrom R6 R6Class
@@ -47,8 +46,6 @@
Loading
47 46
#' @field soil_ff Dataframe of formation fractions
48 47
#' @field soil_sorption Dataframe of soil sorption data
49 48
#' @field PUF Plant uptake factor
50 -
#' @example inst/examples/octanol.R
51 -
#' @example inst/examples/caffeine.R
52 49
#' @keywords data
53 50
54 51
chent <- R6Class("chent",
@@ -113,16 +110,12 @@
Loading
113 110
    try_pubchem = function(query, from = 'name') {
114 111
      message("PubChem:")
115 112
      if (missing(query)) query <- self$identifier
116 -
      pubchem_result = webchem::get_cid(query, from = from)
113 +
      pubchem_result = webchem::get_cid(query, from = from, match = "first")
117 114
118 -
      if (is.na(pubchem_result[[1]][1])) {
115 +
      if (is.na(pubchem_result[[1, "cid"]])) {
119 116
        message("Query ", query, " did not give results at PubChem")
120 117
      } else {
121 -
        n_results = length(pubchem_result[[1]])
122 -
        if (n_results > 1) {
123 -
          warning("Found ", n_results, " entries in PubChem, using the first one.")
124 -
        }
125 -
        self$get_pubchem(pubchem_result[[1]][1])
118 +
        self$get_pubchem(pubchem_result[[1, "cid"]])
126 119
      }
127 120
    },
128 121
    get_pubchem = function(pubchem_cid) {
@@ -296,7 +289,7 @@
Loading
296 289
                                               stringsAsFactors = FALSE))
297 290
    },
298 291
    soil_degradation = NULL,
299 -
    add_soil_degradation = function(soils, DT50,
292 +
    add_soil_degradation = function(soils, DT50_mod, DT50_mod_ref,
300 293
                                    type = NA, country = NA,
301 294
                                    pH_orig = NA, pH_medium = NA, pH_H2O = NA,
302 295
                                    perc_OC = NA,
@@ -306,7 +299,8 @@
Loading
306 299
                                    remark = "", source, page = NA) {
307 300
      new_soil_degradation = data.frame(
308 301
        soil = soils,
309 -
        DT50 = DT50,
302 +
        DT50_mod = DT50_mod,
303 +
        DT50_mod_ref = DT50_mod_ref,
310 304
        type = type,
311 305
        country = country,
312 306
        pH_orig = pH_orig,
@@ -473,7 +467,6 @@
Loading
473 467
#' @importFrom grImport grid.picture
474 468
#' @param x The chent object to be plotted
475 469
#' @param ... Further arguments passed to \code{\link{grid.picture}}
476 -
#' @example inst/examples/caffeine.R
477 470
#' @export
478 471
plot.chent = function(x, ...) {
479 472
  if (is.null(x$Picture)) stop("No Picture object in chent, was RDKit available during creation?")
@@ -491,7 +484,6 @@
Loading
491 484
#' @format An \code{\link{R6Class}} generator object
492 485
#' @field iso ISO common name according to ISO 1750 as retreived from www.alanwood.net/pesticides
493 486
#' @field alanwood List of information retreived from www.alanwood.net/pesticides
494 -
#' @example inst/examples/pai.R
495 487
#' @keywords data
496 488
497 489
pai <- R6Class("pai",
@@ -515,7 +507,7 @@
Loading
515 507
516 508
      if (!missing(iso) & alanwood) {
517 509
        message("alanwood.net:")
518 -
        aw_result = webchem::aw_query(identifier, type = "commonname")
510 +
        aw_result = webchem::aw_query(identifier, from = "name")
519 511
520 512
        # Use first element of list, as we passed a query of length one
521 513
        if (is.na(aw_result[[1]][1])) {

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
R/chent.R -0.83% 22.62%
Project Totals (1 files) 22.62%
Loading