Exemplo n.º 1
0
            mad = 627.510 * sum(map(abs, l_energy)) / len(l_energy)
        except ZeroDivisionError:
            pass
        else:
            d_mad[run_id] = mad

    return d_mad

#  _
# /   _  ._      _  ._ _|_
# \_ (_) | | \/ (/_ |   |_
#

# Unit_dict
unit_dict = defaultdict()
for name, value in config.items("Unit_dict"):
    unit_dict[name] = value

DEFAULT_CHARACTER = ""


def convert(str_, dict_, opt=0):
    """
    Convert a string using unit_dict
    """
    if opt == 0:
        for ele in dict_:
            if unit_dict[str_] == "Hartree":
                pass
            elif unit_dict[str_] == "kcal/mol":
                dict_[ele] *= 627.510
Exemplo n.º 2
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#  _
# /   _  | |  _   _ _|_ o  _  ._
# \_ (_) | | (/_ (_  |_ | (_) | |
#
from collections import defaultdict

from src.Requirement_util import config

import sys

# Format dict
format_dict = defaultdict()
for name, value in config.items("Format_dict"):
    format_dict[name] = config.get("Format_mesure", value)


DEFAULT_CHARACTER = ""

from src.terminaltables import AsciiTable


#  _
# |_ _  ._ ._ _   _. _|_
# | (_) |  | | | (_|  |_
#
def format_table(header_name, table_body):
    """
    Take and retable table_body.