Skip to content

Commit

Permalink
Merge pull request #11 from JGCRI/main
Browse files Browse the repository at this point in the history
Update dev
  • Loading branch information
mengqi-z authored Jan 5, 2024
2 parents 926941a + 2bc630c commit b5e2afe
Show file tree
Hide file tree
Showing 72 changed files with 130,629 additions and 869 deletions.
51 changes: 24 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,53 @@ on:
jobs:
R-CMD:
runs-on: ${{ matrix.config.os }}

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

strategy:
fail-fast: false
matrix:
config:
- { os: windows-latest, r: 'devel'}
- { os: macos-10.15, r: 'devel'}
- { os: ubuntu-latest, r: 'devel', cran: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.PAT}}

steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@master
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2-branch
with:
r-version: '3.6'
- uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-tinytex@master
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- uses: r-lib/actions/setup-pandoc@v2-branch
- uses: r-lib/actions/setup-tinytex@v2-branch

- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Ubuntu config
if: startsWith(matrix.config.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libmagick++-dev libavfilter-dev
sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev libmagick++-dev
- name: MacOS Config
if: startsWith(matrix.config.os, 'macOS')
run: |
brew install pkg-config
brew install gdal
brew install geos
brew install imagemagick@6
brew install pkg-config
brew install gdal
- name: Install dependencies
run: |
install.packages(c("remotes","rcmdcheck"), repos = "https://cloud.r-project.org")
install.packages(c("remotes", "rcmdcheck"), repos = "https://cloud.r-project.org")
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

- name: Check
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
shell: Rscript {0}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ name: docs

jobs:
pkgdown:
runs-on: macOS-latest
runs-on: macOS-12
env:
GITHUB_PAT: ${{ secrets.PAT }}
steps:
- uses: actions/checkout@v2

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

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

- name: Query dependencies
run: |
Expand All @@ -30,7 +30,7 @@ jobs:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper/paper.md
- name: Upload
uses: actions/upload-artifact@v1
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper/paper.pdf
38 changes: 21 additions & 17 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,44 @@ on:
jobs:
build:
runs-on: ubuntu-latest

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.PAT}}

steps:
- uses: actions/checkout@v1
- uses: r-lib/actions/setup-r@master
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2-branch
with:
r-version: '3.6'
- uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-tinytex@master
- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
- uses: r-lib/actions/setup-pandoc@v2-branch
- uses: r-lib/actions/setup-tinytex@v2-branch

- name: Cache R packages
uses: actions/cache@v3
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Ubuntu config
run: |
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev libssl-dev libxml2-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libavfilter-dev
sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev libmagick++-dev
- name: Install dependencies
run: |
install.packages(c("remotes","rcmdcheck"), repos = "https://cloud.r-project.org")
remotes::install_deps(dependencies = TRUE)
remotes::install_deps(dependencies = TRUE, upgrade = "never")
shell: Rscript {0}

- name: Test coverage
run: |
remotes::install_cran("covr")
covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}

- name: Check for failures
if: failure()
run: exit 1
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ vignettes/*.pdf

# R Environment Variables
.Renviron
output
inst/doc
docs/
tests/testthat/output/
tests/testthat/_snaps
70 changes: 42 additions & 28 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
Package: helios
Title: Process heating and cooling degrees for GCAM
Version: 1.0.0
Authors@R: c(person("Zarrar", "Khan", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID ="0000-0002-8147-8553")),
person("Kalyn", "Dorheim", role = c("aut"), comment = c(ORCID="0000-0001-8093-8397")),
person("Paul", "Wolfram", role = c("aut")),
person("Chris", "Vernon", role = c("aut"), comment = c(ORCID="0000-0002-3406-6214")))
Description: Color palettes used by the Pacific Northwest National Laboratory - Joint Global Change Research Institute for maps and charts.
Authors@R: c(
person("Mengqi", "Zhao", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-5385-2758")),
person("Zarrar", "Khan", , "[email protected]", role = "aut",
comment = c(ORCID = "0000-0002-8147-8553")),
person("Kalyn", "Dorheim", role = "aut",
comment = c(ORCID = "0000-0001-8093-8397")),
person("Chris", "Vernon", role = "aut",
comment = c(ORCID = "0000-0002-3406-6214"))
)
Description: Heating and Cooling Degrees based on High Resolution Climate
Data.
License: BSD_2_clause + file LICENSE
URL: https://github.com/JGCRI/helios
BugReports: https://github.com/JGCRI/helios/issues
Depends: R (>= 2.10)
License: BSD_2_clause + file LICENSE
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.1
Depends:
R (>= 2.10)
Imports:
knitr,
ggplot2,
RColorBrewer,
dplyr,
tidyr,
markdown,
raster,
lubridate,
tibble,
ncdf4,
magrittr,
data.table,
gcamdata
data.table (>= 1.14.2),
dplyr (>= 1.0.10),
gcamdata (>= 5.1),
ggplot2 (>= 3.4.0),
knitr (>= 1.40),
lubridate (>= 1.8.0),
magrittr (>= 2.0.3),
ncdf4 (>= 1.21),
raster (>= 3.6.14),
RColorBrewer (>= 1.1.3),
rmap (>= 1.0.0),
sf (>= 1.0.9),
sp (>= 1.6.0),
terra (>= 1.7.3),
tibble (>= 3.1.8),
tidyr (>= 1.2.1)
Suggests:
rmarkdown,
testthat
kableExtra (>= 1.3.4),
rmarkdown (>= 2.16),
testthat (>= 3.1.4)
VignetteBuilder:
knitr
Remotes:
github::JGCRI/gcamdata
VignetteBuilder: knitr
github::JGCRI/gcamdata,
github::JGCRI/rmap
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.1
13 changes: 13 additions & 0 deletions DISCLAIMER
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
helios

DISCLAIMER:

This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

PACIFIC NORTHWEST NATIONAL LABORATORY
operated by
BATTELLE
for the
UNITED STATES DEPARTMENT OF ENERGY
under Contract DE-AC05-76RL01830
16 changes: 14 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
YEAR: 2021
COPYRIGHT HODLER: Joint Global Change Research Institute
helios

BSD2-Clause

Copyright © 2022, Battelle Memorial Institute
All rights reserved.

1. Battelle Memorial Institute (hereinafter Battelle) hereby grants permission to any person or entity lawfully obtaining a copy of this software and associated documentation files (hereinafter “the Software”) to redistribute and use the Software in source and binary forms, with or without modification. Such person or entity may use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and may permit others to do so, subject to the following conditions:
• Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.
• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
• Other than as used herein, neither the name Battelle Memorial Institute or Battelle may be used in any form whatsoever without the express written consent of Battelle.
• Redistributions of the software in any form, and publications based on work performed using the software should include the following citation as a reference:

2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BATTELLE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8 changes: 8 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Generated by roxygen2: do not edit by hand

export(create_name)
export(diagnostics)
export(find_mapping_grid)
export(hdcd)
export(mapping_grid)
export(match_grids)
export(pkg_example)
export(read_ncdf)
export(read_population)
export(save_xml)
importFrom(data.table,":=")
importFrom(grDevices,colorRampPalette)
importFrom(magrittr,"%>%")
Loading

0 comments on commit b5e2afe

Please sign in to comment.