dendrograms / astrodendro

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

RecursionError in Dendrogram.load_from #166

Open GiantMolecularCloud opened 5 years ago

GiantMolecularCloud commented 5 years ago

I computed a dendrogram with 12k structures and saved it as a fits file. When trying to reload this dendrogram I ran into a RecursionError in collect(d) in io/util.py.

The system recursion limit (sys.getrecursionlimit()) on my machine is 3000 and raising the limit to 10000 works around the issue. Interestingly, this error does not occur for another dendrogram with 7600 structures that is also way beyond the limit.

It might be helpful and generally favourable to rewrite the problematic function to use iterations instead of recursions.