diff --git a/pyproject.toml b/pyproject.toml index e5c95e0d3b..9266a4083a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=64", "setuptools_scm>=8"] +requires = ["setuptools>=64", "setuptools_scm>=9.2.0,<10.0"] build-backend = "setuptools.build_meta" diff --git a/simpeg/utils/pgi_utils.py b/simpeg/utils/pgi_utils.py index 7478c2a4a7..ed9df76a12 100644 --- a/simpeg/utils/pgi_utils.py +++ b/simpeg/utils/pgi_utils.py @@ -331,13 +331,15 @@ def _initialize_parameters(self, X, random_state, xp=None): if self.init_params == "kmeans": resp = np.zeros((n_samples, self.n_components)) - label = ( - KMeans( - n_clusters=self.n_components, n_init=1, random_state=random_state + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + label = ( + KMeans( + n_clusters=self.n_components, n_init=1, random_state=random_state + ) + .fit(X, sample_weight=self.cell_volumes) + .labels_ ) - .fit(X, sample_weight=self.cell_volumes) - .labels_ - ) resp[np.arange(n_samples), label] = 1 elif self.init_params == "random": resp = random_state.rand(n_samples, self.n_components)