Repository: spacetelescope/stdatamodels (language: python)

Issue:
fix numpy scalar handling in RefractionIndexFromPrism
As shown in jwst tests fixing numpy 2.0 deprecations there are a few deprecations from numpy 1.25 that are not yet addressed:
https://github.com/spacetelescope/jwst/actions/runs/6198454984/job/16828931603#step:10:459

A few of these are from code in stdatamodels file `RefractionIndexFromPrism`. ~These warnings are not seen in the stdatamodels CI as not all jwst tests are currently run.~ These warnings can also be seen in our `test_downstream` runs:
https://github.com/spacetelescope/stdatamodels/actions/runs/6175840080/job/16763536280#step:10:1995

This PR updates `RefractionIndexFromPrism` to convert single element ndarrays to scalars before computing sin cos to avoid deprecation warning:

DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)


**Checklist**
- [ ] added entry in `CHANGES.rst` (either in `Bug Fixes` or `Changes to API`)
- [ ] updated relevant tests
- [ ] updated relevant documentation
- [ ] updated relevant milestone(s)
- [ ] added relevant label(s)



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml
index af24ede4..7907370c 100644
--- a/.github/workflows/ci_cron.yml
+++ b/.github/workflows/ci_cron.yml
@@ -4,6 +4,13 @@ on:
   schedule:
     # Weekly Monday midnight build
     - cron: "0 0 * * 1"
+  pull_request:
+    types:
+      - opened
+      - reopened
+      - labeled
+      - unlabeled
+      - synchronize
   workflow_dispatch:
 
 concurrency:


Test patch:
diff --git a/.github/workflows/test_devdeps.yml b/.github/workflows/test_devdeps.yml
index 1c3d9d4d..ea579797 100644
--- a/.github/workflows/test_devdeps.yml
+++ b/.github/workflows/test_devdeps.yml
@@ -8,6 +8,12 @@ on:
     tags:
       - '*'
   pull_request:
+    types:
+      - opened
+      - reopened
+      - labeled
+      - unlabeled
+      - synchronize
   schedule:
     # Weekly Monday 9AM build
     # * is a special character in YAML so you have to quote this string