Skip to content

Commit f7dd0d3

Browse files
authored
Merge pull request #135 from MiraGeoscience/GEOPY-2594
GEOPY-2594
2 parents 8a9cf45 + a404aa5 commit f7dd0d3

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=64", "setuptools_scm>=8"]
2+
requires = ["setuptools>=64", "setuptools_scm>=9.2.0,<10.0"]
33
build-backend = "setuptools.build_meta"
44

55

simpeg/utils/pgi_utils.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,13 +331,15 @@ def _initialize_parameters(self, X, random_state, xp=None):
331331

332332
if self.init_params == "kmeans":
333333
resp = np.zeros((n_samples, self.n_components))
334-
label = (
335-
KMeans(
336-
n_clusters=self.n_components, n_init=1, random_state=random_state
334+
with warnings.catch_warnings():
335+
warnings.simplefilter("ignore")
336+
label = (
337+
KMeans(
338+
n_clusters=self.n_components, n_init=1, random_state=random_state
339+
)
340+
.fit(X, sample_weight=self.cell_volumes)
341+
.labels_
337342
)
338-
.fit(X, sample_weight=self.cell_volumes)
339-
.labels_
340-
)
341343
resp[np.arange(n_samples), label] = 1
342344
elif self.init_params == "random":
343345
resp = random_state.rand(n_samples, self.n_components)

0 commit comments

Comments
 (0)