From 920968cc55b18a14a26253e553af556ee0d8e31f Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Mon, 3 Oct 2022 14:16:10 -0400 Subject: [PATCH] add `webbpsf` and `poppy` to base environment --- .gitattributes | 1 + .github/workflows/build.yml | 23 ++++++++++++++++++++++- stenv-dev.yml | 2 ++ stenv-latest.yml | 2 ++ stenv-stable.yml | 2 ++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index c2075f1..299745b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ *.fits filter=lfs diff=lfs merge=lfs -text *.asdf filter=lfs diff=lfs merge=lfs -text +tests/data/* filter=lfs diff=lfs merge=lfs -text diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4856c71..efdd881 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,9 @@ defaults: run: shell: bash -l {0} +env: + DATA_DIRECTORY: /home/runner/work/stenv/stenv/tests/data + jobs: build: name: build ${{ github.event.inputs.constraint }} Python ${{ matrix.python }} environment on ${{ matrix.os }} @@ -69,7 +72,7 @@ jobs: strategy: fail-fast: false matrix: - package: [ acstools, asdf, ccdproc, costools, jwst, reftools, synphot, wfpc2tools ] + package: [ acstools, asdf, ccdproc, costools, jwst, poppy, reftools, synphot, wfpc2tools, webbpsf ] os: [ ubuntu-latest, macos-latest ] python: [ '3.8', '3.9', '3.10' ] include: @@ -85,6 +88,8 @@ jobs: env: CRDS_SERVER_URL: https://jwst-crds.stsci.edu pytest_args: '--slow' + - package: poppy + extras: [ test ] #- package: pysynphot # extras: [ test ] - package: reftools @@ -92,9 +97,18 @@ jobs: - package: synphot extras: [ test ] - package: wfpc2tools + - package: webbpsf + extras: [ test ] + commands: [ + 'curl -L https://stsci.box.com/shared/static/ntb71b3uusf1kzgf9bss0hzbreoja5gg.gz -o webbpsf-data.gz', + 'tar -xvzf webbpsf-data.gz -C $DATA_DIRECTORY', + ] + data: true steps: - run: echo "CONSTRAINT=$(if [ -z ${{ github.event.inputs.constraint }} ]; then echo latest; else echo ${{ github.event.inputs.constraint }}; fi)" >> $GITHUB_ENV - uses: actions/checkout@v3 + with: + lfs: true - run: echo "HOME=$(echo /home/runner)" >> $GITHUB_ENV if: runner.os == 'Linux' - run: echo "HOME=$(echo /Users/runner)" >> $GITHUB_ENV @@ -133,11 +147,17 @@ jobs: env: CRDS_SERVER_URL: ${{ matrix.env.CRDS_SERVER_URL }} CRDS_PATH: ${{ env.CRDS_PATH }} + - uses: actions/cache@v3 + if: matrix.data != '' + with: + path: 'tests/data/' + key: data-${{ hashFiles('tests/data/*') }} - run: pytest -n auto ${{ matrix.pytest_args }} --pyargs ${{ matrix.package }} env: CRDS_SERVER_URL: ${{ matrix.env.CRDS_SERVER_URL }} CRDS_PATH: ${{ env.CRDS_PATH }} PYSYN_CDBS: ${{ env.PYSYN_CDBS }} + WEBBPSF_PATH: ${{ env.DATA_DIRECTORY }}/webbpsf-data unit_tests_from_source: name: run `${{ matrix.package }}` unit tests from source in ${{ github.event.inputs.constraint }} Python ${{ matrix.python }} environment on ${{ matrix.os }} needs: [ build ] @@ -227,6 +247,7 @@ jobs: CRDS_SERVER_URL: ${{ matrix.env.CRDS_SERVER_URL }} CRDS_PATH: ${{ env.CRDS_PATH }} PYSYN_CDBS: ${{ env.PYSYN_CDBS }} + WEBBPSF_PATH: ${{ matrix.env.WEBBPSF_PATH }} smoke_tests: name: run `${{ matrix.package }}` smoke tests in ${{ github.event.inputs.constraint }} Python ${{ matrix.python }} environment on ${{ matrix.os }} needs: [ build ] diff --git a/stenv-dev.yml b/stenv-dev.yml index bcf52f2..97a5011 100644 --- a/stenv-dev.yml +++ b/stenv-dev.yml @@ -25,6 +25,7 @@ dependencies: - jupyter - git+https://github.com/spacetelescope/jwst.git - git+https://github.com/spacetelescope/nictools.git + - git+https://github.com/spacetelescope/poppy.git - git+https://github.com/spacetelescope/pysynphot.git - reftools - sphinx @@ -33,3 +34,4 @@ dependencies: - git+https://github.com/spacetelescope/synphot_refactor.git - git+https://github.com/spacetelescope/wfc3tools.git - git+https://github.com/spacetelescope/wfpc2tools.git + - git+https://github.com/spacetelescope/webbpsf.git diff --git a/stenv-latest.yml b/stenv-latest.yml index 6cd5742..64555f3 100644 --- a/stenv-latest.yml +++ b/stenv-latest.yml @@ -25,6 +25,7 @@ dependencies: - jupyter - jwst>=1.6.2 - nictools + - poppy - pysynphot - reftools - sphinx @@ -33,3 +34,4 @@ dependencies: - synphot - wfc3tools - wfpc2tools + - webbpsf diff --git a/stenv-stable.yml b/stenv-stable.yml index c5f258e..086895a 100644 --- a/stenv-stable.yml +++ b/stenv-stable.yml @@ -25,6 +25,7 @@ dependencies: - jupyter - jwst>=1.8,<1.9 - nictools>=1.1,<1.2 + - poppy>=1.0.3,<1.1 - pysynphot>=2.0,<2.1 - reftools>=2.1,<2.2 - sphinx @@ -33,3 +34,4 @@ dependencies: - synphot>=1.1,<1.2 - wfc3tools>=1.4,<1.5 - wfpc2tools>=1.0,<1.1 + - webbpsf>=1.1.0,<1.2