Skip to content

Commit

Permalink
add docs for example_data (#42)
Browse files Browse the repository at this point in the history
* add docs for `example_data`

* formatting tweak

* CI update

* add to rendered docs
  • Loading branch information
palday authored Mar 25, 2024
1 parent db4c6b0 commit 36d3f06
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -25,7 +25,7 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -40,14 +40,14 @@ jobs:
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v4
with:
files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TopoPlots"
uuid = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"
authors = ["Benedikt Ehinger", "Simon Danisch", "Beacon Biosignals, Inc."]
version = "0.1.6"
version = "0.1.7"

[deps]
CloughTocher2DInterpolation = "b70b374f-000b-463f-88dc-37030f004bd0"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ TopoPlots = "2bdbdf9c-dbd8-403f-947b-1a4e0dd41a7a"

[compat]
# other bits of compat are handled by TopoPlots compat
Documenter = "1"
Documenter = "1.3"
5 changes: 4 additions & 1 deletion docs/src/eeg.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ TopoPlots.eeg_topoplot(rand(19), labels; axis=(aspect=DataAspect(),), label_text
If the channels aren't 10/20, one can still plot them, but then the positions need to be passed as well:

```@example 1
data, positions = TopoPlots.example_data()
labels = ["s$i" for i in 1:size(data, 1)]
TopoPlots.eeg_topoplot(data[:, 340, 1], labels; positions=positions, axis=(aspect=DataAspect(),))
```

```@docs
TopoPlots.example_data
```
19 changes: 19 additions & 0 deletions src/TopoPlots.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ using CloughTocher2DInterpolation # pure julia implementation

assetpath(files...) = normpath(joinpath(dirname(@__DIR__), "assets", files...))

"""
example_data()
Load EEG example data.
Returns a two-tuple:
- data: a (64, 400, 3) Float32 array of channel x timepoint x stat array.
Timepoints correponds to samples at 500Hz from -0.3s to 0.5s relative to stimulus onset.
Stats are mean over subjects, standard errors over subjects, and associated p-value from a t-test.
For demonstration purposes, the first stat dimension is generally the most applicable.
- positions: a length-64 Point2f vector of positions for each channel in data.
# Data source
Ehinger, B. V., König, P., & Ossandón, J. P. (2015).
Predictions of Visual Content across Eye Movements and Their Modulation by Inferred Information.
The Journal of Neuroscience, 35(19), 7403–7413. https://doi.org/10.1523/JNEUROSCI.5114-14.2015
"""
function example_data()
data = Array{Float32}(undef, 64, 400, 3)
read!(TopoPlots.assetpath("example-data.bin"), data)
Expand Down

2 comments on commit 36d3f06

@palday
Copy link
Collaborator Author

@palday palday commented on 36d3f06 Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/103602

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.7 -m "<description of version>" 36d3f06df53a0736047e091c02fa287b160d48e2
git push origin v0.1.7

Please sign in to comment.