From da8a94e8063d691955560b371ef14efa8df93915 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 5 May 2024 21:05:24 -0800 Subject: [PATCH 1/7] Try like this? --- xdem/fit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdem/fit.py b/xdem/fit.py index a7ce993e..01b083ac 100644 --- a/xdem/fit.py +++ b/xdem/fit.py @@ -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") From 1cf71b1274c42431db7591381196f9319a4e74d3 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 5 May 2024 21:36:58 -0800 Subject: [PATCH 2/7] Check with more samples --- tests/test_coreg/test_biascorr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_coreg/test_biascorr.py b/tests/test_coreg/test_biascorr.py index 5139c329..b9cc3c9e 100644 --- a/tests/test_coreg/test_biascorr.py +++ b/tests/test_coreg/test_biascorr.py @@ -307,7 +307,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"] From bccd2b026670a6ff44af6703ad1344cc2e05b722 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 5 May 2024 22:19:19 -0800 Subject: [PATCH 3/7] Move back coveralls to v2.2 --- .github/workflows/python-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a0a064ac..71615931 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -116,7 +116,7 @@ jobs: run: coveragepy-lcov --data_file_path .coverage --output_file_path coverage.info - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2.2 with: github-token: ${{ secrets.github_token }} flag-name: run-${{ matrix.test_number }} @@ -128,7 +128,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload to Coveralls finished - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2.2 with: github-token: ${{ secrets.github_token }} parallel-finished: true From 739044ea7671fd6e991de385ec89e1635f4dad09 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Sun, 5 May 2024 22:29:33 -0800 Subject: [PATCH 4/7] Just v2? --- .github/workflows/python-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 71615931..593f841b 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -116,7 +116,7 @@ jobs: run: coveragepy-lcov --data_file_path .coverage --output_file_path coverage.info - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2.2 + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.github_token }} flag-name: run-${{ matrix.test_number }} @@ -128,7 +128,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload to Coveralls finished - uses: coverallsapp/github-action@v2.2 + uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.github_token }} parallel-finished: true From d683d2d4eec10386a34a08216958aef89a580e80 Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Mon, 6 May 2024 02:12:38 -0800 Subject: [PATCH 5/7] Force coverage version inferior than 7 --- .github/workflows/python-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 593f841b..f9f6c2a1 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -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: | From 02383d6887083d17d56233d0c21946bbdb14691a Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Mon, 6 May 2024 02:46:45 -0800 Subject: [PATCH 6/7] Go back to master --- .github/workflows/python-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index f9f6c2a1..012b281a 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -116,7 +116,7 @@ jobs: run: coveragepy-lcov --data_file_path .coverage --output_file_path coverage.info - name: Upload coverage to Coveralls - uses: coverallsapp/github-action@v2 + uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} flag-name: run-${{ matrix.test_number }} @@ -128,7 +128,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Upload to Coveralls finished - uses: coverallsapp/github-action@v2 + uses: coverallsapp/github-action@master with: github-token: ${{ secrets.github_token }} parallel-finished: true From 67c552c604fc5a5d57396120650e9a82a9425c1d Mon Sep 17 00:00:00 2001 From: Romain Hugonnet Date: Mon, 6 May 2024 16:43:24 -0800 Subject: [PATCH 7/7] Avoid optimizer didn't reach max error sometimes happening --- tests/test_coreg/test_biascorr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_coreg/test_biascorr.py b/tests/test_coreg/test_biascorr.py index b9cc3c9e..6baac537 100644 --- a/tests/test_coreg/test_biascorr.py +++ b/tests/test_coreg/test_biascorr.py @@ -560,10 +560,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"]