TheoreticalEcosystemEcology / alien

Predict All Links In Ecological Networks
MIT License
12 stars 0 forks source link

Ben weinstein #11

Open bw4sz opened 7 years ago

bw4sz commented 7 years ago
  1. Updates to vignettes.
  2. Coded Vazquez 2009 mgen wrapper (descriptive method, no predict possible)
  3. Multinomial bayesian model with a Dirichlet prior, tested and runs clean.
codecov-io commented 7 years ago

Current coverage is 30.16% (diff: 27.41%)

Merging #11 into master will decrease coverage by 5.64%

@@             master        #11   diff @@
==========================================
  Files            16         18     +2   
  Lines           377        537   +160   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits            135        162    +27   
- Misses          242        375   +133   
  Partials          0          0          

Powered by Codecov. Last update c7cc5d3...426be82

tpoisot commented 7 years ago

@bw4sz this needs to be tested before merging.

bw4sz commented 7 years ago

@tpoisot

Can you provide a bit more detail? When it says the code coverage has decreased, does it mean that some dependencies are undefined, or that there are global variables missing? I'm not totally following what is being evaluated.

KevCaz commented 7 years ago

As an example I add a test for OccupancyToJags in the previous commit ! I simply test that the file is indeed created.

tpoisot commented 7 years ago

@bw4sz sure -- it's counting the number of lines that are executed when you run the tests. It's expected that every possible situation is tested. For example the test by @KevCaz is one, but it's not sufficient since it's not telling anything about whether the file is correct.

KevCaz commented 7 years ago

Tim is right, what I have done is not enough. I guess the best is to apply your models (which requires jags files) on simple cases for which results are known.

SteveViss commented 7 years ago

The test implemented by @KevCaz for the functions (binomialToJags, interceptToJags, multinomialToJags, poissonToJags, OccupancyToJags) are fine. These functions are supposed to create files.

@bw4sz, is there a way to send a fake dat object to your fit_bayesreg function and know (a priori) the expected results/values (or at least the range) of this function? In that case, you compare the output of the function fit_bayesreg with the expected result.

If you need further details or examples have a look at http://r-pkgs.had.co.nz/tests.html. We know that implementing unit tests is more jobs but that practice is well suitable to prevent bugs and errors in the code.

KevCaz commented 7 years ago

Looking at the names of these functions, I wonder: shall we start the name by a lowercase letter or a uppercase one?

SteveViss commented 7 years ago

@KevCaz, lower !

bw4sz commented 7 years ago

Looks like steve updated the camelCase, and the namespace will need to be rebuilt. I will not get to testing these functions this week, i suggest we move forward with getting functions together.

KevCaz commented 7 years ago

Ben, I have stried to solve the issues, can you check if everything is Ok on your side??

bw4sz commented 7 years ago

@KevCaz , i pulled, merged, and pushed, everything looks okay on first pass. Will run my vignette in a sec.