Comments (6)
Unfortunately, for the time being, I cannot replicate the error... Tomorrow I will try again!
from sfnetworks.
I'm pretty sure that the problem lies in the following lines of code
Lines 17 to 18 in 23a4125
where we are comparing the object spts_ver
with the number 2.0-0
. More precisely, the object spts_ver
created by packageVersion("spatstat")
is an object of class c("package_version", "numeric_version")
and comparisons with other objects are performed by Ops.numeric_version
Ops.numeric_version
#> function (e1, e2)
#> {
#> if (nargs() == 1L)
#> stop(gettextf("unary '%s' not defined for \"numeric_version\" objects",
#> .Generic), domain = NA)
#> boolean <- switch(.Generic, `<` = , `>` = , `==` = , `!=` = ,
#> `<=` = , `>=` = TRUE, FALSE)
#> if (!boolean)
#> stop(gettextf("'%s' not defined for \"numeric_version\" objects",
#> .Generic), domain = NA)
#> if (!is.numeric_version(e1))
#> e1 <- as.numeric_version(e1)
#> if (!is.numeric_version(e2))
#> e2 <- as.numeric_version(e2)
#> op <- get(.Generic, mode = "function")
#> op(.Internal(compareNumericVersion(e1, e2)), 0L)
#> }
#> <bytecode: 0x00000210253d3f10>
#> <environment: namespace:base>
Created on 2024-03-28 with reprex v2.0.2
According to the traceback reported on CRAN, this function runs smoothly until it computes base::as.numeric_version(e2)
(where e2
is equal to 2 - 0
as we can read from the previous line in the traceback). The function base::as.numeric_version()
internally calls base::numeric_version()
which internally calls .make_numeric_version()
. The function .make_numeric_version()
was recently modified by the R-core team (see wch/r-source@1338a95 and https://bugs.r-project.org/show_bug.cgi?id=18548) and, even more recently, they decided to always raise an error on invalid numeric version, see wch/r-source@7b52372. Therefore, IMO, we should simply modify 2.0-0
to "2.0-0"
(which is probably the code always intended when comparing version numbers).
I'm 99.99% sure that the aforementioned explanation is correct. However:
- I cannot replicate the aforementioned error using the GHA. Would you mind checking the
R-CMD-check.yaml
file in the develop branch? - I just noticed that we do not have any explicit dependency on
spatstat
(as a consequence of 0c551e4). Therefore, I don't really understand how it is possible thattry(packageVersion("spatstat"), silent = TRUE)
returns a validnumeric_version
object (instead of an object of classtry-error
) and, as a consequence, I don't understand how is it possible that R ran the second part of the following if-clause during the CRAN checks detecting our error:
Lines 17 to 18 in 23a4125
Any idea? Please notice that we are currently suggestingspatstat.geom
andspatstat.linnet
, but they do not have an explicit dependency onspatstat
. In fact:
pak::pkg_deps_explain("sfnetworks", "spatstat.geom", dependencies = TRUE)
#> ℹ Loading metadata database✔ Loading metadata database ... done
#> sfnetworks -> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.random -> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.explore -> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.explore -> spatstat.random ->
#> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.model -> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.model -> spatstat.random ->
#> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.model -> spatstat.explore ->
#> spatstat.geom
#> sfnetworks -> spatstat.linnet -> spatstat.model -> spatstat.explore ->
#> spatstat.random -> spatstat.geom
pak::pkg_deps_explain("sfnetworks", "spatstat.linnet", dependencies = TRUE)
#> sfnetworks -> spatstat.linnet
pak::pkg_deps_explain("sfnetworks", "spatstat", dependencies = TRUE)
#> x spatstat
Created on 2024-03-28 with reprex v2.0.2
from sfnetworks.
Answers:
- I'm pretty sure that I correctly identified the error and I will prepare a PR in a few minutes
- Apparently my assumptions were incorrect, meaning that R CMD check can still "access" the packages in the library even if they are not specified under Imports or Suggests
from sfnetworks.
Hi @luukvdmeer. Friendly remainder that the deadline for the resubmission is 2024-04-09!
from sfnetworks.
Yes, I am aware, I'm looking at it today, thanks!
from sfnetworks.
Thank you for this! sfnetworks 0.6.4. is on CRAN 😄
from sfnetworks.
Related Issues (20)
- Test fails with the development version of igraph HOT 2
- Network cleaning: to_spatial_contracted returns mapply error HOT 4
- Converting sf_linestrings to sfnetwork causes some intersections to shift HOT 1
- Calculating Driving Distances using sfnetworks HOT 1
- Extracting GPS coordinates from SF network build from OSM Data, provides those in a wrong order HOT 8
- If the grouping variable is out of order, `to_spatial_contracted` returns incorrect node geometries HOT 1
- st_network_blend unable to blend count locations into bike network HOT 5
- Extend plot.sfnetwork to include the possibility of specifying different args for nodes and edges HOT 1
- The `trunc_mat` function we use in print.sfnetwork is deprecated HOT 2
- Enhance integration with spatstat package HOT 2
- Support cppRouting HOT 16
- Error when blending points into network HOT 3
- Support typed library
- Print method does not work with spatially implicit edges HOT 5
- Something wrong with calculating shortest paths HOT 1
- Edges does not follow right directions HOT 2
- Quiet option to skip validity text HOT 2
- Active weight column HOT 1
- to_spatial_smooth() occurs Error in `vec_rbind()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfnetworks.