Repository: spacetelescope/stdatamodels (language: python)

Issue:
Removed unused `DrizPars` stuff
xlinking: https://github.com/spacetelescope/jwst/issues/8558

https://github.com/search?q=repo%3Aspacetelescope%2Fstdatamodels+DRIZPAR&type=code

Some things that might be removable:
- [DrizParsModel](https://github.com/spacetelescope/stdatamodels/blob/main/src/stdatamodels/jwst/datamodels/drizpars.py)
- [drizpars.schema.yaml](https://github.com/spacetelescope/stdatamodels/blob/main/src/stdatamodels/jwst/datamodels/schemas/drizpars.schema.yaml)
- [R_DRZPAR](https://github.com/spacetelescope/stdatamodels/blob/0326fd4aa771c42a731eb0e5e0bd9bb2fc267789/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml#L1831) in core schema

Targeting inclusion in jwst B11.1


Discussion / hints:

Fix patch:
diff --git a/CHANGES.rst b/CHANGES.rst
index 7f85d185..6fbdc81e 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -3,6 +3,9 @@
 
 - replace usages of ``copy_arrays`` with ``memmap`` [#306]
 
+- Remove deprecated ``R_DRIZPAR`` keyword from core schema 
+  as well as ``jwst.datamodels.DrizParsModel``. [#316]
+  
 - Add ``mt_v2`` and ``mt_v3`` keywords to ``moving_target`` schema [#263]
 
 - add grating keyword to dark and superbias schemas [#317]
diff --git a/docs/source/jwst/datamodels/attributes.rst b/docs/source/jwst/datamodels/attributes.rst
index 29a3309d..cd1259ef 100644
--- a/docs/source/jwst/datamodels/attributes.rst
+++ b/docs/source/jwst/datamodels/attributes.rst
@@ -23,7 +23,6 @@ The current models are as follows:
     'CombinedSpecModel', 'ContrastModel', 'CubeModel',
     'DarkModel', 'DarkMIRIModel',
     'DisperserModel', 'DistortionModel', 'DistortionMRSModel',
-    'DrizParsModel',
     'Extract1dImageModel',
     'Extract1dIFUModel',
     'FilteroffsetModel',
diff --git a/src/stdatamodels/jwst/datamodels/__init__.py b/src/stdatamodels/jwst/datamodels/__init__.py
index ac4b52d2..dec577d2 100644
--- a/src/stdatamodels/jwst/datamodels/__init__.py
+++ b/src/stdatamodels/jwst/datamodels/__init__.py
@@ -15,7 +15,6 @@
 from .cube import CubeModel
 from .dark import DarkModel
 from .darkMIRI import DarkMIRIModel
-from .drizpars import DrizParsModel
 from .emi import EmiModel
 from .extract1dimage import Extract1dImageModel
 from .extract1d_spec import Extract1dIFUModel
@@ -105,7 +104,6 @@
     'CombinedSpecModel', 'ContrastModel', 'CubeModel',
     'DarkModel', 'DarkMIRIModel',
     'DisperserModel', 'DistortionModel', 'DistortionMRSModel',
-    'DrizParsModel',
     'EmiModel',
     'Extract1dImageModel',
     'Extract1dIFUModel',
diff --git a/src/stdatamodels/jwst/datamodels/drizpars.py b/src/stdatamodels/jwst/datamodels/drizpars.py
deleted file mode 100644
index dc30b34f..00000000
--- a/src/stdatamodels/jwst/datamodels/drizpars.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from .reference import ReferenceFileModel
-
-
-__all__ = ['DrizParsModel']
-
-
-class DrizParsModel(ReferenceFileModel):
-    """
-    A data model for drizzle parameters reference tables.
-    """
-    schema_url = "http://stsci.edu/schemas/jwst_datamodel/drizpars.schema"
diff --git a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
index ae483682..d13aeabf 100644
--- a/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
+++ b/src/stdatamodels/jwst/datamodels/schemas/core.schema.yaml
@@ -1821,15 +1821,6 @@ properties:
                 type: string
                 fits_keyword: R_DISTOR
                 blend_table: True
-          drizpars:
-            title: Drizzle parameters reference file information
-            type: object
-            properties:
-              name:
-                title: Drizzle parameters reference file name
-                type: string
-                fits_keyword: R_DRZPAR
-                blend_table: True
           emicorr:
             title: MIRI EMI reference file information
             type: object
diff --git a/src/stdatamodels/jwst/datamodels/schemas/drizpars.schema.yaml b/src/stdatamodels/jwst/datamodels/schemas/drizpars.schema.yaml
deleted file mode 100644
index b67fd7b4..00000000
--- a/src/stdatamodels/jwst/datamodels/schemas/drizpars.schema.yaml
+++ /dev/null
@@ -1,27 +0,0 @@
-%YAML 1.1
----
-$schema: "http://stsci.edu/schemas/fits-schema/fits-schema"
-id: "http://stsci.edu/schemas/jwst_datamodel/drizpars.schema"
-title: Default Drizzle parameters data model
-allOf:
-- $ref: referencefile.schema
-- type: object
-  properties:
-    data:
-      title: Drizzle parameters table
-      fits_hdu: DRIZPARS
-      datatype:
-      - name: numimages
-        datatype: int32
-      - name: filter
-        datatype: [ascii, 40]
-      - name: pixfrac
-        datatype: float32
-      - name: kernel
-        datatype: [ascii, 10]
-      - name: fillval
-        datatype: [ascii, 10]
-      - name: wht_type
-        datatype: [ascii, 10]
-      - name: stepsize
-        datatype: int32


Test patch:
diff --git a/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py b/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py
index 310c4975..e5e0f921 100644
--- a/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py
+++ b/src/stdatamodels/jwst/datamodels/tests/test_schema_against_crds.py
@@ -32,6 +32,9 @@ def flatten(xs):
                    'META.OBSERVATION.TIME',
                    ]
 
+# Ignore pars files and deprecated files
+ignored_stems = ("pars-", "drizpars")
+
 apcorr_model_map = {
     'MIR_LRS-FIXEDSLIT': dm.MirLrsApcorrModel,
     'MIR_LRS-SLITLESS': dm.MirLrsApcorrModel,
@@ -125,7 +128,6 @@ def flatten(xs):
     'dark': dm.DarkModel,
     'dflat': dm.NirspecFlatModel,
     'disperser': dm.DisperserModel,
-    'drizpars': dm.DrizParsModel,
     'emicorr': dm.EmiModel,
     'extract1d': dm.Extract1dIFUModel,
     'fflat': dm.NirspecFlatModel,
@@ -194,7 +196,7 @@ def test_crds_selectors_vs_datamodel(jail_environ, instrument):
     # get the reftypes
     reftypes = imap.get_filekinds()
     # remove pars- files
-    _ = [reftypes.remove(name) for name in reftypes[::-1] if name.startswith('pars-')]
+    _ = [reftypes.remove(name) for name in reftypes[::-1] if name.startswith(ignored_stems)]
 
     # iterate over reftypes for this instrument
     for reftype in reftypes: