CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

adding atoms labels to draw_3d function #22

Closed gbrault closed 3 years ago

gbrault commented 5 years ago

to draw_3d function, add one variable, atomlabel, which defaults to true.

def draw_3d(self, width=300, height=500, style='stick', Hs=True, atomlabel=True):

then just before p.zoomTo(), add this code

            if atomlabel:
                p.addPropertyLabels("atom","","")

Atoms labels will then display, which is nice for people like me which are not chemical engineers! This works with latest (python 3.7.3) conda installed version of thermo and py3Dmol from conda-forge. xylene

CalebBell commented 5 years ago

Hi Dr. Brault,

This looks like a good addition. Part of "The Zen of Python" is "Explicit is better than implicit"; so it's a very Pythonic addition! I'll try to get it into the next release of thermo!

Sincerely, Caleb

CalebBell commented 3 years ago

Hi Gilbert, This is added to the development version of thermo now. Sincerely, Caleb

gbrault commented 3 years ago

Oh!, I had forget this one! Thanks Caleb!