Skip to content

Commit

Permalink
remove statement that is incompatible with python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mamei16 committed Oct 29, 2023
1 parent f21d8f4 commit 4fc7b42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pypsf/psf.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ def fit(self, data: ArrayLike, k_values=tuple(range(2, 12)), w_values=tuple(rang
raise ValueError(f"Length of training data {'after differencing ' if self.apply_diff else ''}"
"must at least be equal to cycle length")
self.norm_data = self.preprocessing(data)
if (num_cycles := len(self.norm_data)) <= 2 and not self.suppress_warnings:
num_cycles = len(self.norm_data)
if num_cycles <= 2 and not self.suppress_warnings:
psf_warn(f"\nOnly {num_cycles} cycles remaining after preprocessing."
f" Only a single cluster will be formed.")
f" Only a single cluster will be formed.")
# Find optimal number (K) of clusters (or use the value specified by the user).
if self.k is None:
self.k = optimum_k(self.norm_data, k_values)
Expand Down

0 comments on commit 4fc7b42

Please sign in to comment.