aiidateam / aiida-quantumespresso

The official AiiDA plugin for Quantum ESPRESSO
https://aiida-quantumespresso.readthedocs.io
Other
55 stars 80 forks source link

Document simple script to convert QE input format to other formats #511

Open giovannipizzi opened 4 years ago

giovannipizzi commented 4 years ago

E.g. with this, that can be useful to many:

def convert_aiida_in(path_in, path_out):
    from aiida_quantumespresso.tools import pwinputparser
    with open(path_in) as fhandle:
        input_txt = fhandle.read()

    pw_inp = pwinputparser.PwInputFile(input_txt)
    structure_data = pw_inp.get_structuredata()
    structure_data.export(path_out)

if __name__ == "__main__":
    convert_aiida_in('example.in', 'example.xsf')

For now I put it here for reference, then we should probably move it to the docs?

sphuber commented 4 years ago

Or make it a proper CLI command? for example aiida-quantumespresso data raw convert pw.in structure.xsf