-
Notifications
You must be signed in to change notification settings - Fork 3
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
Allow manual coloring of atoms #250
Conversation
Allows sending a manual coloring of atoms with the atoms.colors attribute
I like the feature and it works nicely. But I'd suggest some changes: I'd like to be able to access the colors when retrieving the atoms like: from zndraw import ZnDraw
vis = ZnDraw(url="http://127.0.0.1:1234/")
print(vis[0].colors) # list I think this also has to be a potential to be expanded by some general information. My suggestion would be to expand this to generally work with from zndraw import ZnDraw
vis = ZnDraw(url="http://127.0.0.1:1234/")
atoms = ase.build.molecule("H2O")
atoms.info["colors"] = [None, "#FF3333", None] # None = fill color automatically
vis[0] = atoms
print(atoms.info["colors"]) # ["#FFFFFF", "#FF3333", "#FFFFFF"] # automatic color for hydrogens is white. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good, please consider my comment above.
This would definitely be a good addition. The info tag could also be used as a means to save information about future features such as vector-fields and obstacles. I will look into it. |
or better use |
for more information, see https://pre-commit.ci
Should work as intended now. Individual atoms can be manually colored before handing them to ZnDraw using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Codecov Report
@@ Coverage Diff @@
## main #250 +/- ##
==========================================
+ Coverage 39.78% 39.89% +0.10%
==========================================
Files 13 13
Lines 1106 1108 +2
==========================================
+ Hits 440 442 +2
Misses 666 666
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
Allows sending a manual coloring of atoms with the atoms.colors attribute