Skip to content

Commit

Permalink
Merge pull request #1 from swarm-lab/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
sjmgarnier authored Jan 8, 2024
2 parents b6f1bed + f6918db commit c172136
Show file tree
Hide file tree
Showing 16 changed files with 187 additions and 68 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ logo.*
^pkgdown$
cran-comments.md
^CRAN-SUBMISSION$
^codecov\.yml$
revdep
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: CEC
Type: Package
Title: Cross-Entropy Clustering
Version: 0.11.0
Date: 2022-12-12
Version: 0.11.1
Date: 2024-01-08
Authors@R: c(
person("Kamieniecki", "Konrad", email = "[email protected]",
role = c("aut")),
Expand All @@ -29,6 +29,7 @@ Imports:
stats,
utils
NeedsCompilation: yes
SystemRequirements: C++11
License: GPL-3
RoxygenNote: 7.2.3
Suggests:
covr
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# CEC v0.11.1

## New features

* N/A.

## Minor improvements and fixes

* Fixing new CRAN check errors.

---

# CEC v0.11.0

## New features
Expand Down
4 changes: 2 additions & 2 deletions R/cec.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#'
#' @param x A numeric matrix of data. Each row corresponds to a distinct
#' observation; each column corresponds to a distinct variable/dimension. It
#' must not contain \code{NA} values.
#' must not contain \code{NA} values.
#'
#' @param centers Either a matrix of initial centers or the number of initial
#' centers (\code{k}, single number \code{cec(data, 4, ...)}) or a vector for
Expand Down Expand Up @@ -128,7 +128,7 @@
#' implementations of \emph{\strong{H}} have been proposed (expressed as a type
#' - model - of the clustering):
#'
#' \itemize{
#' \describe{
#' \item{"all": }{All Gaussian densities. Data will form ellipsoids with
#' arbitrary radiuses.}
#' \item{"covariance": }{Gaussian densities with a fixed given covariance. The
Expand Down
5 changes: 2 additions & 3 deletions R/init.centers.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
#'
#' @param method A character string indicating the initialization method to use.
#' It can take the following values:
#' \itemize{
#' \item{"kmeans++": }{the centers are selected using the k-means++ algorithm.
#' }
#' \describe{
#' \item{"kmeans++": }{the centers are selected using the k-means++ algorithm.}
#' \item{"random": }{the centers are randomly selected among the values in
#' \code{x}}
#' }
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

<!-- badges: start -->
[![R-CMD-check](https://github.com/swarm-lab/cec/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/swarm-lab/cec/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/CEC)](https://CRAN.R-project.org/package=CEC)
[![CRANLOGS downloads](https://cranlogs.r-pkg.org/badges/cec)](https://cran.r-project.org/package=cec)
[![Codecov test coverage](https://codecov.io/gh/swarm-lab/cec/branch/master/graph/badge.svg)](https://app.codecov.io/gh/swarm-lab/cec?branch=master)
[![CRAN status](https://www.r-pkg.org/badges/version/CEC)](https://cran.r-project.org/package=CEC)
[![CRANLOGS downloads](https://cranlogs.r-pkg.org/badges/cec)](https://cran.r-project.org/package=CEC)
<!-- badges: end -->

## Description
Expand Down
14 changes: 14 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
comment: false

coverage:
status:
project:
default:
target: auto
threshold: 1%
informational: true
patch:
default:
target: auto
threshold: 1%
informational: true
104 changes: 56 additions & 48 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Test environments

* local M1 OS X 13.0.1, R 4.2.2
* local M1 OS X 13.0.1, R-devel
* local M1 OS X 14.1.1, R 4.3.2
* local M1 OS X 14.1.1, R-devel
* Github Actions "windows-latest (release)"
* Github Actions "macOS-latest (release)"
* Github Actions "ubuntu-latest (release)"
Expand All @@ -10,62 +10,70 @@
* r-hub Windows Server 2022, R-devel, 64 bit
* r-hub Ubuntu Linux 20.04.1 LTS, R-release, GCC
* r-hub Fedora Linux, R-devel, clang, gfortran
* r-hub Debian Linux, R-devel, GCC ASAN/UBSAN
* win-builder.r-project.org

## R CMD check results

There were no ERRORs or WARNINGs.

"Possibly misspelled words in DESCRIPTION:
CEC (16:17, 19:5)
Spurek (19:33)"

These are the correct spellings.

"Found the following (possibly) invalid URLs:
URL:
From: README.md
Message: Empty URL"

Fixed.

## Downstream dependencies

There are currently no downstream dependencies for this package.

## CRAN team comments

"Please always write package names, software names and API (application
programming interface) names in single quotes in title and description.
e.g: --> 'CEC'
Please note that package names are case sensitive."
Downstream dependencies on CRAN and Bioconductor were checked with ‘revdepcheck::revdep_check()’. We checked 1 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

Fixed.
* We saw 0 new problems
* We failed to check 0 packages

"Please do not use on.exit() to reset user's options(), working directory
or par() after you changed it in examples and vignettes and demos. e.g.:
man/cec.Rd
Please reset in the following way
e.g.:
oldpar <- par(mfrow = c(1,2))
...
par(oldpar)"
## CRAN team comments

Fixed.
This submission fixes the following CRAN check issues:

Version: 0.11.0
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
cec_r.cpp:65:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:75:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:123:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:133:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:160:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:167:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
See ‘/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/CEC.Rcheck/00install.out’ for details.
* used C++ compiler: ‘Debian clang version 17.0.5 (1)’
Flavor: r-devel-linux-x86_64-debian-clang

Version: 0.11.0
Check: C++ specification
Result: NOTE
Specified C++11: please drop specification unless essential
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-release-windows-x86_64

Version: 0.11.0
Check: Rd files
Result: NOTE
checkRd: (-1) cec.Rd:164-165: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:166-168: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:169-172: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:173-175: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:176-177: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:178-180: Lost braces in \itemize; meant \describe ?
checkRd: (-1) cec.Rd:181-182: Lost braces in \itemize; meant \describe ?
checkRd: (-1) init.centers.Rd:19-20: Lost braces in \itemize; meant \describe ?
checkRd: (-1) init.centers.Rd:21-22: Lost braces in \itemize; meant \describe ?
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc

Version: 0.11.0
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
cec_r.cpp:65:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:75:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:123:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:133:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:160:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
cec_r.cpp:167:15: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
See ‘/data/gannet/ripley/R/packages/tests-clang/CEC.Rcheck/00install.out’ for details.
* used C++ compiler: ‘clang version 17.0.5’
Flavor: r-devel-linux-x86_64-fedora-clang

---

The package appeared to have been "orphaned" and I am "adopting" it as new
maintainer. CRAN check errors were not corrected for months, there has not been
any activity on the package's GitHub repository in more than a year, and the
previous maintainer have not replied to my or others' messages to fix the check
errors.

I have conserved the attribution structure of the package and just added myself
as the new maintainer. I have also fixed the check errors, updated the
documentation, and made code modifications that do not alter the usage of
user-facing functions or modify their output for maintaining continuity with the
previous versions of the package on CRAN.

If this "adoption" is not acceptable for CRAN policies, please disregard this
submission.
2 changes: 1 addition & 1 deletion man/cec.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions man/init.centers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions revdep/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Platform

|field |value |
|:--------|:------------------------------------------|
|version |R version 4.3.2 (2023-10-31) |
|os |macOS Sonoma 14.1.2 |
|system |aarch64, darwin20 |
|ui |RStudio |
|language |(EN) |
|collate |en_US.UTF-8 |
|ctype |en_US.UTF-8 |
|tz |America/New_York |
|date |2023-12-02 |
|rstudio |2023.09.1+494 Desert Sunflower (desktop) |
|pandoc |3.1.9 @ /opt/homebrew/bin/ (via rmarkdown) |

# Dependencies

|package |old |new |Δ |
|:-------|:------|:------|:--|
|CEC |0.11.0 |0.11.1 |* |

# Revdeps

7 changes: 7 additions & 0 deletions revdep/cran.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## revdepcheck results

We checked 1 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages

1 change: 1 addition & 0 deletions revdep/failures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Wow, no problems at all. :)*
1 change: 1 addition & 0 deletions revdep/problems.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*Wow, no problems at all. :)*
12 changes: 6 additions & 6 deletions src/cec_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SEXP cec_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP models_par
}

if (ex_what)
error(ex_what);
error("%s", ex_what);

try {
SEXP r_res;
Expand All @@ -72,7 +72,7 @@ SEXP cec_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP models_par
} catch (std::exception &ex) {
ex_what = ex.what();
}
error(ex_what);
error("%s", ex_what);
}

extern "C"
Expand Down Expand Up @@ -120,7 +120,7 @@ SEXP cec_split_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP mode
}

if (ex_what)
error(ex_what);
error("%s", ex_what);

try {
SEXP r_res;
Expand All @@ -130,7 +130,7 @@ SEXP cec_split_r(SEXP x_r, SEXP centers_param_r, SEXP control_param_r, SEXP mode
} catch (std::exception &ex) {
ex_what = ex.what();
}
error(ex_what);
error("%s", ex_what);
}

extern "C"
Expand All @@ -157,14 +157,14 @@ SEXP cec_init_centers_r(SEXP x_r, SEXP k_r, SEXP method_r) {
}

if (ex_what)
error(ex_what);
error("%s", ex_what);

try {
SEXP r_res = put(*res);
return r_res;
} catch (exception &ex) {
ex_what = ex.what();
error(ex_what);
error("%s", ex_what);
}
}

Expand Down

0 comments on commit c172136

Please sign in to comment.