Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Jul 22, 2024
1 parent 8d9f3fa commit 53c554d
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 40 deletions.
46 changes: 24 additions & 22 deletions .devel/roxygen2-patch.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
# Copyleft (C) 2020-2022, Marek Gagolewski <https://www.gagolewski.com>
# Adding author and other metadata to every Rd file
# Copyleft (C) 2021-2024, Marek Gagolewski <https://www.gagolewski.com>
# Adding author and other metadata to every Rd file;
# There is one and only one official manual. Ad- and tracker-free.
# Enjoy the free internet.

library("roxygen2")

postprocess_contents <- function(contents)
{
stopifnot(is.character(contents), length(contents)==1, !is.na(contents))

if (!stringi::stri_detect_regex(
contents, "% Please edit documentation in R/.*\\\\name", dotall=TRUE)
) return(contents)

if (!stringi::stri_detect_fixed(contents, "\\author")) {
contents <- stringi::stri_paste(contents,
"\\author{\n",
"\\href{https://www.gagolewski.com/}{Marek Gagolewski} ",
"and other contributors\n",
"}\n")
}

# There is one and only one official manual. Ad- and tracker-free.
# Enjoy the free internet.
author <- "\\href{https://www.gagolewski.com/}{Marek Gagolewski} and other contributors\n"

seealso <- stringi::stri_paste(
"The official online manual of \\pkg{genieclust} at ",
Expand All @@ -33,6 +22,17 @@ postprocess_contents <- function(contents)
"\n"
)

if (!stringi::stri_detect_regex(
contents, "% Please edit documentation in R/.*\\\\name", dotall=TRUE) # fixed comment generated by roxugen2
) return(contents)

if (!stringi::stri_detect_fixed(contents, "\\author")) {
contents <- stringi::stri_paste(contents,
"\\author{\n",
author,
"}\n")
}

if (!stringi::stri_detect_fixed(contents, "\\seealso{\n")) {
contents <- stringi::stri_paste(
contents,
Expand All @@ -52,15 +52,15 @@ postprocess_contents <- function(contents)

# ########################################################################### #

# taken from roxygen2 7.2.1 by Hadley Wickham et al.
write_if_different <- function (path, contents, href = NULL, check = TRUE)
# taken from roxygen2 7.3.2 by Hadley Wickham et al.
write_if_different <- function (path, contents, command=NULL, check=TRUE)
{
if (!file.exists(dirname(path))) {
dir.create(dirname(path), showWarnings = FALSE)
}
name <- basename(path)
if (check && !made_by_roxygen(path)) {
cli::cli_warn(c("Skipping {.path {name}}", x = "It already exists and was not generated by roxygen2."))
cli::cli_inform(c(x = "Skipping {.path {name}}", i = "It already exists and was not generated by roxygen2."))
return(FALSE)
}
line_ending <- detect_line_ending(path)
Expand All @@ -75,12 +75,14 @@ write_if_different <- function (path, contents, href = NULL, check = TRUE)


if (!str_detect(name, "^[a-zA-Z][a-zA-Z0-9_.-]*$")) {
cli::cli_warn(c("Skipping {.path {name}}", x = "Invalid file name"))
cli::cli_inform(c(x = "Skipping {.path {name}}", i = "Invalid file name"))
FALSE
}
else {
if (!is.null(href)) {
name <- cli::style_hyperlink(name, href)
if (!is.null(command)) {
scheme <- "x-r-run"
url <- paste0(scheme, ":", command)
name <- cli::style_hyperlink(name, url)
}
cli::cli_inform("Writing {.path {name}}")
writeBin(charToRaw(contents), path)
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: genieclust
Type: Package
Title: Fast and Robust Hierarchical Clustering with Noise Points Detection
Version: 1.1.5-9001
Date: 2024-06-17
Version: 1.1.5-9002
Date: 2024-07-22
Authors@R: c(
person("Marek", "Gagolewski",
role = c("aut", "cre", "cph"),
Expand Down Expand Up @@ -49,4 +49,4 @@ Suggests:
LinkingTo: Rcpp
Encoding: UTF-8
SystemRequirements: OpenMP
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
2 changes: 1 addition & 1 deletion genieclust/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# ############################################################################ #

# version string, e.g., "1.0.0.9001" or "1.1.1"
__version__ = "1.1.5.9001"
__version__ = "1.1.5.9002"


from . import plots
Expand Down
3 changes: 2 additions & 1 deletion genieclust/cluster_validity.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ For even more details, see the
# ############################################################################ #


cimport numpy as np
import numpy as np
cimport numpy as np
np.import_array()
from . cimport c_compare_partitions
from . cimport c_cvi

Expand Down
3 changes: 2 additions & 1 deletion genieclust/compare_partitions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ For more details, see the
# ############################################################################ #


cimport numpy as np
import numpy as np
cimport numpy as np
np.import_array()
from . cimport c_compare_partitions


Expand Down
4 changes: 2 additions & 2 deletions genieclust/inequality.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ Inequality measures
# ############################################################################ #


cimport cython
cimport numpy as np
import numpy as np
cimport numpy as np
np.import_array()
from . cimport c_inequality

ctypedef fused T:
Expand Down
6 changes: 2 additions & 4 deletions genieclust/internal.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ Internal functions and classes
# ############################################################################ #




cimport cython
cimport numpy as np
import numpy as np
cimport numpy as np
np.import_array()
import os

cimport libc.math
Expand Down
8 changes: 2 additions & 6 deletions genieclust/tools.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,9 @@ Functions one might find useful, but not necessarily
# ############################################################################ #






cimport cython
cimport numpy as np
import numpy as np
cimport numpy as np
np.import_array()


cimport libc.math
Expand Down
1 change: 1 addition & 0 deletions man/genieclust-package.Rd

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

0 comments on commit 53c554d

Please sign in to comment.