Skip to content

Commit

Permalink
Fix erroneous change of constructor signature. (#427)
Browse files Browse the repository at this point in the history
* Fix erroneous change of constructor signature.

The `where V` must be *inside* the outer brackets, because the element type of the outcome vectors may be different (when categorical data are used - we can mix integers, strings, etc).

* Update changelog and increment version

* fix version/changelog and add test
  • Loading branch information
kahaaga authored Oct 6, 2024
1 parent fd2a5eb commit e0b7d76
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name = "ComplexityMeasures"
uuid = "ab4b797d-85ee-42ba-b621-05d793b346a2"
authors = "Kristian Agasøster Haaga <[email protected]>, George Datseries <[email protected]>"
repo = "https://github.com/juliadynamics/ComplexityMeasures.jl.git"
version = "3.7.0"
version = "3.7.1"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
2 changes: 1 addition & 1 deletion src/core/probabilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct Probabilities{T, N, S} <: AbstractArray{T, N}
dimlabels::NTuple{N, S}

function Probabilities(x::AbstractArray{T, N},
outcomes::Tuple{Vararg{V, N}} where V,
outcomes::Tuple{Vararg{V, N} where V},
dimlabels::NTuple{N, S};
normed::Bool = false) where {T, N, S}
if !normed # `normed` is an internal argument that skips checking the sum.
Expand Down
5 changes: 5 additions & 0 deletions test/probabilities/probabilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ outs = collect(1:10)
@test Probabilities(rand(rng, 10), (outs,)) isa Probabilities
@test Probabilities(rand(rng, 10), (outs,), (:x1, )) isa Probabilities

# outcome vectors for different eltypes
outs1 = ["a", "b"]; outs2 = [1, 2];
cts = rand(1:10, 2, 2);
@test Probabilities(cts, (outs1, outs2)) isa Probabilities

# ----------------------------------------------------------------
# Base extensions
# ----------------------------------------------------------------
Expand Down

2 comments on commit e0b7d76

@kahaaga
Copy link
Member Author

@kahaaga kahaaga commented on e0b7d76 Oct 6, 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/116693

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 v3.7.1 -m "<description of version>" e0b7d76f79f68b0145c4e1995824da3d2c4b3acc
git push origin v3.7.1

Please sign in to comment.