<commit_before>#!/usr/bin/env python

from __future__ import division

'''
Created on Nov 8, 2011
'''

__author__="<NAME>"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "Nov 8, 2011"

import argparse
from collections import OrderedDict

from pymatgen.io.vaspio import Vasprun
from pymatgen.core.electronic_structure import plot_dos

parser = argparse.ArgumentParser(description='''Convenient DOS Plotter for vasp runs.
Author: <NAME>
Version: 1.0
Last updated: Nov 8 2011''')
parser.add_argument('filename', metavar='filename', type=str, nargs = 1, help='vasprun.xml file to plot')
parser.add_argument('-s', '--site', dest='site', action='store_const', const=True, help='plot site projected DOS')
parser.add_argument('-e', '--element', dest='element', action='store_const', const=True, help='plot element projected DOS')
parser.add_argument('-o', '--orbital', dest="orbital", action='store_const', const=True, help='plot orbital projected DOS')

args = parser.parse_args()
v = Vasprun(args.filename[0])
dos = v.complete_dos

all_dos = OrderedDict()
all_dos['Total'] = dos

structure = v.final_structure

if args.site:
    for i in xrange(len(structure)):
        site = structure[i]
        all_dos['Site ' + str(i) + site.specie.symbol] = dos.get_site_dos(site)
if args.element:
    all_dos.update(dos.get_element_dos())
if args.orbital:
    all_dos.update(dos.get_spd_dos())
    
plot_dos(all_dos)<commit_msg>Fix minor spacing issue in plot_dos script.<commit_after>#!/usr/bin/env python

from __future__ import division

'''
Created on Nov 8, 2011
'''

__author__="<NAME>"
__copyright__ = "Copyright 2011, The Materials Project"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "Nov 8, 2011"

import argparse
from collections import OrderedDict

from pymatgen.io.vaspio import Vasprun
from pymatgen.core.electronic_structure import plot_dos

parser = argparse.ArgumentParser(description='''Convenient DOS Plotter for vasp runs.
Author: <NAME>
Version: 1.0
Last updated: Nov 8 2011''')
parser.add_argument('filename', metavar='filename', type=str, nargs = 1, help='vasprun.xml file to plot')
parser.add_argument('-s', '--site', dest='site', action='store_const', const=True, help='plot site projected DOS')
parser.add_argument('-e', '--element', dest='element', action='store_const', const=True, help='plot element projected DOS')
parser.add_argument('-o', '--orbital', dest="orbital", action='store_const', const=True, help='plot orbital projected DOS')

args = parser.parse_args()
v = Vasprun(args.filename[0])
dos = v.complete_dos

all_dos = OrderedDict()
all_dos['Total'] = dos

structure = v.final_structure

if args.site:
    for i in xrange(len(structure)):
        site = structure[i]
        all_dos['Site ' + str(i) +" "+ site.specie.symbol] = dos.get_site_dos(site)
if args.element:
    all_dos.update(dos.get_element_dos())
if args.orbital:
    all_dos.update(dos.get_spd_dos())
    
plot_dos(all_dos)
{'fraction_non_alphanumeric': 0.14700065919578115, 'fraction_numerical': 0.016479894528675015, 'mean_word_length': 5.5835140997830806, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5858585', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1017, 'n_words': 255}