Skip to content

Commit

Permalink
Fixed divide by zero error
Browse files Browse the repository at this point in the history
  • Loading branch information
mdkaratas committed Aug 18, 2022
1 parent e960821 commit 4066a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pflacco/misc_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def calculate_length_scales_features(
result = np.array(result)
r_dist = pdist(result[:, :dim])
r_fval = pdist(result[:, dim].reshape(len(result), 1), metric = 'cityblock')
r = r_fval/r_dist
r = np.divide(r_fval, r_dist, where=r_dist != 0)
r = r[~np.isnan(r)]
kernel = gaussian_kde(r)
sample = np.random.uniform(low=r.min(), high=r.max(), size = sample_size_from_kde)
Expand Down

0 comments on commit 4066a16

Please sign in to comment.