marioangst / motifr

Motif analysis in multi-level networks
https://marioangst.github.io/motifr/
Other
13 stars 2 forks source link

Submit on CRAN #40

Closed tseppelt closed 3 years ago

tseppelt commented 4 years ago

Motifr shall be published on CRAN.

Consider this checklist. In particular, #28 and #30 need to be closed.

tseppelt commented 4 years ago

The next steps are to make

rhub::check_for_cran()
devtools::check_win_devel()

work. Unfortunately, there are some issues with Python. Maybe this helps.

tseppelt commented 4 years ago

This is the current situation:

Winbuilder

32bit fails, 64bit works:

* using log directory 'd:/RCompile/CRANguest/R-devel/motifr.Rcheck'
* using R Under development (unstable) (2020-08-28 r79089)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* checking for file 'motifr/DESCRIPTION' ... OK
* this is package 'motifr' version '0.2.0'
* package encoding: UTF-8
* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Mario Angst <t.seppelt@posteo.de>'

New submission

Possibly mis-spelled words in DESCRIPTION:
  SESMotifAnalyser (20:64)
  Seppelt (21:9)
  motifr (18:5)
  subgraphs (17:57)

Found the following (possibly) invalid URLs:
  URL: https://marioangst.github.io/motifr (moved to https://marioangst.github.io/motifr/)
    From: inst/doc/motif_zoo.html
          inst/doc/random_baselines.html
          README.md
    Status: 200
    Message: OK

The Description field should not start with the package name,
  'This package' or similar.
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking serialization versions ... OK
* checking whether package 'motifr' can be installed ... OK
* checking installed package size ... OK
* checking package directory ... OK
* checking for future file timestamps ... OK
* checking 'build' directory ... OK
* checking DESCRIPTION meta-information ... OK
* checking top-level files ... OK
* checking for left-over files ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for non-ASCII characters ... OK
* checking R files for syntax errors ... OK
* loading checks for arch 'i386'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* loading checks for arch 'x64'
** checking whether the package can be loaded ... OK
** checking whether the package can be loaded with stated dependencies ... OK
** checking whether the package can be unloaded cleanly ... OK
** checking whether the namespace can be loaded with stated dependencies ... OK
** checking whether the namespace can be unloaded cleanly ... OK
** checking loading without being on the library search path ... OK
** checking use of S3 registration ... OK
* checking dependencies in R code ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking R code for possible problems ... [13s] OK
* checking Rd files ... OK
* checking Rd metadata ... OK
* checking Rd line widths ... OK
* checking Rd cross-references ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* checking Rd contents ... OK
* checking for unstated dependencies in examples ... OK
* checking contents of 'data' directory ... OK
* checking data for non-ASCII characters ... OK
* checking data for ASCII and uncompressed saves ... OK
* checking installed files from 'inst/doc' ... OK
* checking files in 'vignettes' ... OK
* checking examples ...
** running examples for arch 'i386' ... [7s] ERROR
Running examples in 'motifr-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compare_to_baseline
> ### Title: Compare empirical network to random baseline
> ### Aliases: compare_to_baseline
> 
> ### ** Examples
> 
> compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)
Error: Your current architecture is 32bit; however, this version of Python was compiled for 64bit.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
Execution halted
** running examples for arch 'x64' ... [58s] NOTE
Examples with CPU (user + system) or elapsed time > 10s
                     user system elapsed
plot_critical_dyads 11.55   0.15   11.99
plot_gaps           11.59   0.04   11.83
* checking for unstated dependencies in 'tests' ... OK
* checking tests ...
** running tests for arch 'i386' ... [17s] ERROR
  Running 'testthat.R' [17s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(motifr)
  > 
  > test_check("motifr")
  -- 1. Error: count_motifs_1_2 (@test-count_motifs.R#2)  ------------------------
  Your current architecture is 32bit; however, this version of Python was compiled for 64bit.
  Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
  Backtrace:
    1. motifr::count_motifs(...)
    2. motifr::to_py_graph(net, lvl_attr = lvl_attr, directed = directed)
    4. reticulate:::`$.python.builtin.module`(sma, "translateGraph")
    5. reticulate:::py_resolve_module_proxy(x)
    6. reticulate::py_config_error_message(...)
    7. reticulate::py_config()
    8. reticulate:::ensure_python_initialized()
    9. reticulate:::initialize_python(required_module, use_environment)
   10. reticulate:::python_not_found(msg)

  -- 2. Error: count_motifs_multiple (@test-count_motifs.R#16)  ------------------
  Your current architecture is 32bit; however, this version of Python was compiled for 64bit.
  Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
  Backtrace:
    1. motifr::count_motifs(dummy_net, motifs = motifs)
    2. motifr::to_py_graph(net, lvl_attr = lvl_attr, directed = directed)
    4. reticulate:::`$.python.builtin.module`(sma, "translateGraph")
    5. reticulate:::py_resolve_module_proxy(x)
    6. reticulate::py_config_error_message(...)
    7. reticulate::py_config()
    8. reticulate:::ensure_python_initialized()
    9. reticulate:::initialize_python(required_module, use_environment)
   10. reticulate:::python_not_found(msg)

  == testthat results  ===========================================================
  [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Error: count_motifs_1_2 (@test-count_motifs.R#2) 
  2. Error: count_motifs_multiple (@test-count_motifs.R#16) 

  Error: testthat unit tests failed
  Execution halted
** running tests for arch 'x64' ... [10s] OK
  Running 'testthat.R' [10s]
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in 'inst/doc' ... OK
* checking re-building of vignette outputs ... [219s] OK
* checking PDF version of manual ... OK
* checking for detritus in the temp directory ... OK
* DONE
Status: 2 ERRORs, 2 NOTEs

rhub

Ubuntu Linux 16.04 LTS, R-release, GCC

* checking examples ... ERROR
Running examples in ‘motifr-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compare_to_baseline
> ### Title: Compare empirical network to random baseline
> ### Aliases: compare_to_baseline
> 
> ### ** Examples
> 
> compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)
Error: Python shared library not found, Python bindings not loaded.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
Execution halted

* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
    4. reticulate:::`$.python.builtin.module`(sma, "translateGraph")
    5. reticulate:::py_resolve_module_proxy(x)
    6. reticulate::py_config_error_message(...)
    7. reticulate::py_config()
    8. reticulate:::ensure_python_initialized()
    9. reticulate:::initialize_python(required_module, use_environment)
   10. reticulate:::python_not_found("Python shared library not found, Python bindings not loaded.")

  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Error: count_motifs_1_2 (@test-count_motifs.R#2) 
  2. Error: count_motifs_multiple (@test-count_motifs.R#16) 

  Error: testthat unit tests failed
  Execution halted

Windows Server 2008 R2 SP1, R-devel, 32/64 bit

64bit fails Installation of Python not found, Python bindings not loaded.

* checking examples ... ERROR
Running examples in 'motifr-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compare_to_baseline
> 
> ### ** Examples
> ### Aliases: compare_to_baseline
> 
> compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)
Error: Installation of Python not found, Python bindings not loaded.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
> ### Title: Compare empirical network to random baseline
Execution halted

* checking tests ...
  Running 'testthat.R'
 ERROR
Running the tests in 'tests/testthat.R' failed.
Last 13 lines of output:
    4. reticulate:::`$.python.builtin.module`(sma, "translateGraph")
    6. reticulate::py_config_error_message(...)
    5. reticulate:::py_resolve_module_proxy(x)
    7. reticulate::py_config()
    8. reticulate:::ensure_python_initialized()
    9. reticulate:::initialize_python(required_module, use_environment)
   10. reticulate:::python_not_found("Installation of Python not found, Python bindings not loaded.")

  == testthat results  ===========================================================
  [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Error: count_motifs_1_2 (@test-count_motifs.R#2) 
  2. Error: count_motifs_multiple (@test-count_motifs.R#16) 

  Error: testthat unit tests failed
  Execution halted

Fedora Linux, R-devel, clang, gfortran

* checking examples ... ERROR
Running examples in ‘motifr-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: compare_to_baseline
> ### Title: Compare empirical network to random baseline
> ### Aliases: compare_to_baseline
> 
> ### ** Examples
> 
> compare_to_baseline(ml_net, list("1,2[I.C]", "1,2[II.C]"), directed = FALSE)
Error: Python module sma was not found.

Detected Python configuration:

python:         /usr/bin/python3
libpython:      /usr/lib64/libpython3.8.so.1.0
pythonhome:     //usr://usr
version:        3.8.5 (default, Aug 12 2020, 00:00:00)  [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
numpy:           [NOT FOUND]
networkx:       [NOT FOUND]

python versions found: 
 /usr/bin/python3
 /usr/bin/python

Execution halted

* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
   /usr/bin/python

  Backtrace:
   1. motifr::count_motifs(dummy_net, motifs = motifs)
   2. motifr::to_py_graph(net, lvl_attr = lvl_attr, directed = directed)
   4. reticulate:::`$.python.builtin.module`(sma, "translateGraph")
   5. reticulate:::py_resolve_module_proxy(x)

  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 2 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 2 ]
  1. Error: count_motifs_1_2 (@test-count_motifs.R#2) 
  2. Error: count_motifs_multiple (@test-count_motifs.R#16) 

  Error: testthat unit tests failed
  Execution halted

WARNINGS:

* checking re-building of vignette outputs ... WARNING
Error(s) in re-building vignettes:
--- re-building ‘motif_zoo.Rmd’ using rmarkdown
Quitting from lines 40-41 (motif_zoo.Rmd) 
Error: processing vignette 'motif_zoo.Rmd' failed with diagnostics:
Python module sma was not found.

Detected Python configuration:

python:         /usr/bin/python3
libpython:      /usr/lib64/libpython3.8.so.1.0
pythonhome:     //usr://usr
version:        3.8.5 (default, Aug 12 2020, 00:00:00)  [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
numpy:           [NOT FOUND]
networkx:       [NOT FOUND]

python versions found: 
 /usr/bin/python3
 /usr/bin/python

--- failed re-building ‘motif_zoo.Rmd’

--- re-building ‘random_baselines.Rmd’ using rmarkdown
Quitting from lines 49-50 (random_baselines.Rmd) 
Error: processing vignette 'random_baselines.Rmd' failed with diagnostics:
Python module sma was not found.

Detected Python configuration:

python:         /usr/bin/python3
libpython:      /usr/lib64/libpython3.8.so.1.0
pythonhome:     //usr://usr
version:        3.8.5 (default, Aug 12 2020, 00:00:00)  [GCC 10.2.1 20200723 (Red Hat 10.2.1-1)]
numpy:           [NOT FOUND]
networkx:       [NOT FOUND]

python versions found: 
 /usr/bin/python3
 /usr/bin/python
marioangst commented 4 years ago

I am looking around for another package that interfaces a Python module, uses reticulate and is on CRAN. For now, did not find anything.

The R package tensorflow works by requiring the user to call install_tensorflow() after installing the package, which then calls reticulate::py_install() https://github.com/rstudio/tensorflow/blob/master/R/install.R

They then seem to bypass a lot of their tests by using skip_if_no_tensorflow. So I wonder if a lot of this testing is thus only local and not on rhub? Bit confused.

tseppelt commented 4 years ago

I've looked for other packages depending on reticulate. See this list:

I'm trying to use SystemRequirements now to make the rhub checks work.

Update: SystemRequirements didn't help much…

tseppelt commented 4 years ago

See this tutorial.

R CMD check --as-cran

passes (for me after apt install qpdf). @marioangst I think we could try our luck with cran once the package is ready.

marioangst commented 4 years ago

amazing @tseppelt ! 🥳 qpdf was an issue for me as well. good for you that you are on linux, the windows fix is a bit silly. I will leave this issue open for the moment

tseppelt commented 3 years ago

The problem with cran was that because of missing Python dependencies our examples and vignettes could not be build and our tests could not be run. In order to overcome these problems, let's skip tests if sma is not available (be695ff) and don't run examples that depend on Python (0082661). Following https://www.r-bloggers.com/2020/06/optimal-workflows-for-package-vignettes/, vignettes are now (1d0a7ed) pre-build. Hopefully, this suffices to let the cran tests pass.

marioangst commented 3 years ago

submitted today. Let's hope, it seems to have passed the initial automated tests at least. Bit sketchy that CRAN does not require dependency tests though.