Skip to content
This repository was archived by the owner on Mar 22, 2025. It is now read-only.

Commit 5a883d3

Browse files
authored
Merge pull request #11 from tpgillam/tg/minor-fixes
Minor fixes, more CI
2 parents 997c157 + d28c5c6 commit 5a883d3

File tree

6 files changed

+50
-10
lines changed

6 files changed

+50
-10
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
jobs:
7+
CompatHelper:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Pkg.add("CompatHelper")
11+
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12+
- name: CompatHelper.main()
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
16+
run: julia -e 'using CompatHelper; CompatHelper.main()'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Format suggestions
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
format:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: julia-actions/setup-julia@latest
12+
with:
13+
version: 1
14+
- run: |
15+
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
16+
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true)'
17+
- uses: reviewdog/action-suggester@v1
18+
with:
19+
tool_name: JuliaFormatter
20+
fail_on_error: true

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
version:
1111
- '1.5'
1212
- '1.6'
13+
- '1.7-nightly'
1314
os:
1415
- ubuntu-latest
1516
arch:

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AssociativeWindowAggregation"
22
uuid = "444271a7-5434-4a02-b82b-0e30a9223c60"
33
authors = ["Thomas Gillam <tpgillam@googlemail.com>"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

examples/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[deps]
22
AssociativeWindowAggregation = "444271a7-5434-4a02-b82b-0e30a9223c60"
33
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
4-
OnlineStats = "a15396b6-48d5-5d58-9928-6d29437db91e"
54
OnlineStatsBase = "925886fa-5bf2-5e8e-b522-a9147a512338"
65
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
76
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"

src/base.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
"""
2-
WindowedAssociativeOp{T,Op,Op!,V<:AbstractVector{T}}
2+
WindowedAssociativeOp{T,Op,Op!,V<:AbstractVector{T}}(previous_cumsum::V, values::V)
3+
WindowedAssociativeOp{T,Op,Op!}()
4+
WindowedAssociativeOp{T,Op}()
35
46
State associated with a windowed aggregation of a binary associative operator.
57
6-
If `Op!` is not specifiied, it will default to `Op`. However, for non-bitstypes, it can be
7-
beneficial to provide this methods to reduce memory allocations.
8-
`V` will default to a `Vector{T}`.
8+
If `Op!` is not specified, it will default to `Op`. However, for non-bitstypes, it can be
9+
beneficial to provide this method to reduce memory allocations.
10+
11+
`V` will default to a `Vector{T}`. For windows of a fixed and known length, a circular
12+
buffer will be more efficient — see `FixedWindowAssociativeOp`.
913
1014
# Method
1115
@@ -37,12 +41,12 @@ cumulative sums. We create a new, empty, `B`.
3741
window length.
3842
3943
# Type parameters
40-
- `T`: The type of the values of the array.
44+
- `T`: The type of the values in the window.
4145
- `Op`: Any binary, associative, function.
42-
- `Op!`: Op!(x, y) will perform `x + y`, storing the result in `x`.
43-
- `V`: The subtype of AbstractVector{T} used for internal state.
46+
- `Op!`: `Op!(x, y)` will perform `x + y`, storing the result in `x`.
47+
- `V`: The subtype of `AbstractVector{T}` used for internal state.
4448
45-
# Fields
49+
# Fields (for internal use only)
4650
- `previous_cumsum::Vector{T}`: Corresponds to array `A` above.
4751
- `ri_previous_cumsum::Int`: A reverse index into `previous_cumsum`, once it contains
4852
values. It should be subtracted from `end` in order to obtain the appropriate index.

0 commit comments

Comments
 (0)