utils

graph

class openchem.utils.graph.Attribute(attr_type, name, one_hot=True, values=None)[source]

Bases: object

class openchem.utils.graph.Edge(rdbond, get_bond_attributes=None)[source]

Bases: object

class openchem.utils.graph.Graph(mol, max_size, get_atom_attributes, get_bond_attributes=None, kekulize=True, addHs=False, has_3D=False, from_rdmol=False)[source]

Bases: object

Describes an undirected graph class

get_edge_attr_adj_matrix(all_atr_dict, max_size)[source]
get_node_attr_adj_matrix(attr)[source]
get_node_feature_matrix(all_atr_dict, max_size)[source]
xyz_to_zmat()[source]
zmat_to_xyz()[source]
class openchem.utils.graph.Node(idx, rdmol, get_atom_attributes, has_3D=False)[source]

Bases: object

utils

openchem.utils.utils.calculate_metrics(predicted, ground_truth, metrics)[source]
openchem.utils.utils.check_params(config, required_dict, optional_dict)[source]
openchem.utils.utils.cross_validation_split(data, targets, n_folds=5, split='random', stratified=True, folds=None)[source]
openchem.utils.utils.deco_print(line, offset=0, start='*** ', end='\n')[source]
openchem.utils.utils.flatten_dict(dct)[source]
openchem.utils.utils.get_latest_checkpoint(path)[source]
openchem.utils.utils.identity(input)[source]
openchem.utils.utils.make_positions(tensor, padding_idx, left_pad)[source]

Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols are ignored, but it is necessary to specify whether padding is added on the left side (left_pad=True) or right side (left_pad=False).

openchem.utils.utils.move_to_cuda(sample)[source]
openchem.utils.utils.nest_dict(flat_dict)[source]
openchem.utils.utils.nested_update(org_dict, upd_dict)[source]
openchem.utils.utils.time_since(since)[source]

logger