Exemplo n.º 1
0
def registry():
    """
    This function pass to the noodles infrascture all the information
    related to the Structure of the Package object that is schedule.
    This *Registry* class contains hints that help Noodles to encode
    and decode this Package object.
    """
    return Registry(parent=serial.base() + arrays_to_hdf5())
Exemplo n.º 2
0
def registry():
    return Registry(
        parent=base() + numpy_registry(),
        types={
            DataFrame: SerStandardObject(
                DataFrame, ['data', 'units', 'comments']),
            DCS: SerStandardObject(
                DCS, ['energy', 'angle', 'cs'])
        },
        hooks={
            '<quantity>': SerQuantity('<quantity>'),
            '<unit>': SerUnit('<unit>')
        },
        hook_fn=quantity_hook)
Exemplo n.º 3
0
def registry():
    """
    This function pass to the noodles infrascture all the information
    related to the Structure of the Package object that is schedule.
    This *Registry* class contains hints that help Noodles to encode
    and decode this Package object.
    """
    return Registry(parent=serial.base() + arrays_to_hdf5(),
                    types={
                        Package: AsDict(Package),
                        Path: SerPath(),
                        plams.Molecule: SerMolecule(),
                        Chem.Mol: SerMol(),
                        Result: SerStorable(Result),
                        Settings: SerSettings()
                    })
Exemplo n.º 4
0
def registry1():
    return Registry(parent=serial.base(), types={A: SerNamedTuple(A)})
Exemplo n.º 5
0
#: A :class:`Registry` instance to-be returned by :func:`registry`.
REGISTRY: Registry = Registry(parent=serial.base() + arrays_to_hdf5(),
                              types={
                                  Package:
                                  SerReduce(Package),
                                  Path:
                                  SerPath(),
                                  plams.Molecule:
                                  SerMolecule(),
                                  Chem.Mol:
                                  SerMol(),
                                  Result:
                                  AsDict(Result),
                                  Settings:
                                  SerSettings(),
                                  plams.KFFile:
                                  SerReasonableObject(plams.KFFile),
                                  plams.KFReader:
                                  SerReasonableObject(plams.KFReader),
                                  np.floating:
                                  SerNumpyScalar(),
                                  np.integer:
                                  SerNumpyScalar(),
                                  pd.DataFrame:
                                  SerNDFrame(pd.DataFrame),
                                  pd.Series:
                                  SerNDFrame(pd.Series),
                              })

def registry():
    reg = Registry(parent=serial.base())
    reg[A] = AsDict(A)
    return reg