Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed May 31, 2023
1 parent 38f40f9 commit 982dfdb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xdem/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
from typing import Any, Callable

import numpy as np
import pandas as pd
import scipy
from geoutils.raster import subsample_array
from numpy.polynomial.polynomial import polyval, polyval2d

from xdem._typing import NDArrayf
from xdem.spatialstats import nd_binning

try:
from sklearn.linear_model import (
Expand Down Expand Up @@ -586,8 +584,10 @@ def wrapper_cost_sumofsin(p: NDArrayf, x: NDArrayf, y: NDArrayf) -> float:
for i in range(final_index + 1):
# If an amplitude has an estimated value of less than 0.1% the signal bounds (percentiles for robustness)
# And if the degree is higher than 2 (need at least degree 1 return)
if np.abs(final_coefs[3 * i]) < (np.nanpercentile(ydata, 90) - np.nanpercentile(ydata, 10)) / 1000 \
and len(final_coefs) > 3:
if (
np.abs(final_coefs[3 * i]) < (np.nanpercentile(ydata, 90) - np.nanpercentile(ydata, 10)) / 1000
and len(final_coefs) > 3
):
final_coefs = np.delete(final_coefs, slice(3 * i, 3 * i + 3))
final_degree -= 1
break
Expand Down

0 comments on commit 982dfdb

Please sign in to comment.