Skip to content

Commit

Permalink
Merge branch 'dev' into detection_range_model
Browse files Browse the repository at this point in the history
  • Loading branch information
jdpye authored Jan 6, 2024
2 parents 8ec66eb + d57c619 commit 360f3b8
Show file tree
Hide file tree
Showing 238 changed files with 102,236 additions and 86,390 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ glatos.pdf
^\.Rproj\.user$
^README\.Rmd$
^README-.*\.png$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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, dev]
pull_request:
branches: [main, dev]

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: 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

steps:
- uses: actions/checkout@v3

- 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

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

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
42 changes: 42 additions & 0 deletions .github/workflows/document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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:
paths: ["R/**"]

name: Document

jobs:
document:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: roxygen2

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: Commit and push changes
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE DESCRIPTION
git commit -m "Update documentation" || echo "No changes to commit"
git pull --ff-only
git push origin
79 changes: 79 additions & 0 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 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:
issue_comment:
types: [created]

name: Commands

jobs:
document:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
name: document
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

style:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
name: style
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

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

- name: Install dependencies
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
73 changes: 73 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# 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:
paths: ["**.[rR]", "**.[qrR]md", "**.[rR]markdown", "**.[rR]nw", "**.[rR]profile"]

name: Style

jobs:
style:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::styler, any::roxygen2
needs: styler

- name: Enable styler cache
run: styler::cache_activate()
shell: Rscript {0}

- name: Determine cache location
id: styler-location
run: |
cat(
"location=",
styler::cache_info(format = "tabular")$location,
"\n",
file = Sys.getenv("GITHUB_OUTPUT"),
append = TRUE,
sep = ""
)
shell: Rscript {0}

- name: Cache styler
uses: actions/cache@v3
with:
path: ${{ steps.styler-location.outputs.location }}
key: ${{ runner.os }}-styler-${{ github.sha }}
restore-keys: |
${{ runner.os }}-styler-
${{ runner.os }}-
- name: Style
run: styler::style_pkg()
shell: Rscript {0}

- name: Commit and push changes
run: |
if FILES_TO_COMMIT=($(git diff-index --name-only ${{ github.sha }} \
| egrep --ignore-case '\.(R|[qR]md|Rmarkdown|Rnw|Rprofile)$'))
then
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)"
git pull --ff-only
git push origin
else
echo "No changes to commit."
fi
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Meta
doc
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rproj
*.DS_Store
*Icon*
Meta
doc
.Rproj.user
.Rhistory
.RData
.Ruserdata
*.Rproj
*.DS_Store
*Icon*
/doc/
/Meta/
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ You may have a feature or function that you'd like to contribute to the package.
Clone the `glatos` repository onto your local machine. On the command line, you would CD to a working directory, then do:

```
git clone git@gitlab.oceantrack.org:GreatLakes/glatos.git
git clone git@github.com:ocean-tracking-network/glatos.git
cd glatos
git fetch
git checkout -b dev origin/dev
Expand All @@ -36,17 +36,17 @@ git push -u origin myfeature

You can push to your feature branch as many times as you like, this way you and another developer can collaborate on the feature, or just when you've reached a point that you feel you're ready to come back into the main package.

Finally, alert the package maintainers (@chrisholbrook , @trbinder , @thayden , @frank.smith , @jdpye) that your feature's ready for integration with `dev` by issuing a [Merge Request](https://gitlab.oceantrack.org/GreatLakes/glatos/merge_requests) for `myfeature` into `dev`. GitLab will run the reports on what you've changed and how it affects the current state of the `dev` branch, even if the `dev` branch has changed since you last checked!
Finally, alert the package maintainers (@chrisholbrook , @trbinder , @thayden , @frank.smith , @jdpye) that your feature's ready for integration with `dev` by issuing a [Pull Request](https://github.com/ocean-tracking-network/glatos/pulls) for `myfeature` into `dev`. GitHub will run the reports on what you've changed and how it affects the current state of the `dev` branch, even if the `dev` branch has changed since you last checked!

Responsibility for making sure your branch won't break everything now falls to the package maintainers. They'll merge in your feature if it's in good working order and it will be further tested and then eventually merged into the `master` branch, from which all the end-users of the `glatos` package run code.
Responsibility for making sure your branch won't break everything now falls to the package maintainers. They'll merge in your feature if it's in good working order and it will be further tested and then eventually merged into the `master` branch, from which all the end-users of the `glatos` package run code.

In the near future, testing will be an important part of contributing code to the package. Any tests that you can write to verify the integrity of your feature will be included as part of the build procedure for releasing official versions of `glatos`. Add them in a subfolder called `tests\myfeature` where myfeature is the name of your feature. For testing, the R package [testthat](https://cran.r-project.org/web/packages/testthat/testthat.pdf) is a good starting point.
In the near future, testing will be an important part of contributing code to the package. Any tests that you can write to verify the integrity of your feature will be included as part of the build procedure for releasing official versions of `glatos`. Add them in a subfolder called `tests\myfeature` where myfeature is the name of your feature. For testing, the R package [testthat](https://cran.r-project.org/web/packages/testthat/testthat.pdf) is a good starting point.

Documentation is done using the [roxygen](https://cran.r-project.org/web/packages/roxygen2/vignettes/rd.html) package and associated notation, so annotating your feature's functions in that way will be most helpful for integration purposes.

## Method 2: The 'Wishing Well' Method

If all that sounded quite complicated, and you'd like to see a feature added to the package, but can only describe it in plain English and not in a sweet, sweet .R file full of declarative statements and function calls, then create an [Issue](https://gitlab.oceantrack.org/GreatLakes/glatos/issues), describe what you'd like to see in the new feature, and assign it the Feature Request label. From there, any member of the community could pounce on your idea, assign it to themselves, write and commit it and claim ~~all~~ an appropriate amount of the credit.
If all that sounded quite complicated, and you'd like to see a feature added to the package, but can only describe it in plain English and not in a sweet, sweet .R file full of declarative statements and function calls, then create an [Issue](https://github.com/ocean-tracking-network/glatos/issues), describe what you'd like to see in the new feature, and assign it the Feature Request label. From there, any member of the community could pounce on your idea, assign it to themselves, write and commit it and claim ~~all~~ an appropriate amount of the credit.


In either contribution paradigm, providing supporting literature for the analysis methods you propose should be prioritized. Everyone likes to see their name in a references list, and collaborative analysis packages can be a great way to get some sunshine on that analysis method you really like.
Expand Down
Loading

0 comments on commit 360f3b8

Please sign in to comment.