Skip to content

Commit

Permalink
Fix tests, readme and github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-imbi committed Apr 7, 2023
1 parent fff10af commit 3af1f1b
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 5 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# 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, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3

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

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

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@ Collate:
'neyman_pearson.R'
'plot_design.R'
'print.R'
URL: https://jan-imbi.github.io/adestr/
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ knitr::opts_chunk$set(
)
```

# adestr
# adestr <a href='https://github.com/jan-imbi/adestr'><img src='man/figures/sticker.png' align="right" height="170" /></a>

<!-- badges: start -->
[![R-CMD-check](https://github.com/jan-imbi/adestr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jan-imbi/adestr/actions/workflows/R-CMD-check.yaml)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# adestr
# adestr <a href='https://github.com/jan-imbi/adestr'><img src='man/figures/sticker.png' align="right" height="170" /></a>

<!-- badges: start -->

Expand Down
4 changes: 3 additions & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
url: ~
url: https://jan-imbi.github.io/adestr/
template:
bootstrap: 5

16 changes: 16 additions & 0 deletions tests/testthat/setup_options.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set tolerances for unit testing
options(
list(
# Root finding inside estimators
adestr_tol_roots = 1e-3,
adestr_maxiter_roots = 1e3,
# Integrals used inside estimators
adestr_tol_inner = 5e-3,
adestr_maxEval_inner = 1e4,
adestr_absError_inner = 1e-5,
# Integrals to evaluate estimators
adestr_tol_outer = 5e-6,
adestr_maxEval_outer = 3e5,
adestr_absError_outer = 1e-8
)
)
2 changes: 1 addition & 1 deletion tests/testthat/test_integrals.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test_that("integral over sample space is equal to 1 for case: unknown variance,
sigma = 2.1,
exact = TRUE)$overall_integral$integral,
1,
tolerance=1e-3
tolerance=5e-2
)
})

1 change: 0 additions & 1 deletion vignettes/Introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,3 @@ analyze(
)
```


0 comments on commit 3af1f1b

Please sign in to comment.