Beispiel #1
0
 def test_compound_eneg_brass(self):
     self.assertAlmostEqual(compound_electroneg(
         elements=["Cu", "Zn"], stoichs=[0.5, 0.5],
         source='Pauling'),
         5.0638963259)
Beispiel #2
0

import argparse
from smact.properties import compound_electroneg

if __name__ == "__main__":

    parser = argparse.ArgumentParser(
        description="""Compound electronegativity from geometric mean of
                       elemental Mulliken electronegativities.""")
    parser.add_argument("-e", "--elements", type=str,
                        help="""Space-separated string of elements
                                (e.g. \"Cu Zn Sn S\")"""
                        )
    parser.add_argument("-s", "--stoichiometry", type=str,
                        help="""Space-separated string of stoichiometry
                                (e.g. \"2 1 1 4\")""" % ()
                        )
    parser.add_argument("-v", "--verbose", help="More verbose output",
                        action="store_true")
    parser.add_argument("-q", "--quiet", help="Quiet output",
                        action="store_true")
    args = parser.parse_args()
    if args.quiet:
        verbose_flag = False
    else:
        verbose_flag = True

    print compound_electroneg(verbose=verbose_flag, elements=args.elements,
                              stoichs=args.stoichiometry)
Beispiel #3
0
 def test_compound_eneg_brass(self):
     self.assertAlmostEqual(
         compound_electroneg(elements=["Cu", "Zn"],
                             stoichs=[0.5, 0.5],
                             source='Pauling'), 5.0638963259)
    parser = argparse.ArgumentParser(
        description="""Compound electronegativity from geometric mean of
                       elemental Mulliken electronegativities.""")
    parser.add_argument("-e",
                        "--elements",
                        type=str,
                        help="""Space-separated string of elements
                                (e.g. \"Cu Zn Sn S\")""")
    parser.add_argument("-s",
                        "--stoichiometry",
                        type=str,
                        help="""Space-separated string of stoichiometry
                                (e.g. \"2 1 1 4\")""" % ())
    parser.add_argument("-v",
                        "--verbose",
                        help="More verbose output",
                        action="store_true")
    parser.add_argument("-q",
                        "--quiet",
                        help="Quiet output",
                        action="store_true")
    args = parser.parse_args()
    if args.quiet:
        verbose_flag = False
    else:
        verbose_flag = True

    print compound_electroneg(verbose=verbose_flag,
                              elements=args.elements,
                              stoichs=args.stoichiometry)