Exemplo n.º 1
0
    def from_dict(d, t=None):
        """Convert the dictionary to a beam model

        Params:
            d The dictionary of parameters
            t The template dictionary to use

        Returns:
            The beam model
        """
        if d is None and t is None:
            return None
        joint = t.copy() if t else {}
        joint.update(d)

        # Create the model from the joint dictionary
        return Beam.from_dict(joint)
Exemplo n.º 2
0
    def from_dict(d, t=None):
        ''' Convert the dictionary to a beam model

    Params:
        d The dictionary of parameters
        t The template dictionary to use

    Returns:
        The beam model

    '''
        from dxtbx.model import Beam

        # If None, return None
        if d == None:
            if t == None: return None
            else: return from_dict(t, None)
        elif t != None:
            d = dict(t.items() + d.items())

        # Create the model from the dictionary
        return Beam.from_dict(d)