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

support the visualization of the structure with VESTA #1093

Merged
merged 1 commit into from
Feb 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions aiida/cmdline/commands/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,34 @@ def _show_ase(self,exec_name,structure_list):
except ImportError:
raise

def _show_vesta(self, exec_name, structure_list):
"""
Plugin for VESTA
This VESTA plugin was added by Yue-Wen FANG and Abel Carreras
at Kyoto University in the group of Prof. Isao Tanaka's lab

"""
import tempfile, subprocess

with tempfile.NamedTemporaryFile(suffix='.cif') as f:
for structure in structure_list:
f.write(structure._exportstring('cif')[0])
f.flush()

try:
subprocess.check_output([exec_name, f.name])
except subprocess.CalledProcessError:
# The program died: just print a message
print "Note: the call to {} ended with an error.".format(
exec_name)
except OSError as e:
if e.errno == 2:
print ("No executable '{}' found. Add to the path, "
"or try with an absolute path.".format(exec_name))
sys.exit(1)
else:
raise

def _show_vmd(self, exec_name, structure_list):
"""
Plugin for vmd
Expand Down