Coder Social home page Coder Social logo

Comments (3)

bgctw avatar bgctw commented on September 3, 2024

Is it possible to create a pull request on a version that includes a failing test case in order to see what exactly to fix?

from reddyproc.

lsigut avatar lsigut commented on September 3, 2024

Example here:

library(REddyProc)
DETha98 <- fConvertTimeToPosix(Example_DETha98, 'YDH', Year = 'Year',
                               Day = 'DoY', Hour = 'Hour')[-(2:4)]
EProc <- sEddyProc$new('DE-Tha', DETha98,
                       c('NEE', 'Rg', 'Tair', 'VPD', 'Ustar'))
EProc$sMDSGapFillAfterUstar('NEE', uStarTh = 0.3, FillAll = TRUE)
# missing 'VPD'...
for (i in c('Tair', 'Rg')) EProc$sMDSGapFill(i, FillAll = TRUE)
EProc$sSetLocationInfo(LatDeg = 51.0, LongDeg = 13.6, TimeZoneHour = 1)
# ...produces Error here
EProc$sGLFluxPartition(suffix = "uStar")

Error in data.frame(sDateTime = ds[[1]], NEE = NEEFiltered, sdNEE = ds[[NEESdVar]], :
arguments imply differing number of rows: 17520, 0

This behaviour differs compared to what happens when Tair_f or Rg_f is missing (error will inform that these are needed).

from reddyproc.

bgctw avatar bgctw commented on September 3, 2024

The corresponding test case in test_partGL.R would be:

test_that("report missing VPD_f column in error",{
  skip("only interactively test issue #34")
  DETha98 <- fConvertTimeToPosix(Example_DETha98, 'YDH', Year = 'Year',
                                 Day = 'DoY', Hour = 'Hour')[-(2:4)]
  EProc <- sEddyProc$new('DE-Tha', DETha98,
                         c('NEE', 'Rg', 'Tair', 'VPD', 'Ustar'))
  EProc$sMDSGapFillAfterUstar('NEE', uStarTh = 0.3, FillAll = TRUE)
  # missing 'VPD'...
  for (i in c('Tair', 'Rg')) EProc$sMDSGapFill(i, FillAll = TRUE)
  EProc$sSetLocationInfo(LatDeg = 51.0, LongDeg = 13.6, TimeZoneHour = 1)
  # ...produces Error here
  # Error should report missing column VPD_f
  expect_error(
    EProc$sGLFluxPartition(suffix = "uStar")
    ,"VPD_f"
  )
})

I will add a fix after pull request #35 has been merged, because it contains some common commits.

from reddyproc.

Related Issues (20)

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.