Exemple #1
0
 def _approximate_unkown_bond_lengths(self):
     """Completes the bond length database with approximations based on VDW radii"""
     dataset = self.lengths[BOND_SINGLE]
     for n1 in periodic.iter_numbers():
         for n2 in periodic.iter_numbers():
             if n1 <= n2:
                 pair = frozenset([n1, n2])
                 atom1 = periodic[n1]
                 atom2 = periodic[n2]
                 #if (pair not in dataset) and hasattr(atom1, "covalent_radius") and hasattr(atom2, "covalent_radius"):
                 if (pair not in dataset) and (atom1.covalent_radius is not None) and (atom2.covalent_radius is not None):
                     dataset[pair] = (atom1.covalent_radius + atom2.covalent_radius)
Exemple #2
0
    dump_atom_fields, dump_overlap_matrices
from hipart.lebedev_laikov import get_grid as get_lebedev_grid
from hipart.log import log
from hipart.spline import CubicSpline

from molmod import Rotation, angstrom
from molmod.periodic import periodic

import os, numpy


__all__ = ["ParseError", "scheme_classes"]


noble_numbers = numpy.array([0,2,10,18,36,54,86,118])
core_sizes = dict((number, noble_numbers[noble_numbers<=number].max()) for number in periodic.iter_numbers())


class ParseError(Exception):
    pass


class OnlyOnce(object):
    def __init__(self, description):
        self.description = description

    def __call__(self, fn):
        def wrapper(instance):
            if fn.func_name in instance._done:
                return
            log.begin(self.description)