From 8f0d9ab7335a674645149b646aface1a7bc51eb9 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Mon, 3 Oct 2022 14:16:10 -0400 Subject: [PATCH 1/2] add `webbpsf` and `poppy` to base environment --- .gitattributes | 1 + .github/workflows/build.yaml | 19 ++++++++++++++++++- environment.yaml | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index c2075f18..299745bf 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.yaml b/.github/workflows/build.yaml index adb79e0b..7e620293 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,7 @@ defaults: shell: bash -l {0} env: + DATA_DIRECTORY: /home/runner/work/stenv/stenv/tests/data CRDS_PATH: /tmp/crds_cache PYSYN_CDBS: /tmp/trds @@ -59,7 +60,7 @@ jobs: strategy: fail-fast: false matrix: - package: [ acstools, asdf, ccdproc, costools, reftools, synphot, wfpc2tools ] + package: [ acstools, asdf, ccdproc, costools, poppy, reftools, synphot, wfpc2tools, webbpsf ] runs-on: [ ubuntu-latest, macos-latest ] python-version: [ '3.9', '3.10', '3.11' ] include: @@ -70,6 +71,8 @@ jobs: - package: ccdproc extras: [ test ] - package: costools + - package: poppy + extras: [ test ] #- package: pysynphot # extras: [ test ] - package: reftools @@ -77,6 +80,13 @@ 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 exclude: - runs-on: macos-latest python-version: 3.9 @@ -106,9 +116,15 @@ jobs: with: path: ${{ env.CRDS_PATH }} key: crds-${{ matrix.package }}-${{ steps.crds-context.outputs.context }} + - if: matrix.data != '' + uses: actions/cache@v3 + 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 }} + WEBBPSF_PATH: ${{ env.DATA_DIRECTORY }}/webbpsf-data unit_tests_from_source: name: ${{ matrix.package }} (${{ matrix.runs-on }}, Python ${{ matrix.python-version }}) needs: [ build ] @@ -194,6 +210,7 @@ jobs: - run: pytest -n auto ${{ matrix.pytest_args }} ${{ matrix.test_directory }} env: CRDS_SERVER_URL: ${{ matrix.env.CRDS_SERVER_URL }} + WEBBPSF_PATH: ${{ env.DATA_DIRECTORY }}/webbpsf-data working-directory: ${{ matrix.package }} smoke_tests: name: ${{ matrix.package }} (${{ matrix.runs-on }}, Python ${{ matrix.python-version }}) diff --git a/environment.yaml b/environment.yaml index 0462752d..ccb616cf 100644 --- a/environment.yaml +++ b/environment.yaml @@ -30,6 +30,7 @@ dependencies: - ginga - jwst>=1.6.2 - nictools + - poppy - pysynphot - reftools - stcal<1.3.4 @@ -40,3 +41,4 @@ dependencies: - synphot - wfc3tools - wfpc2tools + - webbpsf From b8e5292b7eb3fe6a9065af120ec52ac3144efd18 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Mon, 24 Oct 2022 11:55:46 -0400 Subject: [PATCH 2/2] cache data --- .github/workflows/build.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7e620293..a4312bdc 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -212,6 +212,11 @@ jobs: CRDS_SERVER_URL: ${{ matrix.env.CRDS_SERVER_URL }} WEBBPSF_PATH: ${{ env.DATA_DIRECTORY }}/webbpsf-data working-directory: ${{ matrix.package }} + - if: matrix.data != '' + uses: actions/cache@v3 + with: + path: 'tests/data/' + key: data-${{ hashFiles('tests/data/*') }} smoke_tests: name: ${{ matrix.package }} (${{ matrix.runs-on }}, Python ${{ matrix.python-version }}) needs: [ build ]