Skip to content

Commit

Permalink
return opencv-python to a hard dependency (#7499)
Browse files Browse the repository at this point in the history
* return opencv-python to a hard dependency

* add change log entry

* remove unused import
  • Loading branch information
zacharyburnett authored Mar 15, 2023
1 parent 08b318e commit 0f528ca
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,6 @@ jobs:
- toxenv: test-oldestdeps-xdist-cov
os: ubuntu-latest
python-version: '3.8'
- toxenv: test-opencv-xdist
os: ubuntu-latest
python-version: '3.10'
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ other
- Fix memory leaks in packages that use C code: ``cube_build``,
``wfss_contam``, and ``straylight``. [#7493]

- add `opencv-python` to hard dependencies for usage of snowball detection in the jump step in `stcal` [#7499]

outlier_detection
-----------------

Expand Down
9 changes: 0 additions & 9 deletions jwst/jump/tests/test_jump_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@

from jwst.jump import JumpStep

try:
import cv2 as cv # noqa: F401

OPENCV_INSTALLED = True
except ImportError:
OPENCV_INSTALLED = False

MAXIMUM_CORES = ['none', 'quarter', 'half', 'all']


Expand Down Expand Up @@ -311,7 +304,6 @@ def test_three_group_integration(generate_miri_reffiles, setup_inputs):
assert out_model.meta.cal_step.jump == 'COMPLETE'


@pytest.mark.xfail(not OPENCV_INSTALLED, reason="`opencv-python` not installed")
def test_snowball_flagging_nosat(generate_nircam_reffiles, setup_inputs):
"""Test that snowballs are properly flagged when the `sat_required_snowball`,
which requires there to be a saturated pixel within the cluster of
Expand Down Expand Up @@ -356,7 +348,6 @@ def test_snowball_flagging_nosat(generate_nircam_reffiles, setup_inputs):
assert (np.floor(expanded_area / initial_area) == (expand_factor**2))


@pytest.mark.xfail(not OPENCV_INSTALLED, reason="`opencv-python` not installed")
def test_snowball_flagging_sat(generate_nircam_reffiles, setup_inputs):
"""Test that snowballs are properly flagged when the `sat_required_snowball`,
which requires there to be a saturated pixel within the cluster of
Expand Down
2 changes: 1 addition & 1 deletion requirements-sdp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
#
# conda create -n sdp python -y
# conda activate sdp
# pip install -e .[test,sdp] "opencv-python>=4.6.0.66"
# pip install -e .[test,sdp]
# pip freeze | grep -v jwst >> requirements-sdp.txt
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ install_requires =
drizzle>=1.13.7
gwcs>=0.18.3
numpy>=1.20
opencv-python>=4.6.0.66
photutils>=1.4.0
psutil>=5.7.2
poppy>=1.0.2
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ commands =
[testenv]
description =
run tests
opencv: requiring opencv-python
devdeps: with the latest developer version of key dependencies
oldestdeps: with the oldest supported version of key dependencies
sdpdeps: with the recent STScI DMS release pinned dependencies
Expand All @@ -68,7 +67,6 @@ deps =
xdist: pytest-xdist
devdeps: -rrequirements-dev.txt
sdpdeps: -rrequirements-sdp.txt
opencv: opencv-python
oldestdeps: minimum_dependencies
package =
!pyargs: editable
Expand All @@ -87,7 +85,6 @@ commands =
regtests: --bigdata --slow --basetemp={homedir}/test_outputs \
xdist: -n auto \
pyargs: {toxinidir}/docs --pyargs jwst \
opencv: -- jwst/jump/tests/test_jump_step.py \
{posargs}

[testenv:build-docs]
Expand Down

0 comments on commit 0f528ca

Please sign in to comment.