Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into bias_nd_attr
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed May 7, 2024
2 parents 9b88964 + 6caeb19 commit 6f5ca2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Setup pip dependencies
run: pip install pytest-cov coveralls coveragepy-lcov
run: pip install pytest-cov coveralls coveragepy-lcov 'coverage<7'

- name: Print conda environment (for debugging)
run: |
Expand Down
6 changes: 3 additions & 3 deletions tests/test_coreg/test_biascorr.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def test_biascorr__bin_and_fit_1d(self, fit_args, fit_func, fit_optimizer, bin_s
elev_fit_args.update({"niter": 1})

# Run with input parameter, and using only 100 subsamples for speed
bcorr.fit(**elev_fit_args, subsample=100, random_state=42)
bcorr.fit(**elev_fit_args, subsample=1000, random_state=42)

# Check that variable names are defined during fit
assert bcorr._meta["bias_var_names"] == ["elevation"]
Expand Down Expand Up @@ -521,10 +521,10 @@ def test_deramp__synthetic(self, fit_args, order: int) -> None:
deramp = biascorr.Deramp(poly_order=order)
elev_fit_args = fit_args.copy()
if isinstance(elev_fit_args["to_be_aligned_elev"], gpd.GeoDataFrame):
bias_elev = bias_dem.to_pointcloud(data_column_name="z", subsample=30000).ds
bias_elev = bias_dem.to_pointcloud(data_column_name="z", subsample=50000).ds
else:
bias_elev = bias_dem
deramp.fit(elev_fit_args["reference_elev"], to_be_aligned_elev=bias_elev, subsample=20000, random_state=42)
deramp.fit(elev_fit_args["reference_elev"], to_be_aligned_elev=bias_elev, subsample=40000, random_state=42)

# Check high-order fit parameters are the same within 10%
fit_params = deramp._meta["fit_params"]
Expand Down
2 changes: 1 addition & 1 deletion xdem/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def wrapper_cost_sumofsin(p: NDArrayf, x: NDArrayf, y: NDArrayf) -> float:
# Insert in a scipy bounds object
scipy_bounds = scipy.optimize.Bounds(lb, ub)
# First guess for the mean parameters
p0 = np.divide(lb + ub, 2).squeeze()
p0 = ((lb + ub) / 2).squeeze()

if verbose:
print("Bounds")
Expand Down

0 comments on commit 6f5ca2b

Please sign in to comment.