Skip to content

Commit 1c5a6eb

Browse files
oschulzsthayashijlrestrepol
committed
Initial package implementation
Co-authored-by: Scott Hayashi <[email protected]> Co-authored-by: jlrestrepol <[email protected]>
1 parent 8716435 commit 1c5a6eb

27 files changed

+796
-0
lines changed

.codecov.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# comment: false

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
2+
version: 2
3+
updates:
4+
- package-ecosystem: "github-actions"
5+
directory: "/" # Location of package manifests
6+
schedule:
7+
interval: "weekly"

.github/workflows/CompatHelper.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/TagBot.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: TagBot
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
23+
jobs:
24+
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: JuliaRegistries/TagBot@v1
29+
with:
30+
token: ${{ secrets.GITHUB_TOKEN }}
31+
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
32+
ssh: ${{ secrets.DOCUMENTER_KEY }}
33+
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}

.github/workflows/ci.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
- 'releases/**'
9+
tags: '*'
10+
pull_request:
11+
release:
12+
13+
concurrency:
14+
# Skip intermediate builds: always.
15+
# Cancel intermediate builds: only if it is a pull request build.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
18+
19+
jobs:
20+
test:
21+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
22+
runs-on: ${{ matrix.os }}
23+
continue-on-error: ${{ matrix.version == 'nightly' }}
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
version:
28+
- '1.6'
29+
- '1'
30+
- 'nightly'
31+
os:
32+
- ubuntu-latest
33+
arch:
34+
- x64
35+
include:
36+
- version: 1
37+
os: ubuntu-latest
38+
arch: x86
39+
- version: 1
40+
os: macOS-latest
41+
arch: x64
42+
- version: 1
43+
os: windows-latest
44+
arch: x64
45+
steps:
46+
- uses: actions/checkout@v3
47+
- uses: julia-actions/setup-julia@v1
48+
with:
49+
version: ${{ matrix.version }}
50+
arch: ${{ matrix.arch }}
51+
- uses: julia-actions/cache@v1
52+
- uses: julia-actions/julia-buildpkg@v1
53+
env:
54+
PYTHON: 'Conda'
55+
- uses: julia-actions/julia-runtest@v1
56+
with:
57+
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }}
58+
- uses: julia-actions/julia-processcoverage@v1
59+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
60+
- uses: codecov/codecov-action@v3
61+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
62+
with:
63+
file: lcov.info
64+
docs:
65+
name: Documentation
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v3
69+
- uses: julia-actions/setup-julia@v1
70+
with:
71+
version: '1'
72+
- uses: julia-actions/cache@v1
73+
- uses: julia-actions/julia-buildpkg@v1
74+
env:
75+
PYTHON: 'Conda'
76+
- uses: julia-actions/julia-docdeploy@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
# Needed due to https://github.com/JuliaDocs/Documenter.jl/issues/1177
80+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
81+
GKSwstype: 'nul'

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
*.jl.cov
3+
*.jl.*.cov
4+
*.jl.mem
5+
.ipynb_checkpoints
6+
.vscode
7+
Manifest.toml

LICENSE.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
The BATTestCases.jl package is licensed under the MIT "Expat" License:
2+
3+
> Copyright (c) 2020:
4+
>
5+
> Oliver Schulz <[email protected]> and contributors
6+
>
7+
> Permission is hereby granted, free of charge, to any person obtaining a copy
8+
> of this software and associated documentation files (the "Software"), to deal
9+
> in the Software without restriction, including without limitation the rights
10+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
> copies of the Software, and to permit persons to whom the Software is
12+
> furnished to do so, subject to the following conditions:
13+
>
14+
> The above copyright notice and this permission notice shall be included in all
15+
> copies or substantial portions of the Software.
16+
>
17+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
> SOFTWARE.
24+
>

Project.toml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name = "BATTestCases"
2+
uuid = "91d0e2c9-dbaa-453b-b50b-030d574b201f"
3+
version = "0.1.0"
4+
5+
[deps]
6+
AdaptiveRejectionSampling = "c75e803d-635f-53bd-ab7d-544e482d8c75"
7+
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
8+
ArraysOfArrays = "65a8f2f4-9b39-5baf-92e2-a9cc46fdf018"
9+
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
10+
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
11+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
12+
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
13+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
14+
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
15+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
16+
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
17+
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
18+
19+
[compat]
20+
AdaptiveRejectionSampling = "0.1.1"
21+
ArgCheck = "1, 2"
22+
ArraysOfArrays = "0.4, 0.5, 0.6"
23+
Distributions = "0.25"
24+
DocStringExtensions = "0.8, 0.9"
25+
QuadGK = "2"
26+
Random123 = "1.2"
27+
SpecialFunctions = "0.10, 1, 2"
28+
StatsBase = "0.32, 0.33, 0.34"
29+
julia = "1.6"

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BATTestCases.jl
2+
3+
[![Documentation for stable version](https://img.shields.io/badge/docs-stable-blue.svg)](https://bat.github.io/BATTestCases.jl/stable)
4+
[![Documentation for development version](https://img.shields.io/badge/docs-dev-blue.svg)](https://bat.github.io/BATTestCases.jl/dev)
5+
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](LICENSE.md)
6+
[![Build Status](https://github.com/bat/BATTestCases.jl/workflows/CI/badge.svg?branch=main)](https://github.com/bat/BATTestCases.jl/actions?query=workflow%3ACI)
7+
[![Codecov](https://codecov.io/gh/bat/BATTestCases.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/bat/BATTestCases.jl)
8+
9+
10+
## Documentation
11+
12+
* [Documentation for stable version](https://bat.github.io/BATTestCases.jl/stable)
13+
* [Documentation for development version](https://bat.github.io/BATTestCases.jl/dev)
14+
15+
BATTestCases.jl provides a collection of test cases for
16+
[BAT.jl](https://github.com/bat/BAT.jl) and should be useful for tesing
17+
other bayesian Julia software (MCMC samplers, etc.) as well.
18+

docs/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
site/

docs/Project.toml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
4+
5+
[compat]
6+
Documenter = "~0.27"

docs/make.jl

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Use
2+
#
3+
# DOCUMENTER_DEBUG=true julia --color=yes make.jl local [nonstrict] [fixdoctests]
4+
#
5+
# for local builds.
6+
7+
using Documenter
8+
using BATTestCases
9+
10+
# Doctest setup
11+
DocMeta.setdocmeta!(
12+
BATTestCases,
13+
:DocTestSetup,
14+
:(using BATTestCases);
15+
recursive=true,
16+
)
17+
18+
makedocs(
19+
sitename = "BATTestCases",
20+
modules = [BATTestCases],
21+
format = Documenter.HTML(
22+
prettyurls = !("local" in ARGS),
23+
canonical = "https://bat.github.io/BATTestCases.jl/stable/"
24+
),
25+
pages = [
26+
"Home" => "index.md",
27+
"API" => "api.md",
28+
"LICENSE" => "LICENSE.md",
29+
],
30+
doctest = ("fixdoctests" in ARGS) ? :fix : true,
31+
linkcheck = !("nonstrict" in ARGS),
32+
strict = !("nonstrict" in ARGS),
33+
)
34+
35+
deploydocs(
36+
repo = "github.com/bat/BATTestCases.jl.git",
37+
forcepush = true,
38+
push_preview = true,
39+
)

docs/src/LICENSE.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# LICENSE
2+
3+
```@eval
4+
using Markdown
5+
Markdown.parse_file(joinpath(@__DIR__, "..", "..", "LICENSE.md"))
6+
```

docs/src/api.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# API
2+
3+
## Modules
4+
5+
```@index
6+
Order = [:module]
7+
```
8+
9+
## Types and constants
10+
11+
```@index
12+
Order = [:type, :constant]
13+
```
14+
15+
## Functions and macros
16+
17+
```@index
18+
Order = [:macro, :function]
19+
```
20+
21+
# Documentation
22+
23+
```@autodocs
24+
Modules = [BATTestCases]
25+
Order = [:module, :type, :constant, :macro, :function]
26+
```

docs/src/index.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# BATTestCases.jl
2+
3+
BATTestCases.jl provides a collection of test cases for [BAT.jl](https://github.com/bat/BAT.jl) and should be useful for tesing other Bayesian Julia software (MCMC samplers, etc.) as well.

src/BATTestCases.jl

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This file is a part of BATTestCases.jl, licensed under the MIT License (MIT).
2+
3+
"""
4+
BATTestCases
5+
6+
A collection of test cases for BAT.jl.
7+
"""
8+
module BATTestCases
9+
10+
using LinearAlgebra
11+
using Random
12+
using Statistics
13+
using ArraysOfArrays: nestedview
14+
using ArgCheck: @argcheck
15+
using Distributions
16+
using DocStringExtensions
17+
using QuadGK: quadgk
18+
using Random123: Philox4x
19+
using SpecialFunctions: gamma
20+
using StatsBase
21+
22+
import AdaptiveRejectionSampling
23+
24+
25+
include("rng.jl")
26+
include("funnel.jl")
27+
include("gaussian_shell.jl")
28+
include("multimodal_student_t.jl")
29+
30+
end # module

0 commit comments

Comments
 (0)