Skip to content

Rename DisjointSet and resolve errors - #700

Merged
oxinabox merged 4 commits into
JuliaCollections:masterfrom
c-p-murphy:c-p-murphy/update_disjointset
Nov 16, 2020
Merged

oxinabox merged 4 commits into
JuliaCollections:masterfrom
c-p-murphy:c-p-murphy/update_disjointset

Conversation

@c-p-murphy

@c-p-murphy c-p-murphy commented Nov 11, 2020 •

Copy link
Copy Markdown
Contributor

Addresses #694 and resolves error when pushing a repeated element to a DisjointSet:

julia> ds = DisjointSets('a':'e')
DisjointSets{Char} with 5 elements:
  'a'
  'b'
  'c'
  'd'
  'e'

julia> ds.intmap
Dict{Char,Int64} with 5 entries:
  'a' => 1
  'c' => 3
  'd' => 4
  'e' => 5
  'b' => 2

julia> ds.internal
IntDisjointSets{Int64}([1, 2, 3, 4, 5], [0, 0, 0, 0, 0], 5)

julia> push!(ds, 'b')
'b': ASCII/Unicode U+0062 (category Ll: Letter, lowercase)

julia> ds.intmap
Dict{Char,Int64} with 5 entries:
  'a' => 1
  'c' => 3
  'd' => 4
  'e' => 5
  'b' => 6

julia> ds.internal
IntDisjointSets{Int64}([1, 2, 3, 4, 5, 6], [0, 0, 0, 0, 0, 0], 6)

@c-p-murphy c-p-murphy changed the title Rename Disjoint Rename DisjointSet and resolve errors Nov 11, 2020
@oxinabox

Copy link
Copy Markdown
Member

Cool so we need to @deprecate_binding DisjointSets DisjointSet
and @deprecate DisjointSets{T}(xs::T...) where T = DisjointSet{T}(xs)

and test those depracations behave as expected

Comment thread test/test_disjoint_set.jl Resolved

@oxinabox oxinabox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
One last suggestion on tests and then we can merge

@oxinabox

Copy link
Copy Markdown
Member

thanks, awesome

@oxinabox
oxinabox merged commit 19eabfa into JuliaCollections:master Nov 16, 2020
@blegat blegat mentioned this pull request Dec 7, 2020
@ChrisRackauckas

Copy link
Copy Markdown
Contributor

Why rename? This seems like pointless code churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants