dendrograms / astrodendro

Generate a dendrogram from a dataset
https://dendrograms.readthedocs.io/
Other
37 stars 38 forks source link

Collection of helpful is_indepndent functions #76

Closed ChrisBeaumont closed 11 years ago

ChrisBeaumont commented 11 years ago

If there are specific pruning functions that would be generically useful to use for Dendrogram.compute(is_independent), we should provide them. Some ideas:

It would be cool if these were composable, so that I could write something like

Dendrogram.compute(x, is_independent = min_peak(3) & min_sum(10))

And that would build an object that runs both tests. I'm not sure if &, and, or + makes the most sense to use.

astrofrog commented 11 years ago

Good idea. Regarding how to combine them, we could simply require a tuple of functions. This has the advantage that it will work for plain user functions too (which otherwise wouldn't understand the combination operators). So something like:

Dendrogram.compute(x, is_independent = (min_peak(3), min_sum(10)))

Although this doesn't allow different (and/or) logic. What do you think? Feel free to take a stab at implementing this, I won't be working on the code anymore for the next few days since I'll be travelling.

ChrisBeaumont commented 11 years ago

Closed via #78