Skip to content

Commit

Permalink
Show method
Browse files Browse the repository at this point in the history
  • Loading branch information
kahaaga committed Aug 3, 2024
1 parent ea3f73c commit 7a2fb29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/methods/correlation/azadkia_chatterjee_coefficient.jl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ struct AzadkiaChatterjeeCoefficient{V, L, R, MI, NI, RM, RN} <: AssociationMeasu
theiler::Int
end

function Base.show(io::IO, m::AzadkiaChatterjeeCoefficient)
theiler = m.theiler
print(io, "AzadkiaChatterjeeCoefficient(; theiler = $theiler)")
end


min_inputs_vars(::AzadkiaChatterjeeCoefficient) = 2
max_inputs_vars(::AzadkiaChatterjeeCoefficient) = 3

Expand Down
6 changes: 5 additions & 1 deletion test/methods/correlation/azadkia_chatterjee_coefficient.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ y = rand(rng, n)
z = rand(rng, n)
m = AzadkiaChatterjeeCoefficient()
@test association(m, x, y) isa Real
@test association(m, x, y, z) isa Real
@test association(m, x, y, z) isa Real
# pretty printing
out = repr(AzadkiaChatterjeeCoefficient())
@test occursin("AzadkiaChatterjeeCoefficient", out)
@test occursin("theiler = ", out)

0 comments on commit 7a2fb29

Please sign in to comment.