Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 23 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 --files src/**/*.py

no_object_checks:
needs: pre-commit
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -29,68 +41,45 @@ jobs:
group: [1, 2, 3]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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 }}
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v6

objects_check:

needs: pre-commit
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
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
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v6
4 changes: 2 additions & 2 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ jobs:
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v6
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# 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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/vip_hci/preproc/derotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
48 changes: 32 additions & 16 deletions src/vip_hci/psfsub/pca_fullfr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down