diff --git a/.Rbuildignore b/.Rbuildignore index 988e9bd..e461a4b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,9 +1,7 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.travis.yml README.md .crancompress vignettes/rsconnect rsconnect ^src/libprofit/src/.*\.o$ -^.appveyor\.yml$ diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 8d51283..0000000 --- a/.appveyor.yml +++ /dev/null @@ -1,55 +0,0 @@ -# DO NOT CHANGE the "init" and "install" sections below - -# Download script file from GitHub -init: - ps: | - $ErrorActionPreference = "Stop" - Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" - Import-Module '..\appveyor-tool.ps1' - -install: - ps: Bootstrap - -cache: - - C:\RLibrary - -# Adapt as necessary starting from here - -environment: - matrix: - - R_VERSION: release - BIOC_USE_DEVEL: FALSE - - -build_script: - - travis-tool.sh install_deps - - travis-tool.sh install_bioc_deps EBImage - - travis-tool.sh install_github asgr/celestial - - travis-tool.sh install_github asgr/magicaxis - - travis-tool.sh install_github asgr/ProFound - -test_script: - - travis-tool.sh run_tests - -on_failure: - - 7z a failure.zip *.Rcheck\* - - appveyor PushArtifact failure.zip - -artifacts: - - path: '*.Rcheck\**\*.log' - name: Logs - - - path: '*.Rcheck\**\*.out' - name: Logs - - - path: '*.Rcheck\**\*.fail' - name: Logs - - - path: '*.Rcheck\**\*.Rout' - name: Logs - - - path: '\*_*.tar.gz' - name: Bits - - - path: '\*_*.zip' - name: Bits diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..ba89c14 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,85 @@ +# +# GitHub Actions CI configuration file +# +# ICRAR - International Centre for Radio Astronomy Research +# (c) UWA - The University of Western Australia, 2016 +# Copyright by UWA (in the framework of the ICRAR) +# All rights reserved +# +# Contributed by Rodrigo Tobar +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +on: + push: + branches: [master] + pull_request: + branches: [master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + + permissions: + contents: read + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - 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 }} + use-public-rspm: true + + - name: Install system dependencies (Linux) + if: runner.os == 'Linux' + run: sudo apt-get install -y libfftw3-dev + + - name: Install system dependencies (macOS) + if: runner.os == 'macOS' + run: brew install fftw + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + dependencies: '"hard"' + extra-packages: any::rcmdcheck, any::knitr, any::rmarkdown + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e643f9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -# -# Travis CI configuration file -# -# ICRAR - International Centre for Radio Astronomy Research -# (c) UWA - The University of Western Australia, 2016 -# Copyright by UWA (in the framework of the ICRAR) -# All rights reserved -# -# Contributed by Rodrigo Tobar -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# - -# This should do it, there's no need to specify anything else -language: r -cache: packages -dist: xenial -services: [xvfb] - -# Build matrix -# We try at least one Linux and one MacOS environment -matrix: - include: - - os: linux - r: oldrel - - os: linux - r: release - - os: linux - r: devel - - os: osx - osx_image: xcode9.4 # OSX 10.13 - - os: osx - osx_image: xcode10 # OSX 10.13 - - os: osx - osx_image: xcode11 # OSX 10.14 - -# To build the vignettes we need rmarkdown -r_packages: rmarkdown - -# The pracma binary uploaded to CRAN is for R 3.4.3 (a pre-release as of this writing), -# and therefore we fail with WARNINGs about the package being compiled for a different R version -before_script: - - if [ "${TRAVIS_OS_NAME}" = "osx" ]; then Rscript -e "install.packages('pracma', type = 'source')"; fi - -# Additional packages that are not fetched from CRAN -# Care must be taken to specify the packages in their dependency order -bioc_packages: EBImage -r_github_packages: - - asgr/celestial - - asgr/magicaxis - - asgr/ProFound - -# ProFit benefits from having fftw3 -# nlopt-dev is needed to prevent the nlopt R package from downloading its own copy of nlopt, -# which fails in R <= 3.3 (its internal downloading mechanism doesn't support https, which gets -# deferred to libcurl's, which eventually fails to download a file from S3). -addons: - apt: - packages: - - libfftw3-dev - - libnlopt-dev - - devscripts -brew_packages: fftw diff --git a/DESCRIPTION b/DESCRIPTION index 9fb2adb..49d516f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -19,3 +19,8 @@ Depends: R (>= 3.0), Rfits (>= 1.8.0), magicaxis (>= 2.0.3) Imports: cubature, RColorBrewer, LaplacesDemon, methods, celestial (>= 1.4.1), checkmate Suggests: fftw, knitr, rmarkdown, ProFound (>= 1.15.0), sn, Highlander (>= 0.1.7), ProSpect VignetteBuilder: knitr +Remotes: + asgr/Rfits, + asgr/magicaxis, + asgr/celestial, + asgr/ProFound diff --git a/man/profitConvolvePSF.Rd b/man/profitConvolvePSF.Rd index 690f868..7e3f22e 100644 --- a/man/profitConvolvePSF.Rd +++ b/man/profitConvolvePSF.Rd @@ -52,6 +52,7 @@ Aaron Robotham & Dan Taranu \code{\link{profitBruteConv}}, \code{\link{profitMakePointSource}}, \code{\link{profitBenchmarkConv}} } \examples{ +\dontrun{ model = list( sersic = list( xcen = c(180, 60), @@ -83,6 +84,7 @@ magimage(profitConvolvePSF(model.image, psf, options=list(method='Bruteconv'))) magimage(profitConvolvePSF(model.image, psf, options=list(method='FFTconv', fft=temp$fft))) magimage(profitConvolvePSF(model.image, psf, options=list(method='FFTWconv', fft=temp$fft))) } +} % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \concept{ PSF} diff --git a/man/profitGetOpenCLEnvs.Rd b/man/profitGetOpenCLEnvs.Rd index 0cec4f1..e05d035 100644 --- a/man/profitGetOpenCLEnvs.Rd +++ b/man/profitGetOpenCLEnvs.Rd @@ -32,10 +32,12 @@ Dan Taranu \code{\link{profitBenchmark}}, \code{\link{profitMakeConvolver}}, \code{\link{profitOpenCLEnv}} } \examples{ +\dontrun{ envs = profitGetOpenCLEnvs(make.envs=FALSE) print(envs) str(envs) } +} % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \concept{ GPU } diff --git a/man/profitHasOpenCL.Rd b/man/profitHasOpenCL.Rd index 28b9423..5ec36e6 100644 --- a/man/profitHasOpenCL.Rd +++ b/man/profitHasOpenCL.Rd @@ -27,10 +27,12 @@ Rodrigo Tobar & Aaron Robotham \code{\link{profitOpenCLEnv}}, \code{\link{profitOpenCLEnvInfo}} } \examples{ +\dontrun{ profitHasOpenMP() profitHasOpenCL() profitHasFFTW() } +} % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{ OpenMP }% use one of RShowDoc("KEYWORDS") diff --git a/man/profitOpenCLEnv.Rd b/man/profitOpenCLEnv.Rd index a1d9c0c..9ee5f3c 100644 --- a/man/profitOpenCLEnv.Rd +++ b/man/profitOpenCLEnv.Rd @@ -64,7 +64,7 @@ magimage(profitMakeModel(modellist=modellist, dim=c(200,200))) \dontrun{ profitClearCache() -tempCL=profitOpenCLEnv() +tempCL = profitOpenCLEnv() magimage(profitMakeModel(modellist=modellist, dim=c(200,200), openclenv=tempCL)) } } diff --git a/man/profitOpenCLEnvInfo.Rd b/man/profitOpenCLEnvInfo.Rd index 565d97a..5b8083b 100644 --- a/man/profitOpenCLEnvInfo.Rd +++ b/man/profitOpenCLEnvInfo.Rd @@ -35,8 +35,10 @@ Rodrigo Tobar & Aaron Robotham \code{\link{profitOpenCLEnv}}, \code{\link{profitClearCache}} \code{\link{profitMakeModel}}, \code{\link{profitSetupData}} } \examples{ +\dontrun{ profitOpenCLEnvInfo() } +} % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \concept{ GPU }% use one of RShowDoc("KEYWORDS") diff --git a/vignettes/ProFit-Make-Model-Image.Rmd b/vignettes/ProFit-Make-Model-Image.Rmd index e0b64d6..0dd64cc 100644 --- a/vignettes/ProFit-Make-Model-Image.Rmd +++ b/vignettes/ProFit-Make-Model-Image.Rmd @@ -159,6 +159,7 @@ This fine sampling step required manual resampling of the PSF by rescaling re an We can use `profitMakeModel` to make more complex image structure very easily. The example model below will randomly produce 20 Sersic profiles, 10 PSFs and a sky background: ```{r} +set.seed(666) model2=list( sersic=list( xcen=runif(20,0,200), @@ -184,7 +185,7 @@ model2=list( As before we can run this through `profitMakeModel` and then plot the image. This should run in ~0.5 second, which means we are scaling well with our more complex model: ```{r, fig.width=5, fig.height=5, dpi=40} -system.time(ExampleImagePSF2<-profitMakeModel(modellist=model2, psf=ExamplePSF, dim=c(200,200))) +system.time({ExampleImagePSF2 = profitMakeModel(modellist=model2, psf=ExamplePSF, dim=c(200,200))}) magimage(ExampleImagePSF2, hi=1) ```