-
Notifications
You must be signed in to change notification settings - Fork 39
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
Standard astro dendro tree plot is getting error: "TypeError: 'int' object is not subscriptable" #159
Comments
It looks like the issue is that the |
I also just remembered having another issue with .plot_tree previously (issue #157) for which @keflavich suggested I use the developer version, which I did, so maybe this error is only in the developer version? |
@astrofrog @keflavich Any thoughts? Better to switch back to the non-developer version? Thank you! |
I'm currently using version 0.2.0 of astrodendro and i'm also experiencing the same issue as @battersbot . Is there by any chance an update on this issue? |
I am getting the same error. Te version I am using is: In [29]: p.plot_tree(ax, structure=7, color='red') TypeError Traceback (most recent call last) ~/anaconda3/lib/python3.6/site-packages/astrodendro/plot.py in plot_tree(self, ax, structure, subtree, autoscale, **kwargs) ~/anaconda3/lib/python3.6/site-packages/astrodendro/plot.py in get_lines(self, structures, subtree, **kwargs) TypeError: 'int' object is not subscriptable |
This is still an issue for the last release (0.2.0) but was fixed at some point in the current dev version (also noted in #157). While a new release should be prioritized, the solution for users is to install the dev branch:
|
I have upgraded to 0.3.0.dev0 but am still getting the same error... |
The error is because the function actually expects a list, so a dumb way to fix it is 8-->[8], or modify the source code so that instead of taking the elements from the input (structure[0]) take the entrance directly. So:
|
Bringing this up again as I came across this bug again. The fix suggested by rolando works for me - suggest that the source code be updated to address this! And thanks for the fix in the meantime rolando! |
Could you submit a PR with the suggested change @rolando980709? Your snippet suggests a workaround but not the fix. @battersbot until the change is merged, the workaround is straightforward and is what I'd suggest using. If there's some reason you can't, though, more information would be helpful (e.g., if you encounter this error during GUI operations). |
Sorry for jumping in here... One thing I would suggest is to edit the code example here to use lists instead of single integers as input. The current example will not work until the suggested change is implemented, and it might confuse new users. |
I think this might be fixed by #168 - we should clean up and merge that PR. |
I keep getting the error "TypeError: 'int' object is not subscriptable" when trying to plot a dendrogram tree. I have done this successfully before, and only today am having this issue. So, I attempted the example code from: http://dendrograms.readthedocs.io/en/stable/plotting.html#making-plots-for-publications
to be sure, and indeed I get the same error.
Example code from the website and the error is appended below as a screenshot
The text was updated successfully, but these errors were encountered: