Skip to content

Commit

Permalink
Improved code style and PEP8 conformance (examples)
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRhiem committed Nov 10, 2014
1 parent 23ecb61 commit d683755
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
9 changes: 6 additions & 3 deletions examples/draw.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""
Example for drawing a molecule using mogli and GR
"""
import gr
import mogli

molecules = mogli.read('examples/dna.xyz')
gr.clearws()
gr.setviewport(0, 1, 0, 1)
mogli.draw(molecules[0], bonds_param=1.15, camera=((60, 0, 0),
(0, 0, 0),
(0, 1, 0)))
(0, 0, 0),
(0, 1, 0)))
gr.settextalign(gr.TEXT_HALIGN_CENTER, gr.TEXT_VALIGN_TOP)
gr.text(0.5, 1.0, 'DNA example')
gr.updatews()
gr.updatews()
5 changes: 4 additions & 1 deletion examples/export.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""
Example for exporting a molecule to an HTML5 file using mogli
"""
import mogli

molecules = mogli.read('examples/dna.xyz')
mogli.BOND_RADIUS = 0.05
mogli.export(molecules[0], 'dna.html', width=1920, height=1080,
bonds_param=1.15, camera=((40, 0, 0),
(0, 0, 0),
(0, 1, 0)))
(0, 1, 0)))
5 changes: 4 additions & 1 deletion examples/show.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
"""
Example for interactively displaying a molecule using mogli
"""
import mogli

molecules = mogli.read('examples/dna.xyz')
for molecule in molecules:
mogli.show(molecule, bonds_param=1.15)
mogli.show(molecule, bonds_param=1.15)

0 comments on commit d683755

Please sign in to comment.