Open tim-salabim opened 5 years ago
lazy sunday... absolutely appreciated! but you are the one who is doing it and knows better than everybody what it means... However I am not aware if the R package concept allows for something like a core-package without any other functionality. Otherwise we will be hardly able to split it without massive code duplication?
Should be ok, see tmap and tmaptools
hm afaik not quite the same. tmaptools
is at least offering some sort of standalone functionality. Right in the moment I don't see this part in the view-core package. However usually you are right with your assessment... So let's give a try.
cubeview successfully moved to https://github.com/r-spatial/cubeview. The only thing left to do is to transfer the kili ndvi rasterstack from mapview to cubeview data
This is not directly associated with your question, but anyway –
Since they are no longer required, I suggest we move coords2Lines()
and coords2Polygons()
to Orcs and flag these functions as deprecated in mapview. How about coords2JSON()
, is this one still needed? If I had to guess, these utility functions might still be of value for some sp hardliners ;-)
@fdetsch Good idea! I am unsure about coords2JSON()
at this stage, it may still be used in popupTable
. Can you address the other two?
@fdetsch a reverse dependency check would reveal whether any CRAN packages are using these functions.
@edzer if you don't mind my asking, which reverse dependency check returns both the package name and the function used therein? I am somewhat familiar with revdepcheck::revdep_check()
and the like, however, I have no clue on how to get information on the mapview functions that individual packages use.
Oh, I do this much more primitive, e.g. for sf
I use
rm -fr /tmp/rdeps
mkdir /tmp/rdeps
cp sf_*gz /tmp/rdeps
(cd /tmp/rdeps; _R_CHECK_FORCE_SUGGESTS_=FALSE R --save -e 'r <- tools::check_packages_in_dir(".", check_args = "--no-vignettes", reverse = list(which = "most", recursive = FALSE), Ncpus = 1)')
after which I examine r
and the check directories created. If you build in a .Deprecated
the offending packages will show up.
slideview should also be done https://github.com/r-spatial/slideview
Note that for now I've simply copied over all and any bits of code needed to make the packages work. This should give a good indication of what needs to go into a potential core package.
Actually thats seems not to much of code at all. On the other hand a fairly special compilation of functions for a standalone package...
Lets see what's needed to make the others work...
leafsync should also be done https://github.com/r-spatial/leafsync
@mtennekes heads-up regarding leafsync. Can you test whether this is enough to drop the mapview dependency in tmap? This is now very lightweight, no major dependencies anymore. Should significantly improve https://github.com/mtennekes/tmap/issues/240
CRAN seems very slow at the moment, especially for new packages. I've so far submitted leafsync
(about two weeks ago) and slideview
(just now), cubeview
to follow next. leafsync
is still in incoming/newbies
after one round of feedback. So this whole process may be rather time consuming.
Thanks for letting me know. Awesome work, Tim!
I'll ping you as soon as I get CRAN confirmation.
leafsync on CRAN ( @mtennekes ): https://cran.r-project.org/web/packages/leafsync/index.html
slideview on CRAN: https://cran.r-project.org/web/packages/slideview/index.html
cubeview on CRAN: https://cran.r-project.org/web/packages/cubeview/index.html
plainview on CRAN: https://cran.r-project.org/web/packages/plainview/index.html
leafpop on cran:
leafem re-submitted to CRAN after minor change request.
leafem
on CRAN:
https://cran.r-project.org/web/packages/leafem/index.html
Just pushed a major update of mapview reflecting all the above mentioned breakouts. Hopefully, this will take care of most things.
Updated mapview (2.7.0) with all things marked as deprecated now on CRAN
We now have all functions living somewhere else now marled as .Defunct
. One thing I'm not sure about is whether that is the end of the road or if there is another cycle where we're supposed to completely delete these functions from the package...
Currently, we still get the following:
master > library(leafem)
master > library(mapview)
GDAL version >= 3.1.0 | setting mapviewOptions(fgb = TRUE)
Attaching package: ‘mapview’
The following objects are masked from ‘package:leafem’:
addExtent, addFeatures, addHomeButton, addImageQuery, addLogo,
addMouseCoordinates, addStarsImage, addStaticLabels, garnishMap,
removeHomeButton, removeMouseCoordinates
which is informative, but not really necessary.
@edzer @rsbivand do you have experience with the process of deprecating functions?
I started splitting spdep into spdep with spatial weights and weight-based autocorrelation tests and spatialreg with model fitting functions. I had planned about 4 months of deprecation before flipping to the functions moved to spatialreg defunct in spdep, but got distracted by the Proj4 string meltdown. See https://github.com/r-spatial/spdep/issues/31 and "r-lib/pkgapi" to find reverse dependency use of functions and methods to be able to check what breaks (https://stat.ethz.ch/pipermail/r-package-devel/2019q1/003590.html).
Thanks for those pointers @rsbivand ! My hope is to be able to completely delete the functions. Especially as mapview is likely to be used in interactive mode only anyway. But we'll see what pkgapi will tell me.
Deprecate them, and write the deprecation date/version in a comment in the function when you do so. When you later run into it and the package has seen a few new versions, then you throw it all out. Very satisfying.
mapview has become quite a beast to maintain... Therefore, we should break several components out of the package into smaller packages - function (package):
addMouseCoordinates
(leafmv ???)other to-dos:
Likely, to avoid code duplications, we also need some sort of core package that provides functions used by any 2 of the above (incl. mapview). It might work to use
plainview
as the core package - needs to be imported bymapview
and should be ok to be imported bycubeview
andslideview
.I think we need to get rid of thesf
dependency inplainview
(useGDALutils
instead?).With
plainview
now on CRAN, I will eventually figure out if it could be used as the core package to avoid code duplication. Though, I wanna address at leastleafpop
before submittingmapview
with all functions marked as deprecated. After that, I think we can focus on cleaning things further.UPDATE: I am now more or less convinced that the way forward is to split core functions into both
plainview
andleafem
as there are functions and dependencies that are needed inplainview
but notleafem
and vice versa.mapview
imports both of these so from that point of view it will not matter where they reside.