Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clustering constructor is fickle #30

Closed
jg-you opened this issue Aug 6, 2019 · 2 comments
Closed

Clustering constructor is fickle #30

jg-you opened this issue Aug 6, 2019 · 2 comments
Assignees

Comments

@jg-you
Copy link
Contributor

jg-you commented Aug 6, 2019

Last issue I swear!
While testing the code for PR #29 , I noticed that the constructor of the Clustering object is very sensitive to the type of input given.

For example, when I construct a clustering from the following dictionary mapping clusters to elements

x = {0: [0,1,2,3,4], 1:[5,6,7,8,9]}
clu  = Clustering(clu2elm_dict=x)   

no warning are raised, yet a bunch of functions in the sim subpackage break down, because they expect a dictionary of sets.

I think that it would be easy to cast all iterables to sets at construction time, but I don't know whether this would affect other parts of the code?

@ajgates42
Copy link
Collaborator

Geez! I guess close to release I started to get sloppy ; ). I'll take another pass to clean things up.

@ajgates42 ajgates42 self-assigned this Aug 7, 2019
@jg-you
Copy link
Contributor Author

jg-you commented Aug 7, 2019

Nice!
While at it, it would probably be useful to support scikit style construction with clusterings declared as
[0,0,0,0,0,0,1,1,1,0,0,0] etc. I can put a PR in for that.

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

No branches or pull requests

2 participants