From 62679ecd4644ba42ab79648b6393e072a29391b2 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 26 Mar 2026 14:39:51 +0100 Subject: [PATCH 1/7] replaced double array operation, switch mgrid for broadcast_to --- src/vip_hci/preproc/derotation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vip_hci/preproc/derotation.py b/src/vip_hci/preproc/derotation.py index 83749f86..610c8ad6 100644 --- a/src/vip_hci/preproc/derotation.py +++ b/src/vip_hci/preproc/derotation.py @@ -219,7 +219,7 @@ def frame_rotate(array, angle, imlib='vip-fft', interpolation='lanczos4', array_prep = array.copy() # residual (non-interp) nans should be set to 0 to avoid bug in rotation - array_prep[np.where(np.isnan(array_prep))] = 0 + array_prep[np.isnan(array_prep)] = 0 y, x = array_prep.shape @@ -604,9 +604,8 @@ def rotate_fft(array, angle): ori_y, ori_x = array_in.shape cy, cx = frame_center(array) - arr_xy = np.mgrid[0:ori_y, 0:ori_x] - arr_y = arr_xy[0]-cy - arr_x = arr_xy[1]-cx + arr_y = np.broadcast_to((np.arange(ori_y) - cy)[:, np.newaxis], (ori_y, ori_x)) + arr_x = np.broadcast_to((np.arange(ori_x) - cx)[np.newaxis, :], (ori_y, ori_x)) # TODO: make FFT padding work for other option than '0'. s_x = _fft_shear(array_in, arr_x, a, ax=1, pad=0) From 83b95dc0da93b810e7085428e835dfb4f7891001 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 26 Mar 2026 14:46:57 +0100 Subject: [PATCH 2/7] fix for no reference cube case in _adimsdi_doublepca --- src/vip_hci/psfsub/pca_fullfr.py | 48 +++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/vip_hci/psfsub/pca_fullfr.py b/src/vip_hci/psfsub/pca_fullfr.py index 877520e4..10dda4ae 100644 --- a/src/vip_hci/psfsub/pca_fullfr.py +++ b/src/vip_hci/psfsub/pca_fullfr.py @@ -1428,22 +1428,38 @@ def _adimsdi_doublepca( for frame in range(n): ind = _find_indices_adi(angle_list, frame, pa_thr, truncate=truncate, max_frames=max_fr) - - res_result = _project_subtract( - res_cube_channels[:n], - res_cube_channels[n:], - ncomp_adi, - scaling[1], - mask_center_px, - svd_mode, - verbose, - False, - ind, - frame, - cube_sig=cube_sig, - left_eigv=left_eigv, - min_frames_pca=min_frames_pca, - ) + if 'A' in ref_strategy or cube_ref is None: + res_result = _project_subtract( + res_cube_channels[:n], + None, + ncomp_adi, + scaling[1], + mask_center_px, + svd_mode, + verbose, + False, + ind, + frame, + cube_sig=cube_sig, + left_eigv=left_eigv, + min_frames_pca=min_frames_pca, + ) + else: + res_result = _project_subtract( + res_cube_channels[:n], + res_cube_channels[n:], # ref cube + ncomp_adi, + scaling[1], + mask_center_px, + svd_mode, + verbose, + False, + ind, + frame, + cube_sig=cube_sig, + left_eigv=left_eigv, + min_frames_pca=min_frames_pca, + ) res_ifs_adi[frame] = res_result[-1].reshape((y_in, x_in)) if verbose: From d0914b99c355f44e64cba33a03ca1aeaf7f75bbd Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 26 Mar 2026 15:08:48 +0100 Subject: [PATCH 3/7] bumping test versions before they get removed --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/draft-pdf.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8892d946..63314428 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,9 +29,9 @@ jobs: group: [1, 2, 3] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -56,7 +56,7 @@ jobs: coverage run --source src -m pytest tests/pre_3_10 --splits 3 --group ${{ matrix.group }} coverage xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 objects_check: @@ -67,9 +67,9 @@ jobs: python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -93,4 +93,4 @@ jobs: coverage run --source=src/vip_hci/objects/ -m pytest tests/post_3_10 coverage xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index cce545f2..47ec13e3 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -6,7 +6,7 @@ jobs: name: Paper Draft steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build draft PDF uses: openjournals/openjournals-draft-action@master with: From bbc593e9c09d747addfdd4f102c337afe7de5074 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Thu, 26 Mar 2026 15:52:47 +0100 Subject: [PATCH 4/7] bumping actions to latest major version --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/draft-pdf.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63314428..20ba7ead 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,9 +29,9 @@ jobs: group: [1, 2, 3] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -56,7 +56,7 @@ jobs: coverage run --source src -m pytest tests/pre_3_10 --splits 3 --group ${{ matrix.group }} coverage xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 objects_check: @@ -67,9 +67,9 @@ jobs: python-version: ["3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -93,4 +93,4 @@ jobs: coverage run --source=src/vip_hci/objects/ -m pytest tests/post_3_10 coverage xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml index 47ec13e3..6f6d14ea 100644 --- a/.github/workflows/draft-pdf.yml +++ b/.github/workflows/draft-pdf.yml @@ -6,7 +6,7 @@ jobs: name: Paper Draft steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Build draft PDF uses: openjournals/openjournals-draft-action@master with: @@ -14,7 +14,7 @@ jobs: # This should be the path to the paper within your repo. paper-path: paper.md - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: paper # This is the output path where Pandoc will write the compiled From 7f22dcb20c179d897eff026b04933f24c59c2e1b Mon Sep 17 00:00:00 2001 From: IainHammond Date: Fri, 27 Mar 2026 13:57:07 +0100 Subject: [PATCH 5/7] updating pre-commit hooks to v6 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91a09a0e..3ba88f61 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer From 7e74a5c367db3745ce2219de369e70ffc7c2ead5 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Fri, 27 Mar 2026 14:03:01 +0100 Subject: [PATCH 6/7] pre-commit runs once, drop unused code, cache pip --- .github/workflows/ci.yml | 45 +++++++++++++++------------------------- 1 file changed, 17 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20ba7ead..40e1309e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This workflow will install Python depe:ndencies, run tests and lint with a variety of Python versions +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: ci @@ -15,8 +15,20 @@ env: COVERAGE_CORE: sysmon jobs: - no_object_checks: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + - name: Run pre-commit + run: | + pip install pre-commit + pre-commit run --all-files + no_object_checks: + needs: pre-commit runs-on: ubuntu-latest strategy: fail-fast: false @@ -34,23 +46,11 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | python -m pip install --upgrade pip pip install --editable . --group dev - # Uncomment below when ready to deal with a lot of PEP8 formatting changes - - name: Verify files with pre-commit - run: | - # Setup pre-commit hooks - pre-commit clean - pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks - pre-commit install --hook-type pre-merge-commit - pre-commit install --hook-type pre-push - pre-commit install --hook-type post-rewrite - pre-commit install-hooks - pre-commit install - # Run pre-commit hooks - pre-commit run --files src/**/*.py - name: Test with pytest run: | coverage run --source src -m pytest tests/pre_3_10 --splits 3 --group ${{ matrix.group }} @@ -59,7 +59,7 @@ jobs: uses: codecov/codecov-action@v6 objects_check: - + needs: pre-commit runs-on: ubuntu-latest strategy: fail-fast: false @@ -72,22 +72,11 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} + cache: pip - name: Install dependencies run: | python -m pip install --upgrade pip pip install --editable . --group dev - - name: Verify files with pre-commit - run: | - # Setup pre-commit hooks - pre-commit clean - pre-commit autoupdate --repo https://github.com/pre-commit/pre-commit-hooks - pre-commit install --hook-type pre-merge-commit - pre-commit install --hook-type pre-push - pre-commit install --hook-type post-rewrite - pre-commit install-hooks - pre-commit install - # Run pre-commit hooks - pre-commit run --files src/vip_hci/objects/*.py - name: Test with pytest run: | coverage run --source=src/vip_hci/objects/ -m pytest tests/post_3_10 From f28620bcb30731fc5ca915f35a4dcc18eb343bf6 Mon Sep 17 00:00:00 2001 From: IainHammond Date: Fri, 27 Mar 2026 14:18:04 +0100 Subject: [PATCH 7/7] pre-commit runs once, drop unused code, cache pip --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40e1309e..ed31d85f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: - name: Run pre-commit run: | pip install pre-commit - pre-commit run --all-files + pre-commit run --files src/**/*.py no_object_checks: needs: pre-commit