graphinvent/MolecularGraph.py
def reorder_nodes(self) -> None:
        """
        Remaps the numerical ordering of nodes in the graph as specified by the
        `self.node_ordering`. Modifies the `PreprocessingGraph` in place.
        """
        # first remap the node features matrix
        node_features_remapped = np.array(
            [self.node_features[node] for node in self.node_ordering],
            dtype=np.int32
        )

        # then remap the edge features tensor
        edge_features_rows_done = np.array(
            [self.edge_features[node, :, :] for node in self.node_ordering],
            dtype=np.int32
        )
        edge_features_remapped = np.array(
            [edge_features_rows_done[:, node, :] for node in self.node_ordering],
            dtype=np.int32
        )

        self.node_features = node_features_remapped
        self.edge_features = edge_features_remapped

        Remaps the numerical ordering of nodes in the graph as specified by the
        `self.node_ordering`. Modifies the `PreprocessingGraph` in place.
        
Remaps the numerical ordering of nodes in the graph as specified by the
`self.node_ordering`. Modifies the `PreprocessingGraph` in place.
Remaps the numerical ordering of nodes in the graph as specified by the ` self . node_ordering ` . Modifies the ` PreprocessingGraph ` in place .
def reorder_nodes(self) -> None:
        node_features_remapped = np.array(
            [self.node_features[node] for node in self.node_ordering],
            dtype=np.int32
        )
        edge_features_rows_done = np.array(
            [self.edge_features[node, :, :] for node in self.node_ordering],
            dtype=np.int32
        )
        edge_features_remapped = np.array(
            [edge_features_rows_done[:, node, :] for node in self.node_ordering],
            dtype=np.int32
        )
        self.node_features = node_features_remapped
        self.edge_features = edge_features_remapped
def reorder_nodes ( self ) -> None : node_features_remapped = np . array ( [ self . node_features [ node ] for node in self . node_ordering ] , dtype = np . int32 ) edge_features_rows_done = np . array ( [ self . edge_features [ node , : , : ] for node in self . node_ordering ] , dtype = np . int32 ) edge_features_remapped = np . array ( [ edge_features_rows_done [ : , node , : ] for node in self . node_ordering ] , dtype = np . int32 ) self . node_features = node_features_remapped self . edge_features = edge_features_remapped
Remaps the numerical ordering of nodes in the graph as specified by the
`self.node_ordering`.
Remaps the numerical ordering of nodes in the graph as specified by the ` self . node_ordering ` .
"""
        Remaps the numerical ordering of nodes in the graph as specified by the
        `self.node_ordering`. Modifies the `PreprocessingGraph` in place.
        """ # first remap the node features matrix # then remap the edge features tensor
self