jefferislab / RANN

R package providing fast nearest neighbour search (wraps ANN library)
http://jefferislab.github.io/RANN/
58 stars 13 forks source link

RANN.L1 remote dependency #31

Open combiz opened 4 years ago

combiz commented 4 years ago

I'm creating a package which requires "RANN.L1" as a dependency. The package "RANN.L1" is therefore listed under Imports: in the DESCRIPTION file of the package, and the remote dependency location is specified as jefferis/RANN@master-L1 under Remotes: in the same file. However, as RANN.L1 is a branch of the RANN repo, the package build under Travis CI fails, presumably as it can't associate the "RANN.L1" import with the "RANN" remote. Any suggestions? Having the jefferis/RANN@master-L1 branch as a separate repo under jefferis/RANN.L1 could be a quick fix? Thanks.

combiz commented 4 years ago

tl;dr Would be useful if the RANN.L1 package, currently stored in a branch of RANN, could be copied to its own separate repo at jefferislab/RANN.L1 to match the convention of account/packagename expected by various dev packages in R. Would help to avoid issues like the below (produced by r-lib/pkgdepends): -

 x Cannot install `MacoskoLab/liger`.
    - Cannot install dependency jefferis/RANN@master-L1

Thanks!

jefferis commented 4 years ago

@krlmlr you had a strategy for this I think?

krlmlr commented 4 years ago

In #30, I suggested to re-unify the codebases so that L1 is available from {RANN}. Would that work?

combiz commented 4 years ago

If the master branch of a new repo at jefferis/RANN.L1 could have the contents of the jefferis/RANN@master-L1 branch it would provide a quick fix.

jefferis commented 4 years ago

Can we give @krlmlr the option to try and get things working in one package. Having two repos would be a retrograde step when we are trying to rationalise two separate packages.

combiz commented 4 years ago

Sounds like an optimal solution, thanks!

krlmlr commented 4 years ago

@combiz: For me, remotes::install_github("jefferis/RANN@master-L1") works, and so should the Remotes: entry in the package you're referring to. Perhaps the installation failure has a different reason? Could you point me to the failing CI run?

combiz commented 4 years ago

remotes::install_github("jefferis/RANN@master-L1") works ok locally for me. The issues arise with packages like roxygen2/pak/pkgdepends which seem to expect the R package name and repo name to match (e.g. https://github.com/jefferislab/RANN/issues/31#issuecomment-592227966). e.g.

devtools::install_github("r-lib/pkgdepends")
pd <- new_pkg_deps("MacoskoLab/liger")
pd$solve()
pd$draw()
Error: Cannot install packages:
  x Cannot install `MacoskoLab/liger`.
    - Cannot install dependency jefferis/RANN@master-L1
hughrmacmillan commented 2 years ago

Hi friends... thank you for you RANN (and RANN.L1)! I'm curious about use of Lp for p = [ .... drum roll .... ] 1/2.

It looks possible to hotwire the RANN tarball library by commenting out / uncommenting in at that spot in ANN.h and running R CMD SHLIB ... but that would be a first for me, and I ran across this thread and thought I'd ask if "rationalising" (as @jefferis put it) RANN to run ANN with different p value options was in the cards. Thanks again for your contributions! Cheers!

jefferis commented 2 years ago

See the ANN manual for metrics that are supported out of the box. Not including 1/2 https://www.cs.umd.edu/~mount/ANN/Files/1.1.2/ANNmanual_1.1.pdf A1245F2A-A595-4353-946E-C7FF8A5B8B8E

hughrmacmillan commented 2 years ago

Right. Yes, I'd seen this ... there's no triangle inequality and hence no "metric" with 0 < p < 1 but the quantities from these "fractional" p distances can still be used to define neighborhoods around query points for ANN search. There's some literature on such fractional distances helping with the curse of dimensionality story in the 20-50 dimension range, hence my curiosity. Cheers!