def _check_params()

in graspologic/nominate/spectralVN.py [0:0]


    def _check_params(self) -> None:

        if self.n_neighbors is not None and type(self.n_neighbors) is not int:
            raise TypeError("k must be an integer")
        elif self.n_neighbors is not None and self.n_neighbors <= 0:
            raise ValueError("k must be greater than 0")
        if type(self.metric) is not str:
            raise TypeError("metric must be a string")
        if self.metric_params is not None and type(self.metric_params) is not dict:
            raise TypeError("metric_params must be a dictionary")
        if type(self.input_graph) is not bool:
            raise TypeError("input_graph_ must be of type bool.")
        if self.input_graph:
            if not isinstance(self.embedder, BaseSpectralEmbed) and not isinstance(
                self.embedder, str
            ):
                raise TypeError(
                    "embedder must be either of type str or BaseSpectralEmbed"
                )