Stinx is a sibling repository of the DFT code Sphinx. It provides the python parser to generate the input files for the Sphinx code.
Stinx's input parser is created from the yaml-file located at src/input_data.yml
. The input file is generated by src/generator.py
. You can use the parser via:
from sphinx_parser.input import sphinx
This instance sphinx
is used to create all possible input classes for Sphinx by choosing the class via dot-notation and call create
. For example in order to generate the class kPoints
, you can run:
kPoints = sphinx.basis.kPoints.create()
You can find the input in the parent class, i.e.:
basis = sphinx.basis.create(kPoints=kPoints)
Finally, you can translate it into the Sphinx format via:
from sphinx_parser.toolkit import to_sphinx
sphinx_input = to_sphinx(basis)
You can then write it to a file via:
with open('sphinx.in', 'w') as f:
f.write(sphinx_input)