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

ptable_heatmap_splits raises unexpected TypeErrors #145

Closed
janosh opened this issue May 15, 2024 · 1 comment · Fixed by #146
Closed

ptable_heatmap_splits raises unexpected TypeErrors #145

janosh opened this issue May 15, 2024 · 1 comment · Fixed by #146
Labels
bug Something isn't working matplotlib Concerning matplotlib-powered functions ptable Periodic table

Comments

@janosh
Copy link
Owner

janosh commented May 15, 2024

@DanielYang59 i noticed a few bugs in ptable_heatmap_splits

ptable_heatmap_splits({"H": [1, 2]})
>>> TypeError: 'NoneType' object is not callable

you need to explicitly pass a colormap to avoid this. we should set a default. also:

ptable_heatmap_splits({"H": {"A": 1, "B": 2}.values()}, colormap="RdBu_r")
>>> TypeError: Unsupported data type.

we currently don't handle type dict_values. if you wrap dict_values in list, it works:

ptable_heatmap_splits({"H": list({"A": 1, "B": 2}.values())}, colormap="RdBu_r")
@janosh janosh added bug Something isn't working matplotlib Concerning matplotlib-powered functions ptable Periodic table labels May 15, 2024
@DanielYang59
Copy link
Collaborator

DanielYang59 commented May 16, 2024

Thanks for reporting. I don't even know why colormap is default as None to start with (because None would not work as a valid colormap), must be a huge oversight from my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working matplotlib Concerning matplotlib-powered functions ptable Periodic table
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants