Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
^man/figures$
^tests/build-testing.R
^CRAN-SUBMISSION$
^dev$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
82 changes: 82 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
RGL_USE_NULL: true
_R_CHECK_FORCE_SUGGESTS_: true
_R_CHECK_CRAN_INCOMING_: ${{ matrix.config.r == 'devel' && 'true' || 'false' }}

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}

- name: Start a virtual display for Tcl/Tk
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb tidy
Xvfb :99 -screen 0 1280x1024x24 &
echo "DISPLAY=:99" >> "$GITHUB_ENV"

- name: Install XQuartz and start a virtual display
if: runner.os == 'macOS'
run: |
brew install --cask xquartz
/opt/X11/bin/Xvfb :99 -screen 0 1280x1024x24 &
echo "DISPLAY=:99" >> "$GITHUB_ENV"

- uses: r-lib/actions/setup-tinytex@v2

- name: Install the Courier font used in the PDF manual
run: tlmgr install courier makeindex

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, any::V8
needs: check

- name: Use R's LaTeX emulation on Windows
if: runner.os == 'Windows'
run: |
cat('options(texi2dvi = "emulation")\n', file = "~/.Rprofile", append = TRUE)
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
env:
NOT_CRAN: false
with:
upload-snapshots: true
args: '"--as-cran"'
build_args: 'character()'
upload-results: true
67 changes: 67 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# 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:

name: test-coverage.yaml

permissions: read-all

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

steps:
- uses: actions/checkout@v6

- uses: r-lib/actions/setup-r@v2

- name: Start a virtual display for Tcl/Tk
run: |
sudo apt-get install -y xvfb
Xvfb :99 -screen 0 1280x1024x24 &
echo "DISPLAY=:99" >> "$GITHUB_ENV"

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

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- 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@v7
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ inst/doc

#exploratory
exploration
scratch.R

#Rcpp files
src/*.o
src/*.so
src/*.dll
packrat/lib*/
CMB_map_smica1024.fits
CMB_map_smica1024.fits
3 changes: 0 additions & 3 deletions CRAN-SUBMISSION

This file was deleted.

9 changes: 3 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: rcosmo
URL: https://github.com/frycast/rcosmo
BugReports: https://github.com/frycast/rcosmo/issues
Title: Cosmic Microwave Background Data Analysis
Version: 1.1.4
Version: 1.1.5
Authors@R: c(person("Daniel", "Fryer",
role = c("aut", "cre"),
email = "d.fryer@latrobe.edu.au",
Expand All @@ -18,7 +18,7 @@ Authors@R: c(person("Daniel", "Fryer",
role = "aut"))
Description: Handling and Analysing Spherical,
HEALPix and Cosmic Microwave Background data on a HEALPix grid.
Depends: R (>= 3.4.0)
Depends: R (>= 4.5.0)
License: GPL-3 | file LICENSE
Encoding: UTF-8
LazyData: true
Expand All @@ -33,10 +33,7 @@ Imports:
geoR (>= 1.7-5.2.1),
nnls (>= 1.4)
Suggests:
knitr,
rmarkdown,
testthat,
R.rsp,
gsl
LinkingTo: Rcpp
RoxygenNote: 7.2.1
Config/roxygen2/version: 8.0.0
6 changes: 6 additions & 0 deletions NEWS.md

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

4 changes: 2 additions & 2 deletions R/CMBDat.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' These are lists containing header information and other metadata as well
#' as an element called data, whose columns may include, for example, the
#' intensity (I), polarisation (Q, U), PMASK and TMASK. It also may contain an
#' \code{\link{mmap}} object that points to the CMB map data table in the FITS
#' \code{\link[mmap:mmap]{mmap}} object that points to the CMB map data table in the FITS
#' file.
#'
#'@param filename The path to the fits file.
Expand All @@ -16,7 +16,7 @@
#'If \code{mmap = FALSE} then a \code{data.frame} is
#'included, named \code{data}, whose columns may include, for
#'example, the intensity (I), polarisation (Q, U), PMASK and TMASK.
#'If \code{mmap = TRUE} then a \code{\link{mmap}} object is returned
#'If \code{mmap = TRUE} then a \code{\link[mmap:mmap]{mmap}} object is returned
#'that points to the CMB map data table in the FITS file.
#'
#'@examples
Expand Down
4 changes: 2 additions & 2 deletions R/CMBDataFrameGenerics.R
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@ coords.CMBDataFrame <- function( x, new.coords, ... )
#'@param depth_test The depth test to be applied to the
#' plotted points. This controls how resistant the plotted
#' object is to being obscured. See \code{\link[rgl]{rgl.material}}
#'@param lab_depth_test The \code{\link{rgl}} depth test
#'@param lab_depth_test The \code{\link[rgl:rgl.material]{rgl}} depth test
#' to be applied to the labels and pixel boundaries if present.
#' See \code{\link[rgl]{rgl.material}}
#'@param ... Arguments passed to rgl::plot3d.
Expand Down Expand Up @@ -1352,7 +1352,7 @@ print.summary.CMBDataFrame <- function(x, ...)
#' This function neatly prints the contents of a CMBDataFrame.
#'
#'@param x A \code{\link{CMBDataFrame}}.
#'@param ... arguments passed to \code{\link{print.tbl_df}}
#'@param ... arguments passed to \code{\link[tibble:print.tbl_df]{print.tbl_df}}
#'
#'@return
#'Prints contents of the CMB data frame to the console.
Expand Down
4 changes: 2 additions & 2 deletions R/HPDataFrame.R
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ nside.HPDataFrame <- function( x ) {
#'@param depth_test The depth test to be applied to the
#' plotted points. This controls how resistant the plotted
#' object is to being obscured. This controls how resistant the plotted
#'@param lab_depth_test The \code{\link{rgl}} depth test
#'@param lab_depth_test The \code{\link[rgl:rgl.material]{rgl}} depth test
#' to be applied to the labels and pixel boundaries
#' if present. See \code{\link[rgl]{rgl.material}}
#'@param ... arguments passed to rgl::plot3d
Expand Down Expand Up @@ -783,7 +783,7 @@ is.HPDataFrame <- function(hpdf) {
#' This function neatly prints the contents of a HPDataFrame.
#'
#'@param x A HPDataFrame.
#'@param ... arguments passed to \code{\link{print.tbl_df}}
#'@param ... arguments passed to \code{\link[tibble:print.tbl_df]{print.tbl_df}}
#'
#'@return
#'Prints contents of the HPDataFrame to the console.
Expand Down
2 changes: 1 addition & 1 deletion R/NestSearch.R
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ onBPBoundary <- function(se, so, j)

#' Border pattern is resolution independent
#'
#' @param pype is the output of onBPBoundary
#' @param ptype is the output of onBPBoundary
#'
#' @return the output is useful as an index
#' to the output of baseNeighbours. It will
Expand Down
12 changes: 6 additions & 6 deletions R/Statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -866,20 +866,20 @@ qqnormWin <- function(cmbdf, win, intensities = "I")
#'
#'This function returns an estimated entropy for the specified
#'\code{\link{CMBDataFrame}} column \code{intensities} and \code{\link{CMBWindow}}
#'region. The functions employs the function \link{entropy} and uses histogram
#'region. The functions employs the function \link[entropy:entropy]{entropy} and uses histogram
#'counts of \code{intensities} for computations. All arguments of the standard
#'\link{entropy} can be used.
#'\link[entropy:entropy]{entropy} can be used.
#'
#'@param cmbdf A \code{\link{CMBDataFrame}}.
#'@param win A \code{\link{CMBWindow}}
#'@param intensities A \code{\link{CMBDataFrame}} column with measured values.
#'@param method A method to estimate entropy, see \link{entropy}
#'@param method A method to estimate entropy, see \link[entropy:entropy]{entropy}
#'
#'@return
#'
#'Estimated Shannon entropy for observations in \code{\link{CMBWindow}}
#'
#'@references \link{entropy}
#'@references \link[entropy:entropy]{entropy}
#'
#'@examples
#' ## Download the map first
Expand Down Expand Up @@ -911,7 +911,7 @@ entropyCMB <- function(cmbdf, win, intensities = "I", method)
#'
#'This function returns the empirical chi-squared statistic for \code{intensities}
#'observations from two \code{\link{CMBWindow}}s of the specified
#'\code{\link{CMBDataFrame}}. The functions employs the function \link{chi2.empirical} and uses histogram
#'\code{\link{CMBDataFrame}}. The functions employs the function \link[entropy:chi2.empirical]{chi2.empirical} and uses histogram
#'counts of \code{intensities} for computations.
#'
#'@param cmbdf A \code{\link{CMBDataFrame}}.
Expand All @@ -925,7 +925,7 @@ entropyCMB <- function(cmbdf, win, intensities = "I", method)
#'\code{\link{CMBWindow}}s. For small sample sizes and many zero counts
#'Chi-squared statistic is inefficient.
#'
#'@references \link{chi2.empirical}
#'@references \link[entropy:chi2.empirical]{chi2.empirical}
#'
#'@examples
#' ## Download the map first
Expand Down
3 changes: 1 addition & 2 deletions R/rcosmo.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@
#'@author Daniel Fryer \email{d.fryer@latrobe.edu.au},
#'Andriy Olenko \email{a.olenko@latrobe.edu.au}, Ming Li \email{Ming.Li@latrobe.edu.au},
#'Yuguang Wang.
#'@docType package
#'@name rcosmo
#'@importFrom Rcpp evalCpp
#'@useDynLib rcosmo, .registration = TRUE
#'@aliases rcosmo-package
NULL
"_PACKAGE"

2 changes: 2 additions & 0 deletions README.md

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

Loading
Loading