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

Prepare for package registration #72

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
14 changes: 2 additions & 12 deletions .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
indent = 2
margin = 68
format_markdown = true
verbose = true
always_for_in = true
whitespace_ops_in_indices = true
remove_extra_newlines = true
pipe_to_function_call = true
always_use_return = true
whitespace_in_kwargs = false
style = "yas"
format_docstrings = true
conditional_to_if = true
trailing_comma = true
format_markdown = true
16 changes: 16 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
on:
push:
paths-ignore:
- 'README.md'
branches:
- main
pull_request:
paths-ignore:
- 'README.md'
branches:
- main
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1'
- 'min'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- name: Cache
uses: julia-actions/cache@v2
with:
cache-compiled: "true"
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/formatcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Format Check
on:
push:
branches:
- main
- /^release-.*$/
tags: ["*"]
paths:
- "**/*.jl"
- ".github/workflows/FormatCheck.yml"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "**/*.jl"
- ".github/workflows/FormatCheck.yml"
jobs:
format-check:
name: Julia
# These permissions are needed to:
# - Delete old caches: https://github.com/julia-actions/cache#usage
# - Post formatting suggestions: https://github.com/reviewdog/action-suggester#required-permissions
permissions:
actions: write
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- uses: julia-actions/cache@v2
- name: Install JuliaFormatter
shell: julia --project=@format --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(; name="JuliaFormatter", version="1"))
- name: Check formatting
shell: julia --project=@format --color=yes {0}
run: |
using JuliaFormatter
format("."; verbose=true) || exit(1)
# Add formatting suggestions to non-draft PRs even if when "Check formatting" fails
- uses: reviewdog/action-suggester@db4abb16fbaabe386831e5addb7be1485d0d63d3 # v1.18.0
if: ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
with:
tool_name: JuliaFormatter
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ data/
/.quarto/

/.luarc.json
lcov.info
*.cov
24 changes: 24 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"access_right": "open",
"license": "MIT",
"title": "Embrace Uncertainty",
"description": "A Julia package accompanying the online book Embrace Uncertainty",
"upload_type": "software",
"creators": [
{
"affiliation": "Beacon Biosignals",
"name": "Alday, Phillip M.",
"orcid": "0000-0002-9984-5745"
},
{
"affiliation": "University of Potsdam",
"name": "Kliegl, Reinhold",
"orcid": "0000-0002-0180-8488"
},
{
"affiliation": "University of Wisconsin - Madison",
"name": "Bates, Douglas",
"orcid": "0000-0001-8316-9503"
}
]
}
19 changes: 7 additions & 12 deletions LDT_accuracy.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@ and define some constants
```{julia}
#| code-fold: true
#| output: false
@isdefined(contrasts) || const contrasts = Dict{Symbol, Any}()
@isdefined(contrasts) || const contrasts = Dict{Symbol,Any}()
@isdefined(progress) || const progress = false
```

## Create the dataset


```{julia}
#| output: false
trials = innerjoin(
DataFrame(dataset(:ELP_ldt_trial)),
select(DataFrame(dataset(:ELP_ldt_item)), :item, :isword, :wrdlen),
on = :item
)
trials = innerjoin(DataFrame(dataset(:ELP_ldt_trial)),
select(DataFrame(dataset(:ELP_ldt_item)), :item, :isword, :wrdlen);
on=:item)
```

```{julia}
Expand All @@ -54,20 +51,18 @@ This takes about ten to fifteen minutes on a recent laptop
```{julia}
contrasts[:isword] = EffectsCoding()
contrasts[:wrdlen] = Center(8)
@time gm1 = let f = @formula(acc ~ 1 + isword * wrdlen + (1|item) + (1|subj))
@time gm1 = let f = @formula(acc ~ 1 + isword * wrdlen + (1 | item) + (1 | subj))
fit(MixedModel, f, trials, Bernoulli(); contrasts, progress, init_from_lmm=(:β, :θ))
end
```


```{julia}
print(gm1)
```


```{julia}
#| fig-cap: Conditional modes and 95% prediction intervals on random effects for subject in model gm1
#| label: fig-gm1condmodesubj
#| code-fold: true
qqcaterpillar!(Figure(; size=(800,800)), gm1, :subj)
```
qqcaterpillar!(Figure(; size=(800, 800)), gm1, :subj)
```
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020-2024 Phillip Alday, Reinhold Kliegl and Douglas Bates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 20 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "EmbraceUncertainty"
uuid = "81be8970-b14c-4107-8889-06289fef228c"
authors = ["Phillip Alday <[email protected]>, Reinhold Kliegl <[email protected]>, Douglas Bates <[email protected]>"]
authors = ["Phillip Alday <[email protected]>", "Reinhold Kliegl <[email protected]>", "Douglas Bates <[email protected]>"]
version = "0.1.0"

[deps]
Expand Down Expand Up @@ -44,25 +44,32 @@ ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
AlgebraOfGraphics = "0.6, 0.7, 0.8"
Aqua = "0.8.7"
Arrow = "2"
BenchmarkTools = "1"
CSV = "0.10"
CairoMakie = "0.11, 0.12"
CategoricalArrays = "0.10"
Chain = "0.5,0.6"
DataAPI = "1"
DataFrameMacros = "0.3,0.4"
DataFrames = "1.3"
Dates = "1"
Distributions = "0.25"
Downloads = "1"
Effects = "1"
FreqTables = "0.4"
GLM = "1"
LinearAlgebra = "1"
Markdown = "1"
MixedModels = "4,5"
MixedModelsDatasets = "0.1.1"
MixedModelsMakie = "0.4"
NLopt = "1"
Pkg = "1"
PooledArrays = "1"
RCall = "0.13,0.14"
RectangularFullPacked = "0.2"
Random = "1"
SHA = "0.7"
Scratch = "1"
Expand All @@ -71,6 +78,17 @@ StatsAPI = "1"
StatsBase = "0.33, 0.34"
StatsModels = "0.7"
Tables = "1"
TidierPlots = "0.8"
Test = "1.11.0"
TestSetExtensions = "3.0.0"
TypedTables = "1"
ZipFile = "0.10"
julia = "1.8"
julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestSetExtensions = "98d24dd4-01ad-11ea-1b02-c9a08f80db04"

[targets]
test = ["Aqua", "Test", "TestSetExtensions"]
Loading
Loading