Skip to content

Commit

Permalink
Merge pull request #2 from spacetelescope/develop
Browse files Browse the repository at this point in the history
1.5.2 release
  • Loading branch information
BradleySappington authored Dec 13, 2024
2 parents 1ed2a9d + 0e0dcff commit 098e3d3
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
retrieve_cache:
uses: spacetelescope/stpsf/.github/workflows/retrieve_cache.yml@stable # 2090d50be6b75f2c241c07ae0538bff16e5be25e # v1.4.0 # TODO change to initial release
uses: spacetelescope/stpsf/.github/workflows/retrieve_cache.yml@develop # 2090d50be6b75f2c241c07ae0538bff16e5be25e # v1.4.0 # TODO SAPP change to initial release
with:
minimal: true
tests:
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
key: ${{ needs.retrieve_cache.outputs.cache_key }}

- name: Set STPSF data path
run: echo "STPSF_PATH=${{ needs.retrieve_cache.outputs.cache_path }}/webbpsf-data/" >> $GITHUB_ENV # TODO rename this path to be /stpsf-data/
run: echo "STPSF_PATH=${{ needs.retrieve_cache.outputs.cache_path }}/stpsf-data/" >> $GITHUB_ENV

- name: Check conda info
run: conda info
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/download_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ on:
description: URL to gzip file
type: string
required: false
default: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz
default: https://stsci.box.com/shared/static/3hzmbarac5yxjt6x7gn17vz02k7c8z1d.gz
minimal:
description: dataset is minimal (as opposed to full)
type: boolean
Expand All @@ -50,7 +50,7 @@ on:
description: URL to gzip file
type: string
required: false
default: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz
default: https://stsci.box.com/shared/static/3hzmbarac5yxjt6x7gn17vz02k7c8z1d.gz
minimal:
description: dataset is minimal (as opposed to full)
type: boolean
Expand All @@ -64,8 +64,8 @@ on:
- develop

env:
FULL_DATA_URL: https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz
MINIMAL_DATA_URL: https://stsci.box.com/shared/static/0dt9z6b927iqgtify2a4cvls9hvapi6k.gz
FULL_DATA_URL: https://stsci.box.com/shared/static/kqfolg2bfzqc4mjkgmujo06d3iaymahv.gz
MINIMAL_DATA_URL: https://stsci.box.com/shared/static/3hzmbarac5yxjt6x7gn17vz02k7c8z1d.gz

jobs:
download:
Expand All @@ -81,7 +81,7 @@ jobs:
run: echo "version=$(cat ${{ steps.cache_path.outputs.cache_path }}/stpsf-data/version.txt)" >> $GITHUB_OUTPUT
- id: cache_key
run: echo "cache_key=stpsf-data-${{ (github.event_name == 'schedule' || github.event_name == 'release') && 'mini' || inputs.minimal && 'mini' || 'full' }}-${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 # TODO UPDATE THIS
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ${{ runner.temp }}/data/
key: ${{ steps.cache_key.outputs.cache_key }}
Expand Down
2 changes: 1 addition & 1 deletion dev_utils/compute_psf_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
assert exists(os.environ['PYSYN_CDBS']), "Can't load synthetic photometry files!"

if not os.environ.get('STPSF_PATH'):
os.environ['STPSF_PATH'] = '/grp/jwst/ote/webbpsf-data' # TODO should this folder location exist outside of jwst, change to stpsf when ready
os.environ['STPSF_PATH'] = '/grp/jwst/ote/stpsf-data' # TODO SAPP change to stpsf when new mount is ready
import stpsf # noqa

N_PROCESSES = 16
Expand Down
4 changes: 2 additions & 2 deletions dev_utils/grab_opd_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from scipy import ndimage
import stpsf

# TODO - this should transition to stpsf
matfile = '/itar/jwst/tel/share/webbpsf/webbpsf-data-source/JWST_thermal_response_data05_31_2017.mat'
# TODO SAPP - this should transition to stpsf location after new mount
matfile = '/grp/jwst/ote/stpsf-data-source/OTE_source/JWST_thermal_response_data05_31_2017.mat'


def load_matfile(matfile):
Expand Down
4 changes: 2 additions & 2 deletions dev_utils/make-data-sdist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ if ! [[ $1 ]]; then
echo " ./make-data-sdist.sh 0.3.3"
exit 1
fi
# TODO move this to proper location stpsf
# TODO SAPP move this to proper location stpsf after new mount
if ! [[ $DATAROOT ]]; then
DATAROOT="/grp/jwst/ote/webbpsf-data-source/"
DATAROOT="/grp/jwst/ote/stpsf-data-source/"
fi
echo "Using data from $DATAROOT"

Expand Down
10 changes: 8 additions & 2 deletions dev_utils/master_data_release.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# Top-level script to make a distributable version of the data files

# See /itar/jwst/tel/share/stpsf/stpsf-data-source/README_DEVEL.txt
# See /grp/stpsf/stpsf-data-source/README_DEVEL.txt # TODO SAPP VERIFY THIS IS CREATED

if ! [[ $1 ]]; then
echo "Provide a version string, e.g.:"
Expand All @@ -16,21 +16,27 @@ TMPDIR="/tmp/stpsf-data"

echo
echo "Copying latest data to /grp/jwst/ote for internal stsci use..."
main_directory="/grp/jwst/ote"
main_directory="/grp/jwst/ote" # TODO SAPP - update when stpsf new data mount
new_directory="$main_directory/stpsf-data-$VER"
symlink_directory="/grp/jwst/ote/stpsf-data"
legacy_webbpsf_symlink_directory="/grp/jwst/ote/webbpsf-data"

cp "$PWD/stpsf-data-$VER.tar.gz" "$main_directory"
mkdir "$new_directory"
tar -xzf "$PWD/stpsf-data-$VER.tar.gz" -C "$new_directory"
rm "$symlink_directory"
ln -s "$new_directory/stpsf-data" "$symlink_directory"

# Allow legacy webbpsf users to continue using the stpsf data
rm "$legacy_webbpsf_symlink_directory"
ln -s "$symlink_directory" "$legacy_webbpsf_symlink_directory"

./make-minimal-datafiles.py ${PWD}/stpsf-data-${VER}.tar.gz $VER

echo
echo "================================================="
echo "Data extracted for internal use with updated symlink $symlink_directory -> $new_directory"
echo "Legacy WebbPSF symlink $legacy_webbpsf_symlink_directory -> $symlink_directory"
echo
echo "OUTPUT FILES:"
echo
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Installing the Required Data Files
Files containing such information as the JWST pupil shape, instrument throughputs, and aperture positions are distributed separately from STPSF. To run STPSF, you must download these files and tell STPSF where to find them using the ``STPSF_PATH`` environment variable.

1. Download the following file: `stpsf-data-LATEST.tar.gz <https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz>`_ [approx. 70 MB]
1. Download the following file: `stpsf-data-LATEST.tar.gz <https://stsci.box.com/shared/static/kqfolg2bfzqc4mjkgmujo06d3iaymahv.gz>`_ [approx. 70 MB]
2. Untar ``stpsf-data-LATEST.tar.gz`` into a directory of your choosing.
3. Set the environment variable ``STPSF_PATH`` to point to that directory. e.g. ::

Expand Down
6 changes: 6 additions & 0 deletions docs/relnotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ See https://github.com/spacetelescope/stpsf/issues for currently open issues and
Version History and Change Log
-------------------------------

Version 1.5.2
=============
*2024 December*
Continuing setting up migration and automated tasks, not production ready


Version 1.5.1
=============
*2024 December*
Expand Down
2 changes: 1 addition & 1 deletion stpsf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class UnsupportedPythonError(Exception):
# required. If changes to the code and data mean STPSF won't work
# properly with an old data package, increment this version number.
# (It's checked against $STPSF_DATA/version.txt)
DATA_VERSION_MIN = (1, 5, 0)
DATA_VERSION_MIN = (1, 5, 2)


class Conf(_config.ConfigNamespace):
Expand Down
2 changes: 1 addition & 1 deletion stpsf/tests/test_errorhandling.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def mockreturn():
_ = utils.get_stpsf_data_path()

# Check that the data was downloaded
assert any((tmp_path / "data" / "webbpsf-data").iterdir()) # TODO - when box changes switch this to stpsf-data
assert any((tmp_path / "data" / "stpsf-data").iterdir())

# Test that we can override the STPSF_PATH setting here through
# the config object even though the environment var is deleted
Expand Down
4 changes: 2 additions & 2 deletions stpsf/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def auto_download_stpsf_data():
from urllib.request import urlretrieve

# Create a default directory for the data files
default_path = Path.home() / "data" / "webbpsf-data" # TODO - change this to stpsf-data once box data has that folder name
default_path = Path.home() / "data" / "stpsf-data"
default_path.mkdir(parents=True, exist_ok=True)

os.environ["STPSF_PATH"] = str(default_path)
Expand All @@ -199,7 +199,7 @@ def auto_download_stpsf_data():

with TemporaryDirectory() as tmpdir:
# Download the data files to a temporary directory
url = "https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz"
url = "https://stsci.box.com/shared/static/kqfolg2bfzqc4mjkgmujo06d3iaymahv.gz"
filename = Path(tmpdir) / "stpsf-data-LATEST.tar.gz"
urlretrieve(url, filename)

Expand Down

0 comments on commit 098e3d3

Please sign in to comment.