Skip to content

Commit c174ab6

Browse files
authored
Merge pull request #188 from alyst/cleanup_deprecate
Cleanup deprecations and bump package version
2 parents 9aa2ffb + cd9cee4 commit c174ab6

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Clustering"
22
uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
3-
version = "0.13.3"
3+
version = "0.13.4"
44

55
[deps]
66
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"

src/deprecate.jl

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414

1515
# FIXME remove after deprecation period for merge/labels/height/method
1616
Base.propertynames(hclu::Hclust, private::Bool = false) =
17-
(:merges, :heights, :order, :linkage,
17+
(fieldnames(hclu)...,
1818
#= deprecated as of 0.12 =# :height, :labels, :merge, :method)
1919

2020
# FIXME remove after deprecation period for merge/labels/height/method
2121
@inline function Base.getproperty(hclu::Hclust, prop::Symbol)
22-
if prop === :height
22+
if prop === :height # deprecated as of 0.12
2323
Base.depwarn("Hclust::height is deprecated, use Hclust::heights", Symbol("Hclust::height"))
2424
return getfield(hclu, :heights)
25-
elseif prop === :labels
25+
elseif prop === :labels # deprecated as of 0.12
2626
Base.depwarn("Hclust::labels is deprecated and will be removed in future versions", Symbol("Hclust::labels"))
2727
return 1:nnodes(hclu)
28-
elseif prop === :merge
28+
elseif prop === :merge # deprecated as of 0.12
2929
Base.depwarn("Hclust::merge is deprecated, use Hclust::merges", Symbol("Hclust::merge"))
3030
return getfield(hclu, :merges)
31-
elseif prop === :method
31+
elseif prop === :method # deprecated as of 0.12
3232
Base.depwarn("Hclust::method is deprecated, use Hclust::linkage", Symbol("Hclust::method"))
3333
return getfield(hclu, :linkage)
3434
else
@@ -38,17 +38,30 @@ end
3838

3939
# FIXME remove after deprecation period for cweights
4040
Base.propertynames(clu::KmeansResult, private::Bool = false) =
41-
(:centers, :assignments, :costs, :counts, :wcounts,
42-
:totalcost, :iterations, :converged,
43-
#= deprecated as of 0.13.2 =# :cweights)
41+
(fieldnames(clu)..., #= deprecated as of 0.13.2 =# :cweights)
4442

4543
# FIXME remove after deprecation period for cweights
4644
@inline function Base.getproperty(clu::KmeansResult, prop::Symbol)
47-
if prop === :cweights
45+
if prop === :cweights # deprecated as of 0.13.2
4846
Base.depwarn("KmeansResult::cweights is deprecated, use wcounts(clu::KmeansResult)",
4947
Symbol("KmeansResult::cweights"))
5048
return clu.wcounts
5149
else
5250
return getfield(clu, prop)
5351
end
5452
end
53+
54+
# FIXME remove after deprecation period for acosts
55+
Base.propertynames(kmed::KmedoidsResult, private::Bool = false) =
56+
(fieldnames(kmed)..., #= deprecated since v0.13.4=# :acosts)
57+
58+
# FIXME remove after deprecation period for acosts
59+
function Base.getproperty(kmed::KmedoidsResult, prop::Symbol)
60+
if prop == :acosts # deprecated since v0.13.4
61+
Base.depwarn("KmedoidsResult::acosts is deprecated, use KmedoidsResult::costs",
62+
Symbol("KmedoidsResult::costs"))
63+
return getfield(kmed, :costs)
64+
else
65+
return getfield(kmed, prop)
66+
end
67+
end

src/kmedoids.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ mutable struct KmedoidsResult{T} <: ClusteringResult
3030
converged::Bool # whether the procedure converged
3131
end
3232

33-
# FIXME remove after deprecation period for acosts
34-
Base.propertynames(kmed::KmedoidsResult, private::Bool = false) =
35-
(fieldnames(kmed)..., #= deprecated since v0.13.4=# :acosts)
36-
37-
# FIXME remove after deprecation period for acosts
38-
function Base.getproperty(kmed::KmedoidsResult, prop::Symbol)
39-
if prop == :acosts # deprecated since v0.13.4
40-
Base.depwarn("KmedoidsResult::acosts is deprecated, use KmedoidsResult::costs", Symbol("KmedoidsResult::costs"))
41-
return getfield(kmed, :costs)
42-
else
43-
return getfield(kmed, prop)
44-
end
45-
end
46-
47-
4833
#### interface functions
4934

5035
const _kmed_default_init = :kmpp

0 commit comments

Comments
 (0)