Skip to content

Commit

Permalink
Merge pull request #96 from NSAPH-Software/JOSS
Browse files Browse the repository at this point in the history
Joss
  • Loading branch information
Naeemkh authored Mar 13, 2024
2 parents de0747c + 16adc38 commit 7b73e4b
Show file tree
Hide file tree
Showing 60 changed files with 356 additions and 82 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ index.md
^CRAN-SUBMISSION$
^CODE_OF_CONDUCT\.md$
^paper/*$
^CONTRIBUTING\.md$
^CITATION\.cff$
44 changes: 44 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
cff-version: "1.2.0"
authors:
- family-names: Khoshnevis
given-names: Naeem
orcid: "https://orcid.org/0000-0003-4315-1426"
- family-names: Ren
given-names: Boyu
orcid: "https://orcid.org/0000-0002-5300-1184"
- family-names: Braun
given-names: Danielle
orcid: "https://orcid.org/0000-0002-5177-8598"
contact:
- family-names: Khoshnevis
given-names: Naeem
orcid: "https://orcid.org/0000-0003-4315-1426"
doi: 10.5281/zenodo.10757333
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Khoshnevis
given-names: Naeem
orcid: "https://orcid.org/0000-0003-4315-1426"
- family-names: Ren
given-names: Boyu
orcid: "https://orcid.org/0000-0002-5300-1184"
- family-names: Braun
given-names: Danielle
orcid: "https://orcid.org/0000-0002-5177-8598"
date-published: 2024-03-13
doi: 10.21105/joss.05465
issn: 2475-9066
issue: 95
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 5465
title: GPCERF - An R package for implementing Gaussian processes for
estimating causal exposure response curves
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.05465"
volume: 9
title: GPCERF - An R package for implementing Gaussian processes for
estimating causal exposure response curves
150 changes: 150 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
# Contributing

Contributions are appreciated and can take various forms, such as:

- Adding new features.
- Enhancing documentation.
- Addressing existing open issues.
- Creating new issues.
- Correcting typos.

Please review the following documents before making changes to the codebase.

## Environment Setup

To contribute to the project, it's recommended to have your own local copy of _GPCERF_ on your Github account. As a result, please fork the project. Then open your terminal (or Gitbash for Windows, Anaconda prompt, ...) and run the following command (brackets are not included):

```S
git clone git@github.com:[your user name]/GPCERF.git
```
- If you haven't already, generate an SSH key. Learn more [here](https://docs.github.com/en/github-ae@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).

Now, you can modify the codebase and track your changes. Consider creating a new branch to work on the codebase. Refer to the following instructions for git branching.

## Git Branching Model

While you can choose any branch name for your personal repository, maintaining consistency and understanding who's working on what is crucial. In this project, we follow the convention that is proposed by Vincent Driessen in his [A successful Git branching model](https://nvie.com/posts/a-successful-git-branching-model/) post.

Here is the summary of the branches:

- **main**: The main branch only hosts released software packages. Only project maintainers have write access to the master branch.
- **develop**: The develop branch serves as the primary branch, with the source code of HEAD always reflecting the latest delivered development changes for the next release.
- **supporting** branch: There are various supporting branches. We recommend contributors follow the naming convention for three main supporting branches:
- *feature*: we start a new feature branch to add new features to the software. The naming convention is iss[issue_number]_short_description. For example, if I need to add unittest to one of the functions in the package and the issue number is 12, iss12_add_unittest can be a valid git branch name. We start it with the issue number to go back and take a look at the issue details if necessary. Although feature branches are temporary, this naming convention helps developers to understand the situation while working on the codebase. If you are working on some features that there is no open issue for that, please open an issue [here](https://github.com/NSAPH-Software/GPCERF/issues/) and assign it to yourself. You can also make a comment that you are working on that.
- *hotfix*: hotfix branches will be only used for fixing a bug on a released package. After fixing the bug, the third digit of the version number should be incremented by one. For example, 2.3.5 –> 2.3.6. These branches will be prefixed with hotfix and followed by the upcoming version number (e.g., in this case, hotfix_2.3.6)
- *release*: Release branches support the preparation of a new production release.

## Where to submit pull requests?

Submit all pull requests to `base repository: NSAPH-Software/GPCERF` and `base: develop` branch.

## Pull request checklist

- Please run `devtools::document()`, `devtools::load_all()` after your final modifications.
- Make sure that your modified code passes all checks and tests (you can run `devtools::check()` in RStudio)
- Your PR should pass all the CI and for merging.
- Add a line(s) about the modification to the NEWS.md file.
- If you are adding new features, please make sure that appropriate documentation is added or updated.
- Please clean up white spaces. Read more [here](https://softwareengineering.stackexchange.com/questions/121555/why-is-trailing-whitespace-a-big-deal/).

## Reporting bugs

Please report potential bugs by creating a [new issue](https://github.com/NSAPH-Software/GPCERF/issues/) or sending us an email. Please include the following information in your bug report:

- A brief description of what you are doing, what you expected to happen, and what happened.
- OS that you are using and whether you are using a personal computer or HPC cluster.
- The version of the package that you have installed.

## Style Guide

In this project, we follow the [tidyverse style guide](https://style.tidyverse.org/).

### Summary

#### Names

- File names all snake_case and ends with .R (e.g., create_matching.R)
- variable names small letter and separate with _ if need (e.g., delta_n)
- Function names should follow snake_case style (e.g., generate_data)
- Function names follow verb+output convention (e.g., compute_resid)

#### Spaces and Indentation

- Indentations are two spaces (do not use tab)
- Place space around binary operators (e.g., x + y)

```R
#Acceptable:
z <- x + y

#Not recommended:
z<-x+y # (no space)
z<- x+y
z<-x +y
```

- Place space after comma

```R
#Acceptable:
a <- matrix(c(1:100), nrow = 5)

#Not recommended:
a <- matrix(c(1:100),nrow = 5) # (no space after comma)
a <- matrix( c(1:100), nrow = 5 ) # (extra space after and before parentheses)
a<-matrix(c(1:100), nrow = 5) # (no space around unary operator <- )
```

- Place space after # and before commenting and avoid multiple ###

```R
#Acceptable:
# This is a comment

#Not recommended:
#This is a comment
# This is a comment (more than one space after #)
## This is a comment (multiple #)
### This is a comment (multiple # and more than one space)
```

- Do not put space at the opening and closing the parenthesis

```R
#Acceptable:
x <- (z + y)

#Not recommended:
x <- ( z + y ) # (unnecessary space)
x <- (z + y )
x <- ( z + y)
```

- Place a space before and after `()` when used with `if`, `for`, or `while`.

```R

#Acceptible
if (x > 2) {
print(x)
}

# Not recommended
if(x > 2){
print(x)
}
```

#### Other notes

- Maximum line length is 80 character
- Use explicit returns
- Use explicit tags in documentation (e.g., @title, @description, ...)

## Notes on SuperLearner

In this package we create a customized wrapper for the SuperLearner internal libraries. Please read Notes on SL Wrappers for more details.

## Logger

Use the logger to examine the internal process. By default, the level is set to "INFO", writing messages to the "GPCERF.log" file. To change the log file location and level, use the update_logger function.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GPCERF
Title: Gaussian Processes for Estimating Causal Exposure Response Curves
Version: 0.2.2
Version: 0.2.3
Authors@R: c(
person("Naeem", "Khoshnevis", email = "nkhoshnevis@g.harvard.edu",
role=c("aut","cre"),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# GPCERF (developing)
# GPCERF 0.2.3 (2024-03-02)

## Changed

Expand Down
2 changes: 1 addition & 1 deletion R/compute_deriv_weights_gp.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' (e_gps_pred).
#' - Column 3: Standard deviation of e_gps (e_gps_std)
#' used_params:
#' - dnorm_log: TRUE or FLASE
#' - dnorm_log: TRUE or FALSE
#' @param hyperparam A vector of hyper-parameters in the GP model.
#' @param kernel_fn The covariance function.
#' @param kernel_deriv_fn The partial derivative of the covariance function.
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
| Resource | Github Actions | Code Coverage |
| ---------- | -------------------- | --------------- |
| Platforms | Windows, macOS, Linux| codecov |
| R CMD check | [![R build status](https://github.com/NSAPH-Software/GPCERF/workflows/R-CMD-check/badge.svg)](https://github.com/NSAPH-Software/GPCERF/actions) | [![codecov](https://codecov.io/gh/NSAPH-Software/GPCERF/branch/develop/graph/badge.svg?token=066ISL822N)](https://app.codecov.io/gh/NSAPH-Software/GPCERF) |
<p align="center">
<img src="man/figures/png/gpcerf_logo.png" height="100" alt="Cover Image"/>
</p>

<div align="center">
<a href="https://CRAN.R-project.org/package=GPCERF">
<img src="https://www.r-pkg.org/badges/version-last-release/GPCERF" alt="CRAN Package Version">
</a>
<a href="https://joss.theoj.org/papers/10.21105/joss.05465">
<img src="https://joss.theoj.org/papers/10.21105/joss.05465/status.svg" alt="JOSS Status">
</a>
<a href="https://github.com/NSAPH-Software/GPCERF/actions">
<img src="https://github.com/NSAPH-Software/GPCERF/workflows/R-CMD-check/badge.svg", alt="R-CMD-check status">
</a>
<a href="https://app.codecov.io/gh/NSAPH-Software/GPCERF">
<img src="https://codecov.io/gh/NSAPH-Software/GPCERF/branch/develop/graph/badge.svg?token=066ISL822N", alt="Codecov">
</a>
<a href="http://www.r-pkg.org/pkg/GPCERF">
<img src="https://cranlogs.r-pkg.org/badges/grand-total/GPCERF" alt="CRAN RStudio Mirror Downloads">
</a>
</div>




# Gaussian processes for the estimation of causal exposure-response curves (GP-CERF)
Expand Down Expand Up @@ -173,6 +192,10 @@ Original covariate balance:

Please note that the GPCERF project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct). By contributing to this project, you agree to abide by its terms.

## Contributing

Contributions to the package are encouraged. For detailed information on how to contribute, please refer to the [CONTRIBUTING](CONTRIBUTING.md) guidelines.


## Reporting Issues & Seeking Support

Expand Down
7 changes: 4 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Submission (February 16, 2024):
Submission (March 2, 2024):

We appreciate your efforts in reviewing the GPCERF 0.2.2 package. In this upgrade, we:
We appreciate your efforts in reviewing the GPCERF 0.2.3 package. In this upgrade, we:

- Fixed a note raised in some of CRAN checks.
- Modified the method by which the user specifies the covariate columns.
- Resolved an issue involving data that contains a single covariate.

All tests and checks have passed successfully.

Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

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

2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

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

2 changes: 1 addition & 1 deletion docs/LICENSE.html

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

2 changes: 1 addition & 1 deletion docs/articles/A-Note-on-Choosing-Hyperparameters.html

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

2 changes: 1 addition & 1 deletion docs/articles/Developers-Guide.html

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

2 changes: 1 addition & 1 deletion docs/articles/GPCERF.html

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

2 changes: 1 addition & 1 deletion docs/articles/Nearest-neighbor-Gaussian-Processes.html

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

2 changes: 1 addition & 1 deletion docs/articles/Standard-Gaussian-Processes.html

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

2 changes: 1 addition & 1 deletion docs/articles/index.html

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

2 changes: 1 addition & 1 deletion docs/authors.html

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

4 changes: 2 additions & 2 deletions docs/index.html

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

Loading

0 comments on commit 7b73e4b

Please sign in to comment.