Skip to content

Commit

Permalink
Merge pull request #715 from JGCRI/krd/gh697/change_default_branch
Browse files Browse the repository at this point in the history
switch to the main branch
  • Loading branch information
kdorheim committed Dec 20, 2023
2 parents 4337eeb + b6946af commit 0ea644b
Show file tree
Hide file tree
Showing 26 changed files with 78 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: R-CMD-check
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**' # matches every branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**' # matches every branch
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/command-line.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# This is a basic workflow to help you get started with Actions
# based on https://github.com/JGCRI/hector/new/master?filename=.github%2Fworkflows%2Fmain.yml&workflow_template=blank
# based on https://github.com/JGCRI/hector/new/main?filename=.github%2Fworkflows%2Fmain.yml&workflow_template=blank

name: Command Line Hector

# Controls when the action will run.
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**' # matches every branch
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/leeyabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
install.packages(c("ggplot2", "rmarkdown", "dplyr", "remotes", "here"))
remotes::install_github("hadley/emo")
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master]
branches: [main]
pull_request:
branches:
- '**' # matches every branch
Expand Down
11 changes: 10 additions & 1 deletion R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ default_fetchvars <- c(CONCENTRATIONS_CO2, RF_TOTAL, RF_CO2, GLOBAL_TAS)
#' The list of variables to fetch if you don't specify \code{vars} is stored in
#' the \code{hector.default.fetchvars} option. If this option is also unset, then
#' the default variable list is CO2 concentration, total radiative forcing, CO2
#' forcing, and global mean temperature.
#' forcing, and global mean temperature. To see a list of the potential \code{vars}
#' see \code{data(inputstable)} and \code{data(fxntable)}.
#'
#' @seealso \link{concentrations}, \link{emissions}, \link{forcings},
#' \link{carboncycle}, \link{haloemiss}, \link{haloforcings}, \link{methane},
Expand All @@ -34,6 +35,14 @@ default_fetchvars <- c(CONCENTRATIONS_CO2, RF_TOTAL, RF_CO2, GLOBAL_TAS)
#' of the Hector core object will be used.
#' @family main user interface functions
#' @export
#' @examples
#' \dontrun{
#' ini <- system.file(package = "hector", "input/hector_ssp245.ini")
#' hc <- newcore(ini)
#' run(hc)
#' out <- fetchvars(core = hc, dates = 1900:2100, vars = c(GLOBAL_TAS(), NPP()))
#' print(out)
#' }
fetchvars <- function(core, dates, vars = NULL, scenario = NULL) {
if (is.null(vars)) {
vars <- getOption("hector.default.fetchvars",
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ library(ggplot2)

# hector

[![DOI](https://zenodo.org/badge/22892935.svg)](https://zenodo.org/badge/latestdoi/22892935) [![C++ unit tests](https://github.com/JGCRI/hector/actions/workflows/unit-testing.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/unit-testing.yaml) [![Command Line Hector](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml) [![R-CMD-check](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/JGCRI/hector/branch/master/graph/badge.svg?token=EGM0lXDxRv)](https://codecov.io/gh/JGCRI/hector)
[![DOI](https://zenodo.org/badge/22892935.svg)](https://zenodo.org/badge/latestdoi/22892935) [![C++ unit tests](https://github.com/JGCRI/hector/actions/workflows/unit-testing.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/unit-testing.yaml) [![Command Line Hector](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml) [![R-CMD-check](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/JGCRI/hector/branch/main/graph/badge.svg?token=EGM0lXDxRv)](https://codecov.io/gh/JGCRI/hector)

This is the repository for **Hector**, an open source, object-oriented, simple
global climate carbon-cycle model that runs very quickly while still
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tests](https://github.com/JGCRI/hector/actions/workflows/unit-testing.yaml/badge
[![Command Line
Hector](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/command-line.yaml)
[![R-CMD-check](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JGCRI/hector/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/JGCRI/hector/branch/master/graph/badge.svg?token=EGM0lXDxRv)](https://codecov.io/gh/JGCRI/hector)
[![codecov](https://codecov.io/gh/JGCRI/hector/branch/main/graph/badge.svg?token=EGM0lXDxRv)](https://codecov.io/gh/JGCRI/hector)

This is the repository for **Hector**, an open source, object-oriented,
simple global climate carbon-cycle model that runs very quickly while
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp119.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp119_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp126.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp126_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp245.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp245_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp370.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp370_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp434.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp434_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp460.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp460_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp534-over.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp534-over_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
3 changes: 2 additions & 1 deletion inst/input/hector_ssp585.ini
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ delta_HFC32=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6
molarMass=52.0 ; grams
HFC32_emissions=csv:tables/ssp585_emiss-constraints_rf.csv

[HFC4310_halocarbon] ; This is equivalent to HFC-43-10mee
[HFC4310_halocarbon]
; This is equivalent to HFC-43-10mee
tau=17.0 ; lifetime in years (Table 7.SM.7 IPPC AR6)
rho_HFC4310=0.000357 ; radiative efficiencies W/m2/ppt (Table 7.SM.7 IPPC AR6)
delta_HFC4310=0.0 ; tropospheric adjustments scalar unitless (7.3.2.4 IPCC AR6)
Expand Down
12 changes: 11 additions & 1 deletion man/fetchvars.Rd

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

3 changes: 1 addition & 2 deletions scripts/OutputDifferences.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ knitr::opts_chunk$set(echo = TRUE)

## Differences in Hector outputs

Hello, this is `leeyabot`! `r emo::ji("robot")`
Hello, this is `leeyabot`!

``` {r differences, echo = FALSE, message = FALSE, include = FALSE}
# Load packages
library(dplyr)
library(ggplot2)
library(hector)
library(emo)
library(here)
# Set root directory
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_old-new.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
context("Old new tests")
# Verify that hector output for the canonical rcps matches the output from the
# master branch. This "bit for bit" comparison of the output is intended to help
# main branch. This "bit for bit" comparison of the output is intended to help
# guarantee that Hector's outputs don't change during "minor" and "patch" development.
# When "major" development is expected to impact Hector output, the comparison data will
# need to be updated by running data-raw/generate-comp-data.R
Expand Down
6 changes: 4 additions & 2 deletions vignettes/articles/BuildHector.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ building instructions for the R Hector package and the executable.

# R Hector

To install R, follow the [official instructions](https://cloud.r-project.org/) for your platform.
To install R, follow the [official instructions](https://cloud.r-project.org/) for your platform.

To install the version associated with the current `master` git branch on GitHub,
Follow this [YouTube video](https://www.youtube.com/watch?v=Pg3WY8wg1cY) or continue reading.

To install the version associated with the current `main` git branch on GitHub,
use the `remotes`::install_github` function.
This will automatically install all of Hector's dependencies as well.
(Note that because this requires compiling from source, you will need to have a C compiler installed and configured.)
Expand Down
4 changes: 2 additions & 2 deletions vignettes/articles/ContributionsGuide.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Contribution Guide

The Hector team welcomes and values community contributions to Hector, but there are a few important things to know.

All contributions must pass through a pull request (PR) process before being merged into the master branch of Hector. Please note that opening a PR does **not** guarantee your work will be merged; we assess potential model changes for fit with Hector’s long-term strategic plan, compatibility, conformance to the model’s code style, and other factors.
All contributions must pass through a pull request (PR) process before being merged into the main branch of Hector. Please note that opening a PR does **not** guarantee your work will be merged; we assess potential model changes for fit with Hector’s long-term strategic plan, compatibility, conformance to the model’s code style, and other factors.

We encourage all contributors to read and comply with the following guidelines:

Expand All @@ -19,7 +19,7 @@ Hector adheres to the [semantic versioning](https://semver.org/) ideology. This

* "Patch changes" that make no impact on Hector functionality, such as documentation fixes or removing dead code, are the easiest to assess and merge.
* "Minor changes" that don’t change the model’s behavior in any fundamental way and don’t change its inputs may require unit tests and some more review.
* "Major changes" that change the model’s input or output structure or induce major behavioral shifts, are considered _breaking changes_. These are subject to the most stringent reviews and will require scientific justification of the development and evidence that the changes have the intended consequences. PRs will almost always be merged into a development branch, not master until a new version of the Hector is ready for release.
* "Major changes" that change the model’s input or output structure or induce major behavioral shifts, are considered _breaking changes_. These are subject to the most stringent reviews and will require scientific justification of the development and evidence that the changes have the intended consequences. PRs will almost always be merged into a development branch, not main until a new version of the Hector is ready for release.


Thank you for your interest in contributing to Hector and we look forward to working with you! However, we maintain the right to refuse to merge PRs that do not comply with these guidelines or that do not meet contribution standards.
Expand Down
11 changes: 0 additions & 11 deletions vignettes/articles/Hector-Wider-World.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,6 @@ pyhector is a Python interface for Hector.
[Here](https://joss.theoj.org/papers/10.21105/joss.00248) is a paper describing pyhector by Sven N Wilner, Corrine Hartin, and Robert Gieseke.
Github found [here](https://github.com/openclimatedata/pyhector).

### YouTube Walkthrough
[Here](https://www.youtube.com/watch?v=EFJS-buvGN8) is a video walk through by Kalyn Dorheim including information on using Hector v2.5:

* Installing Hector
* Running a core
* Running a scenario
* Accessing and plotting results
* Shutting down a core
* Changing a parameter
* A brief explanation of documentation

### HectorUI
HectorUI is an R Shiny web interface designed to be user-friendly and to provide an alternative to the command line for running Hector. This allows users who may not be fluent in C++ or R to explore model scenarios and outputs.

Expand Down
21 changes: 21 additions & 0 deletions vignettes/articles/HectorResources.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: "Hector Videos & Tutorials"
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```

## Hector V3

* [Interactive Jupyter notebook](https://hector.msdlive.org/)
* Hector V3 installation [YouTube Video](https://www.youtube.com/watch?v=Pg3WY8wg1cY)


## Hector V2.5

[YouTube Video](https://www.youtube.com/watch?v=EFJS-buvGN8) that covers the following: Hector v2.5 Package setup; changing a parameter value; how to visualize

2 changes: 1 addition & 1 deletion vignettes/articles/InputFiles.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Hector input files

When Hector is invoked from the command line, it takes a single parameter: the name of the primary input file to read. This file, typically stored in the `input/` directory, contains configuration and parameter data controlling the model's run, output, and behavior.

The primary input file is a text file with *sections*, *properties*, and *values*. For example, the beginning of the [SSP245 file](/tree/master/inst/input/hector_ssp245.ini) included in the repository looks like this:
The primary input file is a text file with *sections*, *properties*, and *values*. For example, the beginning of the [SSP245 file](/tree/main/inst/input/hector_ssp245.ini) included in the repository looks like this:

```
; Config file for hector model: SSP245
Expand Down
6 changes: 3 additions & 3 deletions vignettes/articles/SimpleNBox.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ At each Hector time step, `c` is solved by the `CarbonCycleSolver::run()` functi
These steps are described in more detail below.
The complete code for the terrestrial C cycle lives in [`src/simpleNbox.cpp`][cpp] file (with associated headers in [`inst/include/simpleNbox.hpp`][hpp]).

[solver]: https://github.com/JGCRI/hector/blob/master/src/carbon-cycle-solver.cpp
[cpp]: https://github.com/jgcri/hector/blob/master/src/simpleNbox.cpp
[hpp]: https://github.com/JGCRI/hector/blob/master/inst/include/simpleNbox.hpp
[solver]: https://github.com/JGCRI/hector/blob/main/src/carbon-cycle-solver.cpp
[cpp]: https://github.com/jgcri/hector/blob/main/src/simpleNbox.cpp
[hpp]: https://github.com/JGCRI/hector/blob/main/inst/include/simpleNbox.hpp

## Setting the `c` vector (`getCValues`)

Expand Down
1 change: 1 addition & 0 deletions vignettes/articles/manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Building and Running Hector
* How to [do a basic run and sensitivity analysis](intro-to-hector.html)
* How to [run Hector under constraints](Constraints.html)
* How to [run Hector with multiple biomes](multiple-biomes.html)
* [Videos & other resources](HectorResources.html)

For Developers
--------------------
Expand Down

0 comments on commit 0ea644b

Please sign in to comment.