Skip to content

Commit

Permalink
Merge pull request #11 from tpgillam/tg/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes, more CI
  • Loading branch information
tpgillam authored Nov 7, 2021
2 parents 997c157 + d28c5c6 commit 5a883d3
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 10 deletions.
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()'
20 changes: 20 additions & 0 deletions .github/workflows/blue_style_formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Format suggestions

on:
pull_request:

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1
- run: |
julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; format(".", BlueStyle(); verbose=true)'
- uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter
fail_on_error: true
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
version:
- '1.5'
- '1.6'
- '1.7-nightly'
os:
- ubuntu-latest
arch:
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 = "AssociativeWindowAggregation"
uuid = "444271a7-5434-4a02-b82b-0e30a9223c60"
authors = ["Thomas Gillam <[email protected]>"]
version = "0.3.0"
version = "0.3.1"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
1 change: 0 additions & 1 deletion examples/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[deps]
AssociativeWindowAggregation = "444271a7-5434-4a02-b82b-0e30a9223c60"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
OnlineStats = "a15396b6-48d5-5d58-9928-6d29437db91e"
OnlineStatsBase = "925886fa-5bf2-5e8e-b522-a9147a512338"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
Expand Down
20 changes: 12 additions & 8 deletions src/base.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
"""
WindowedAssociativeOp{T,Op,Op!,V<:AbstractVector{T}}
WindowedAssociativeOp{T,Op,Op!,V<:AbstractVector{T}}(previous_cumsum::V, values::V)
WindowedAssociativeOp{T,Op,Op!}()
WindowedAssociativeOp{T,Op}()
State associated with a windowed aggregation of a binary associative operator.
If `Op!` is not specifiied, it will default to `Op`. However, for non-bitstypes, it can be
beneficial to provide this methods to reduce memory allocations.
`V` will default to a `Vector{T}`.
If `Op!` is not specified, it will default to `Op`. However, for non-bitstypes, it can be
beneficial to provide this method to reduce memory allocations.
`V` will default to a `Vector{T}`. For windows of a fixed and known length, a circular
buffer will be more efficient — see `FixedWindowAssociativeOp`.
# Method
Expand Down Expand Up @@ -37,12 +41,12 @@ cumulative sums. We create a new, empty, `B`.
window length.
# Type parameters
- `T`: The type of the values of the array.
- `T`: The type of the values in the window.
- `Op`: Any binary, associative, function.
- `Op!`: Op!(x, y) will perform `x + y`, storing the result in `x`.
- `V`: The subtype of AbstractVector{T} used for internal state.
- `Op!`: `Op!(x, y)` will perform `x + y`, storing the result in `x`.
- `V`: The subtype of `AbstractVector{T}` used for internal state.
# Fields
# Fields (for internal use only)
- `previous_cumsum::Vector{T}`: Corresponds to array `A` above.
- `ri_previous_cumsum::Int`: A reverse index into `previous_cumsum`, once it contains
values. It should be subtracted from `end` in order to obtain the appropriate index.
Expand Down

2 comments on commit 5a883d3

@tpgillam
Copy link
Owner Author

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/48348

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.3.1 -m "<description of version>" 5a883d3a04fecdfee0ed1b50fa433ede0372edc2
git push origin v0.3.1

Please sign in to comment.