Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codecov #5

Merged
merged 7 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
51 changes: 25 additions & 26 deletions .github/workflows/test-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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: [master]
paths:
- DESCRIPTION
- NAMESPACE
- R/**
- src/**
- tests/**
- man/**
- data/**
branches: [master, codecov]
pull_request:
branches: [master]
paths:
- DESCRIPTION
- NAMESPACE
- R/**
- src/**
- tests/**
- man/**
- data/**
workflow_dispatch:

name: test-coverage
branches: [master, codecov]

name: Test-Coverage

permissions: read-all

jobs:
test-coverage:
Expand All @@ -40,10 +25,24 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::covr
kingaa/pomp
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
file: ./cobertura.xml
plugin: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

4 changes: 2 additions & 2 deletions R/panelPomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ setClass(
#' @examples
#' ## recreate the 'panelRandomWalk()' example
#' prw <- panelRandomWalk()
#' prw2 <- panelPomp(unit_objects(prw),params=coef(prw))
#' identical(prw,prw2) # TRUE
#' prw2 <- panelPomp(unit_objects(prw), params = coef(prw))
#' identical(prw, prw2) # TRUE
#' @author Carles \Breto
#' @export
panelPomp <- function (object, shared, specific, params) {
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### an *R* package for inference on panel partially observed Markov processes

[![Project Status: Active -- The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![CRAN Status](https://www.r-pkg.org/badges/version/panelPomp)](https://cran.r-project.org/package=panelPomp) [![Last CRAN release date](https://www.r-pkg.org/badges/last-release/panelPomp)](https://cran.r-project.org/package=panelPomp) [![R-CMD-check](https://github.com/panelPomp-org/panelPomp/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/r-cmd-check.yml) [![binary-build](https://github.com/panelPomp-org/panelPomp/actions/workflows/binary-build.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/binary-build.yml) [![test-coverage](https://github.com/panelPomp-org/panelPomp/actions/workflows/test-coverage.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/test-coverage.yml)
[![Project Status: Active -- The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) [![CRAN Status](https://www.r-pkg.org/badges/version/panelPomp)](https://cran.r-project.org/package=panelPomp) [![Last CRAN release date](https://www.r-pkg.org/badges/last-release/panelPomp)](https://cran.r-project.org/package=panelPomp) [![R-CMD-check](https://github.com/panelPomp-org/panelPomp/actions/workflows/r-cmd-check.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/r-cmd-check.yml) [![binary-build](https://github.com/panelPomp-org/panelPomp/actions/workflows/binary-build.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/binary-build.yml) [![test-coverage](https://github.com/panelPomp-org/panelPomp/actions/workflows/test-coverage.yml/badge.svg)](https://github.com/panelPomp-org/panelPomp/actions/workflows/test-coverage.yml)[![codecov](https://codecov.io/gh/panelPomp-org/panelPomp/graph/badge.svg?token=NI3KX6NIUN)](https://codecov.io/gh/panelPomp-org/panelPomp)

This package allows performing data analysis based on panel partially-observed Markov process (PanelPOMP) models. To implement such models, simulate them and fit them to panel data, 'panelPomp' extends some of the facilities provided for time series data by the 'pomp' package. Implemented methods include filtering (panel particle filtering) and maximum likelihood estimation (Panel Iterated Filtering) as proposed in Bretó, Ionides and King (2020) "Panel Data Analysis via Mechanistic Models" [\<doi:10.1080/01621459.2019.1604367\>](https://doi.org/10.1080/01621459.2019.1604367).

Expand Down
7 changes: 5 additions & 2 deletions tests/panelPomp.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ noparams <- lapply(unit_objects(ppo),pomp,params=numeric(0))

ep <- "Error : in ''panelPomp'': "
## test checks for missing arguments in panelPomp function
test(wQuotes(ep,"''object'' is a required argument.\n"),
panelPomp())
test(
wQuotes(ep, "''object'' is a required argument.\n"),
panelPomp()
)

test(wQuotes(ep,"''object'' must be either a ''panelPomp'' object or a list of",
" ''pomp'' objects.","\n"),
panelPomp(list(a=1)))
Expand Down
7 changes: 5 additions & 2 deletions tests/panelPomp.Rout.save
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ Error : in ‘panelPomp’: ‘object’ must be either a ‘panelPomp’ object
>
> ep <- "Error : in ''panelPomp'': "
> ## test checks for missing arguments in panelPomp function
> test(wQuotes(ep,"''object'' is a required argument.\n"),
+ panelPomp())
> test(
+ wQuotes(ep, "''object'' is a required argument.\n"),
+ panelPomp()
+ )
[1] TRUE
>
> test(wQuotes(ep,"''object'' must be either a ''panelPomp'' object or a list of",
+ " ''pomp'' objects.","\n"),
+ panelPomp(list(a=1)))
Expand Down