New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear warnings in examples/tests #288

Closed
achubaty opened this Issue Jun 21, 2016 · 23 comments

Comments

Projects
None yet
2 participants
@achubaty
Contributor

achubaty commented Jun 21, 2016

various warnings appear when running tests manually (Ctrl+Shift+T in RStudio):

Warnings -----------------------------------------------------------------------
1. ../../man/initiateAgents.Rd (@SELES.R#120) - no non-missing arguments to min; returning Inf
2. ../../man/initiateAgents.Rd (@SELES.R#120) - no non-missing arguments to max; returning -Inf
3. ../../man/randomPolygons.Rd - no non-missing arguments to min; returning Inf
4. ../../man/randomPolygons.Rd - no non-missing arguments to max; returning -Inf
5. ../../man/specnumperpatch-probs.Rd (@initialize.R#268) - no non-missing arguments to min; returning Inf
6. ../../man/specnumperpatch-probs.Rd (@initialize.R#268) - no non-missing arguments to max; returning -Inf
7. ../../man/specnumperpatch-probs.Rd (@initialize.R#268) - no non-missing arguments to min; returning Inf
8. ../../man/specnumperpatch-probs.Rd (@initialize.R#268) - no non-missing arguments to max; returning -Inf
9. rings and cir (@test-spread.R#630) - no non-missing arguments to min; returning Inf
10. rings and cir (@test-spread.R#630) - no non-missing arguments to max; returning -Inf

@achubaty achubaty added this to the v1.2.0 milestone Jun 21, 2016

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Jun 21, 2016

I spent a lot of time trying to figure out where those are coming from...
no luck. I will try again.

On Tue, Jun 21, 2016 at 2:04 PM, Alex Chubaty notifications@github.com
wrote:

Assigned #288 #288 to
@eliotmcintire https://github.com/eliotmcintire.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ABDK27j6nUvuZAosLEUz8ssgTrz7Lozgks5qOFHjgaJpZM4I7K7B
.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Jun 22, 2016

updated message above

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Jun 22, 2016

Do these appear on automated tests or only manual?

@achubaty

This comment has been minimized.

Contributor

achubaty commented Jun 22, 2016

only manual tests. not sure why R CMD check doesn't see the warnings

@achubaty achubaty removed this from the v1.2.0 milestone Jun 24, 2016

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Jul 30, 2016

Is this still happening? I can't recreate it.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Sep 7, 2016

yes, this is still showing warnings:

Warnings -----------------------------------------------------------------------
1. ../../man/initiateAgents.Rd (@SELES.R#121) - no non-missing arguments to min; returning Inf
2. ../../man/initiateAgents.Rd (@SELES.R#121) - no non-missing arguments to max; returning -Inf
3. ../../man/randomPolygons.Rd - no non-missing arguments to min; returning Inf
4. ../../man/randomPolygons.Rd - no non-missing arguments to max; returning -Inf
5. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to min; returning Inf
6. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to max; returning -Inf
7. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to min; returning Inf
8. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to max; returning -Inf
9. rings and cir (@test-spread.R#629) - no non-missing arguments to min; returning Inf
10. rings and cir (@test-spread.R#629) - no non-missing arguments to max; returning -Inf
@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Sep 7, 2016

I can't reproduce those, and so am having a really hard time debugging
them. They only occur on manual running of tests via testthat package, but
not interactive running of the tests.

On Wed, Sep 7, 2016 at 8:45 AM, Alex Chubaty notifications@github.com
wrote:

yes, this is still showing warnings:

Warnings -----------------------------------------------------------------------1. ../../man/initiateAgents.Rd (@SELES.R#121) - no non-missing arguments to min; returning Inf2. ../../man/initiateAgents.Rd (@SELES.R#121) - no non-missing arguments to max; returning -Inf3. ../../man/randomPolygons.Rd - no non-missing arguments to min; returning Inf4. ../../man/randomPolygons.Rd - no non-missing arguments to max; returning -Inf5. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to min; returning Inf6. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to max; returning -Inf7. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to min; returning Inf8. ../../man/specnumperpatch-probs.Rd (@initialize.R#283) - no non-missing arguments to max; returning -Inf9. rings and cir (@test-spread.R#629) - no non-missing arguments to min; returning Inf10. rings and cir (@test-spread.R#629) - no non-missing arguments to max; returning -Inf


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDK29KMC0aBYjM7jHZvga3I2QweZGTgks5qntwcgaJpZM4I7K7B
.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 4, 2016

the warnings are cleared, but several failures occur:

Failed -------------------------------------------------------------------------
1. Error: ../../man/cir.Rd (@neighbourhood.R#497) ------------------------------
incorrect number of dimensions
1: cir(Ras, agent, maxRadius = 15, simplify = TRUE)
2: cir(Ras, agent, maxRadius = 15, simplify = TRUE) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:497
3: .local(landscape, coords, maxRadius, minRadius, allowOverlap, allowDuplicates, includeBehavior, 
       returnDistances, angles, returnAngles, returnIndices, closest, simplify)
4: cir(landscape, coords, maxRadius = maxRadius, minRadius = minRadius, allowOverlap = allowOverlap, 
       allowDuplicates = allowDuplicates, includeBehavior = includeBehavior, returnDistances = returnDistances, 
       angles = angles, returnAngles = returnAngles, returnIndices = returnIndices, 
       closest = closest, simplify = simplify) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:510
5: cir(landscape, coords, maxRadius = maxRadius, minRadius = minRadius, allowOverlap = allowOverlap, 
       allowDuplicates = allowDuplicates, includeBehavior = includeBehavior, returnDistances = returnDistances, 
       angles = angles, returnAngles = returnAngles, returnIndices = returnIndices, 
       closest = closest, simplify = simplify) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:497
@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 4, 2016

What is up with these? They come out of nowhere (from a bad merge? a
different package updated?) and are not reproducible interactively so are
hard to debug.

On Tue, Oct 4, 2016 at 2:41 PM, Alex Chubaty notifications@github.com
wrote:

the warnings are cleared, but several failures occur:

Failed -------------------------------------------------------------------------1. Error: ../../man/cir.Rd (@neighbourhood.R#497) ------------------------------incorrect number of dimensions1: cir(Ras, agent, maxRadius = 15, simplify = TRUE)2: cir(Ras, agent, maxRadius = 15, simplify = TRUE) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:4973: .local(landscape, coords, maxRadius, minRadius, allowOverlap, allowDuplicates, includeBehavior,
returnDistances, angles, returnAngles, returnIndices, closest, simplify)4: cir(landscape, coords, maxRadius = maxRadius, minRadius = minRadius, allowOverlap = allowOverlap,
allowDuplicates = allowDuplicates, includeBehavior = includeBehavior, returnDistances = returnDistances,
angles = angles, returnAngles = returnAngles, returnIndices = returnIndices,
closest = closest, simplify = simplify) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:5105: cir(landscape, coords, maxRadius = maxRadius, minRadius = minRadius, allowOverlap = allowOverlap,
allowDuplicates = allowDuplicates, includeBehavior = includeBehavior, returnDistances = returnDistances,
angles = angles, returnAngles = returnAngles, returnIndices = returnIndices,
closest = closest, simplify = simplify) at /home/achubaty/Documents/GitHub/SpaDES/R/neighbourhood.R:497


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDK2zMRAJa5rDzClG9wwshS6kiVYDFhks5qwsgagaJpZM4I7K7B
.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

there is an error in the example for cir. I just ran through it manually and it fails with the error above.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

the use of gaussMap and randomPolygons may be the culprit, as they rely on RandomFields wihch was recently updated and yields different values then before

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

Works fine for me. All packages updated. Maybe it is an R version issue.

On Tue, Oct 4, 2016 at 5:22 PM, Alex Chubaty notifications@github.com
wrote:

the use of gaussMap and randomPolygons may be the culprit, as they rely
on RandomFields wihch was recently updated and yields different values
then before


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDK26RwLYxOVpGLTvAJGfK_pWltfmAaks5qwu24gaJpZM4I7K7B
.

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

R is 3.3.1, the latest. I cannot reproduce the error except in
non-interactive testing.

On Tue, Oct 4, 2016 at 7:23 PM, Eliot McIntire eliotmcintire@gmail.com
wrote:

Works fine for me. All packages updated. Maybe it is an R version issue.

On Tue, Oct 4, 2016 at 5:22 PM, Alex Chubaty notifications@github.com
wrote:

the use of gaussMap and randomPolygons may be the culprit, as they rely
on RandomFields wihch was recently updated and yields different values
then before


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDK26RwLYxOVpGLTvAJGfK_pWltfmAaks5qwu24gaJpZM4I7K7B
.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

Now when I run it I don't get an error. Could be a package loading order thing.

Reproducible in a new R session:

library(raster)
library(data.table)
library(sp)
devtools::load_all("~/GitHub/SpaDES")

# circle centred
Ras <- raster(extent(0, 15, 0, 15), res = 1)
Ras[] <- 0
middleCircle <- cir(Ras)
Ras[middleCircle[, "indices"]] <- 1
circlePoints <- SpatialPoints(middleCircle[, c("x", "y")])
if (interactive()) {
  clearPlot()
  Plot(Ras)
  Plot(circlePoints, addTo = "Ras")
}

# circles non centred
Ras <- randomPolygons(Ras, numTypes = 4)
N <- 2
agent <- SpatialPoints(coords = cbind(x = stats::runif(N, xmin(Ras), xmax(Ras)),
                                      y = stats::runif(N, xmin(Ras), xmax(Ras))))
cirs <- cir(Ras, agent, maxRadius = 15, simplify = TRUE)
cirsSP <- SpatialPoints(coords = cirs[, c("x", "y")])
Error in .local(obj, ...) : 
  cannot derive coordinates from non-numeric matrix
@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

Whereas, loading SpaDES first gets no error:

devtools::load_all("~/GitHub/SpaDES")
library(raster)
library(data.table)
library(sp)

# circle centred
Ras <- raster(extent(0, 15, 0, 15), res = 1)
Ras[] <- 0
middleCircle <- cir(Ras)
Ras[middleCircle[, "indices"]] <- 1
circlePoints <- SpatialPoints(middleCircle[, c("x", "y")])
if (interactive()) {
  clearPlot()
  Plot(Ras)
  Plot(circlePoints, addTo = "Ras")
}

# circles non centred
Ras <- randomPolygons(Ras, numTypes = 4)
N <- 2
agent <- SpatialPoints(coords = cbind(x = stats::runif(N, xmin(Ras), xmax(Ras)),
                                      y = stats::runif(N, xmin(Ras), xmax(Ras))))
cirs <- cir(Ras, agent, maxRadius = 15, simplify = TRUE)
cirsSP <- SpatialPoints(coords = cirs[, c("x", "y")])
@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

moved examples to separate file for easier debugging (e6a47fc)

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

note: Eliot moved the offending block into an if (interactive()) chunk (94a815e), which bypasses the problem. Closing this issue.

@achubaty achubaty closed this Oct 5, 2016

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

I alraedy did that and pushed it last night. Failed merge?

On Wed, Oct 5, 2016 at 10:28 AM, Alex Chubaty notifications@github.com
wrote:

note: Eliot moved the offending block into an if (interactive()) chunk (
94a815e
94a815e),
which bypasses the problem. Closing this issue.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#288 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDK252M3tRXyA0eFTBP0fvlqRChHSQSks5qw95MgaJpZM4I7K7B
.

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

It was not a package loading thing. It was a seed issue. Under some seeds, the problem would arise.

@eliotmcintire eliotmcintire reopened this Oct 5, 2016

achubaty added a commit that referenced this issue Oct 5, 2016

use 'set.seed' in cir example (#288)
* revert use of `if (interactive())`
@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

I set a seed, and reverted the use of if (interactive(), and the example runs/works. Closing this issue and I'll start a new one specific to cir.

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

Do not work on this. I solve the problem internally in the function and am working on a push.

@achubaty

This comment has been minimized.

Contributor

achubaty commented Oct 5, 2016

I'm not -- I just created a separate issue since this is outside the scope of the original one here. See #311.

@eliotmcintire

This comment has been minimized.

Contributor

eliotmcintire commented Oct 5, 2016

Fixed this and #311 with 78a8eaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment