Skip to content

Commit

Permalink
remove test_fit_empty, probably shouldn't be one interface behaviour …
Browse files Browse the repository at this point in the history
…in this instance.
  • Loading branch information
Martin ROYER committed Jul 1, 2024
1 parent 7338eaf commit 9a94b4e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion src/python/gudhi/representations/vector_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def fit(self, X, y=None, sample_weight=None):
filtered_weights_concat = weights_concat[~np.isinf(measures_concat).any(axis=1)] if len(measures_concat) else weights_concat
n_points = len(filtered_measures_concat)
if not n_points:
raise Exception("Cannot fit Atol on empty target.")
raise Exception("Cannot fit Atol on measure with infinite components only.")

if n_points < n_clusters:
# If not enough points to fit (including 0), we will arbitrarily put centers as [-np.inf]^measure_dim at the end.
Expand Down
7 changes: 0 additions & 7 deletions src/python/test/test_representations_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ def test_fit():
clone(vectorizer).fit(X=[diag1[0], diag2[0]])


def test_fit_empty():
print(f" > Testing `fit_empty`.")
for name, vectorizer in vectorizers.items():
print(f" >> Testing {name}")
clone(vectorizer).fit(X=[diag3[0], diag3[0]])


def test_transform():
print(f" > Testing `transform`.")
for name, vectorizer in vectorizers.items():
Expand Down

0 comments on commit 9a94b4e

Please sign in to comment.