Skip to content

Issues with new unit implementation #14

Closed

Description

@thomasp85
  • 1)
* installing *source* package ‘augmentedRCBD’ ...
...
** byte-compile and prepare package for lazy loading
Error in get(x, envir = ns, inherits = FALSE) :
 object 'unit.list' not found
Error: unable to load R code in package ‘augmentedRCBD’

which I presume should be using the generic unit().

The problem is the resize_heights() function, which plays silly games to try to perform a unit subset assignment. I think that this might be fixed by just relying on grid's unit subset assignment, but I need to test on R with the new-unit patch applied.

  • 2)

Packages Gmisc ggfittext ggrepel ggstatplot: check class() assuming length 1, a bug in those packages. We reported Gmisc: I will leave the others until this is live.

  • 3)
VECTOR_ELT() can only be applied to a 'list', not a 'double'

in many packages:
BAS CINNA DescribeDisplay EMMIXmfa GGally ICtest LDheatmap
PPforest SHELF StratigrapheR airGR auditor codebook ggmcmc lemon
nzelect qualvar randomForestExplainer rrr specmine staRdom statVisual tsfeatures userfriendlyscience

GGally and codebook give some context:

Error in grid.Call.graphics(C_setviewport, vp, TRUE): VECTOR_ELT() can only be applied to a 'list', not a 'double'

as before.

  • 4)
 (list) object cannot be coerced to type 'double'

from unit() in ggpol.

  • 5)
REAL() can only be applied to a 'numeric', not a 'integer'

from Ops.units in IntNMF NMF SCROPIUS diceR iTOP pheatmap, seemingly all from NMF.

  • 6)
`heatmap_width` and `width` should not all be the absolute units.

from CNVScope armada countToFPKM eclust wilson

  • 7)
old version of unit class is no longer allowed

from fewer after reinstallation - MTLR SpatialBall firebehavioR foreSIGHT superheat xpose . Some say from is.unit().

  • 8)
Error in mm2pixels(convert(u, "mm")) : Unit must be in millimeters

from MendelianRandomization Miso PCRedux PPQplan Plasmidprofiler otsad autoplotly frailtyEM getTBinR gprofiler2 heatmaply manhattanly
neatmaps otsad personalized plotly rabhit trelliscopejs wilson

  • 9)
    ParamHelpers segfaults, in its obfuscated tests.

  • 10)
    cowplot has a Floating point exception in shared_legends.Rmd.

  • 11)

Error in FUN(X[[i]], ...) : object is not coercible to a unit
Calls: blobbogram -> Summary.unit -> unlist -> lapply -> FUN

from gemtc.

  • 12)
Error in unit(3, "grobwidth", data = seg_plot_yaxis_grobs[[longest_segment]]) :
 data must be either NULL, have length 1, or match the length of the final unit vector
Calls: plot_gene_map -> unit

from genoPlotR.

  • 13)
Error in grid::unit(c(0, 0, 0, marginLength), marginUnit) : Invalid unit
Calls: ggMarginal ... addMainTheme -> <Anonymous> -> find_args -> mget -> <Anonymous>

from ggExtra

  • 14)
Error in `attributes<-`(x, attr) :
 'names' attribute [2] must be the same length as the vector [1]
Calls: <Anonymous> ... gtable_add_rows -> insert.unit -> unit.c -> [ -> [.unit

from ggraph

  • 15)
    Error in grid::unit(c(0, 0, 0, marginLength), marginUnit) : Invalid unit
    Calls: ... addMainTheme -> -> find_args -> mget ->

from ggstatsplot

  • 16)
 Error in unit(x, unit) : Invalid unit
 Calls: grid.export ... as.animUnit -> as.animUnit.numeric -> animUnit -> is.unit -> unit

from gridSVG, which I expect is known.

  • 17)
Error in (function (cl, name, valueClass)  :
 c("assignment of an object of class “simpleUnit” is not valid for @‘mar’ in an object of class “hexVP”; is(value, \"unit\") is not TRUE", "assignment of an object of class “unit” is not valid for @‘mar’ in an object of class “hexVP”; is(value, \"unit\") is not TRUE", "assignment of an object of class “unit_v2” is not valid for @‘mar’ in an object of class “hexVP”; is(value, \"unit\") is not TRUE")
Calls: plot -> plot -> .local -> hexViewport -> <Anonymous>

from hexbin lidR survey

  • 18)
Error in unit(as.numeric(arrow$length) * mag, attr(arrow$length, "unit")) :
 Invalid unit
Calls: <Anonymous> ... <Anonymous> -> .fun -> do.call -> <Anonymous> -> f -> unit

from metR tmap

  • 19)
Warning in check_units(width, unit) :
 Multiple grid::units detected. Casting all to 'unit' argument ('mm').
Warning in check_units(height, unit) :
 Multiple grid::units detected. Casting all to 'unit' argument ('mm').
>
> # With no panels, printing shows the layout
> figure1
Error in grid::unit(., saved_unit) : Invalid unit
Calls: <Anonymous> ... eval -> _fseq -> freduce -> <Anonymous> -> <Anonymous>

from multipanelfigure

  • 20)
Error in sum(g_tab$widths[[5]], g_tab$widths[[6]], g_tab$widths[[7]]) :
 invalid 'type' (list) of argument
Calls: thresh_forest

in nathresh

  • 21)
 Error: isTRUE(all.equal(getGrob(result, "MAP"), truth)) is not TRUE

in portfolio

  • 22)
Error in grid::unit(c(0, 0, 0, marginLength), marginUnit) : Invalid unit
Calls: scatterplot ... addMainTheme -> <Anonymous> -> find_args -> mget -> <Anonymous>

in sensitivity

  • 23)
Error in matchData[[i]] * amount[i] :
 non-numeric argument to binary operator
Calls: plotSelected ... <Anonymous> -> do.call -> sisalTable -> Summary.unit

in sisal and stripless

Activity

  1. thomasp85 commented on Apr 12, 2019

    @thomasp85
    OwnerAuthor
  2. thomasp85 commented on Jul 2, 2019

    @thomasp85
    OwnerAuthor

    @pmur002 will it be possible to do a CRAN check soonish again with the #1 PR? I've done a fair amount of work to accommodate old units in the new code so that they should be converted transparently, and it would be nice to see how many issues this fix before tackling the remaining part...

  3. pmur002 commented on Jul 3, 2019

    @pmur002
    Collaborator

    I am not keen to take this anywhere near the official CRAN until we have things much more under control. However, I am developing my own testing set up that I can try testing on. It is based on a Docker image that ...

    I can also run this on a 20-core 64GB machine, so it does not take all day (just a few hours).

    I have got this producing something similar to the CRAN failures in the list above, so we can hopefully use it to bring the list of problems down much lower.

    Will try to set a test run going with the latest new-unit version.

  4. thomasp85 commented on Jul 3, 2019

    @thomasp85
    OwnerAuthor

    That sounds good... let me try to fix the problems you reported before you begin testing

  5. pmur002 commented on Jul 3, 2019

    @pmur002
    Collaborator

    Ok. Let me know when you're ready for me to try a test.

  6. thomasp85 commented on Jul 4, 2019

    @thomasp85
    OwnerAuthor

    I've fixed the problems you identified, so you are free to try out a revdep check

  7. pmur002 commented on Jul 5, 2019

    @pmur002
    Collaborator

    Thanks. My upgradeUnit() tests now work for me (though I had to export the upgradeUnit() methods in NAMESPACE first - I have pushed that change).

  8. pmur002 commented on Jul 5, 2019

    @pmur002
    Collaborator

    I am updating my test set up (for latest CRAN package versions). Will run devdep check next week.

  9. pmur002 commented on Jul 19, 2019

    @pmur002
    Collaborator

    Sorry about the delay - teaching prep took over.
    I have run a set of checks and unfortunately, it looks like we are not there yet ...

    Check status summary:
                      ERROR WARN NOTE  OK
      Source packages   294   29   66 106
    

    May even be worse than before ?

    That is just on direct 'grid' dependencies. Looking at the first error, it seems like we break 'lattice' straight off the bat. For example, this fails ...

    library(lattice)
    example(barchart)
    

    Do you have time to take a look at that?

    the check summary is attached, which is useful for seeing which packages failed. I can put the full set of check directories up on a dropbox for you if you like, but it is 2GB. Alternatively, I can provide individual package check directories if you want to take a closer look at anything.

    workResult.txt

  10. pmur002 commented on Jul 26, 2019

    @pmur002
    Collaborator

    I have tracked the first problem (in 'abd') to a much simpler issue in 'lattice'. I would say the problem probably also afflicts 'ggplot2' (unconfirmed), which would explain the blow out in package errors (?).
    Anyway, the problem is as simple as ...

    max(unit(1, "strwidth", "test"))
    

    ... which produces ...

    Error in upgradeUnit.default(list(list(1, "test", 14L))) : 
      Not a unit object
    

    This is traced to the following lines in Summary.unit() ...

      x <- unlist(lapply(units, as.unit), recursive = FALSE)
      
      matchUnits <- .Call(C_matchUnit, x, ok)
    

    ... where the unlist() downgrades the list of "unit" objects in 'x' to a list of plain lists. C_matchUnit() eventually chokes on that because a plain list is not a "unit" object. The rest of the code in Summary.unit() appears to be based on a list of "unit" objects, which suggests that the unlist() is wrong, but it does not look like C_matchUnit() is designed for a list of "unit" objects. I am not sure what the right fix is here - any suggestions? Is my diagnosis correct ?

  11. thomasp85 commented on Aug 5, 2019

    @thomasp85
    OwnerAuthor

    I'm back from vacation and will begin working on a fix for this — thanks for the initial digging

  12. thomasp85 commented on Aug 5, 2019

    @thomasp85
    OwnerAuthor

    If only ever all bugs were this easy to fix :-)

  13. pmur002 commented on Aug 6, 2019

    @pmur002
    Collaborator

    Got it. Thanks. Will run another grid rev dep check.

  14. pmur002 commented on Aug 6, 2019

    @pmur002
    Collaborator

    I am now seeing ...

    > xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
      data = iris, scales = "free", layout = c(2, 2),
      auto.key = list(x = .6, y = .7, corner = c(0, 0)))
    
    Error: index out of bounds ("unit" subsetting)
    

    I'm beginning to suspect we should at least get 'lattice' and 'ggplot2' passing R CMD check before I run the larger/longer tests :)

  15. thomasp85 commented on Aug 27, 2019

    @thomasp85
    OwnerAuthor

    I have fixed the error above and both lattice and ggplot2 now passes tests with the new-unit branch. Can I get you to once more run a full batteri of revdep checks?

  16. 66 remaining items

  17. thomasp85 commented on Jan 22, 2020

    @thomasp85
    OwnerAuthor

    gg.gap is fixed. I initially mischaracterised the problem, but we should still explicitly forbid the creation of zero-length unit vectors through indexing

  18. thomasp85 commented on Jan 22, 2020

    @thomasp85
    OwnerAuthor

    I cannot seem to get all the dependencies of ggraph to work on r-devel, so this fix is a bit in the blind. Based on the error message it looks like ggraph is subsetting a named unit vector. The names attribute was not subsetted along with it which led to the error. This has been fixed, but if you can confirm that both ggraph and gg.gap works now it would be great

  19. pmur002 commented on Jan 29, 2020

    @pmur002
    Collaborator

    Two steps forward ... looks like gg.gap is fixed, but not 'ggraph'. Some new ones there too (e.g., 'gridtext'). Will follow up with more detail (though away for next two weeks, so there will be a pause).

    animint2 ... ERROR
    blorr ... ERROR
    ggpol ... ERROR
    ggraph ... ERROR
    gridtext ... ERROR
    lemon ... ERROR
    multipanelfigure ... ERROR
    portfolio ... ERROR
    prophet ... ERROR
    tidybayes ... ERROR
    trelliscopejs ... ERROR
    walkr ... ERROR
    wilson ... ERROR
    
  20. pmur002 commented on Jan 29, 2020

    @pmur002
    Collaborator

    Error from 'ggraph':

    * checking examples ... ERROR
    Running examples in ‘ggraph-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: geom_edge_parallel
    > ### Title: Draw multi edges as parallel lines
    > ### Aliases: geom_edge_parallel geom_edge_parallel2 geom_edge_parallel0
    > 
    > ### ** Examples
    > 
    > require(tidygraph)
    Loading required package: tidygraph
    
    Attaching package: ‘tidygraph’
    
    The following object is masked from ‘package:stats’:
    
        filter
    
    > gr <- create_notable('bull') %>%
    +   convert(to_directed) %>%
    +   bind_edges(data.frame(from = c(1, 2, 2, 3), to = c(2, 1, 3, 2))) %E>%
    +   mutate(class = sample(letters[1:3], 9, TRUE)) %N>%
    +   mutate(class = sample(c('x', 'y'), 5, TRUE))
    > 
    > ggraph(gr, 'stress') +
    +   geom_edge_parallel(aes(alpha = stat(index)))
    > 
    > ggraph(gr, 'stress') +
    +   geom_edge_parallel2(aes(colour = node.class))
    > 
    > ggraph(gr, 'stress') +
    +   geom_edge_parallel0(aes(colour = class))
    Error: Cannot create zero-length unit vector ("unit" subsetting)
    Execution halted
    

    So that's just your new protection working(?).

  21. thomasp85 commented on Feb 3, 2020

    @thomasp85
    OwnerAuthor

    Yeah - is ggraph the only package provoking the new error?

  22. thomasp85 commented on Feb 6, 2020

    @thomasp85
    OwnerAuthor

    @pmur002 do you think it makes sense to allow 0-length units instead? the lack of 0-length versions is quite different than standard R vector behaviour...

  23. thomasp85 commented on Feb 6, 2020

    @thomasp85
    OwnerAuthor

    I've fixed the bug in ggraph. If no problems in other packages surfaces with the more stringent indexes lets just keep the current behaviour

  24. pmur002 commented on Feb 17, 2020

    @pmur002
    Collaborator

    Yes, it appears that 'ggraph' was the only one provoking 'Cannot create zero-length unit vector' and thanks for the fix; that works for me.

  25. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'blorr' error was not related to 'grid' (version 0.2.2 passes CMD check)

  26. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'gridtext' is being particularly naughty and generating 'grid' unit objects by hand in C code.
    This will require discussion with the package author.

  27. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'Prophet' error does not look related to 'grid' to me.

  28. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'tidybayes' error did not appear to be related to 'grid' and new version (2.0.1) passes CMD check

  29. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'walkr' was removed from CRAN on 2019-12-21 ("check problems were not corrected in time")

  30. pmur002 commented on Feb 20, 2020

    @pmur002
    Collaborator

    'trelliscope' error did not appear to be related to 'grid' and new version (0.2.4) passes CMD check

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions