Repository: spacetelescope/jwql

Issue:
Anomaly listing capitialization turns MRS into Mrs
The capitalization on the Anomaly listing for MIRI is camel case, which changes the MRS and LRS instrument anomalies into Mrs and Lrs. We have in the code anomalies of ‘MRS_glow’ and ‘MRS_zipper’ and ‘LRS_Contamination’.  On the anomaly listing, it’s ‘Mrs glow’, ‘Mrs zipper’ and ‘Lrs Contamination’.  It’s not a major issue, but turning MRS into Mrs looks a bit odd.

**To Reproduce**
Steps to reproduce the behavior:
1. MIRI archive page
2. Click on any MIRI preview image
3. Look at list of anomalies.

**Expected behavior**
I expected to see something like MRS glow or MRS zipper, not Mrs Glow or Mrs Zipper.

It's not urgent, but we'd like to keep MRS and LRS capitalized where they appear.



Discussion:

Resolving patch:
diff --git a/jwql/utils/constants.py b/jwql/utils/constants.py
--- a/jwql/utils/constants.py
+++ b/jwql/utils/constants.py
@@ -10,6 +10,7 @@
     - Teagan King
     - Mike Engesser
     - Maria Pena-Guerrero
+    - Rachel Cooper
 
 Use
 ---
@@ -69,10 +70,10 @@
     # instrument-specific anomalies:
     'column_pull_up': ['miri'],
     'column_pull_down': ['miri'],
-    'dominant_msa_leakage': ['nirspec'],
+    'Dominant_MSA_Leakage': ['nirspec'],
     'dragons_breath': ['nircam'],
-    'MRS_glow': ['miri'],
-    'MRS_zipper': ['miri'],
+    'MRS_Glow': ['miri'],
+    'MRS_Zipper': ['miri'],
     'internal_reflection': ['miri'],
     'optical_short': ['nirspec'],  # Only for MOS observations
     'row_pull_up': ['miri'],
@@ -81,16 +82,20 @@
     'tree_rings': ['miri'],
     # additional anomalies:
     'other': ['fgs', 'miri', 'nircam', 'niriss', 'nirspec']}
+# anomalies that shouldn't be 'titleized'
+special_cases = ['Dominant_MSA_Leakage','MRS_Glow','MRS_Zipper','LRS_Contamination'] 
 
 # Defines the possible anomalies to flag through the web app
-ANOMALY_CHOICES = [(anomaly, inflection.titleize(anomaly)) if anomaly != "dominant_msa_leakage"
-                   else (anomaly, "Dominant MSA Leakage")
-                   for anomaly in ANOMALIES_PER_INSTRUMENT]
+ANOMALY_CHOICES = [(anomaly, inflection.titleize(anomaly)) if anomaly not in special_cases
+                        else (anomaly, anomaly.replace('_',' '))
+                        for anomaly in ANOMALIES_PER_INSTRUMENT]
 
 ANOMALY_CHOICES_FGS = [(anomaly, inflection.titleize(anomaly)) for anomaly in ANOMALIES_PER_INSTRUMENT
                        if 'fgs' in ANOMALIES_PER_INSTRUMENT[anomaly]]
 
-ANOMALY_CHOICES_MIRI = [(anomaly, inflection.titleize(anomaly)) for anomaly in ANOMALIES_PER_INSTRUMENT
+ANOMALY_CHOICES_MIRI = [(anomaly, inflection.titleize(anomaly)) if anomaly not in special_cases
+                        else (anomaly, anomaly.replace('_',' '))
+                        for anomaly in ANOMALIES_PER_INSTRUMENT
                         if 'miri' in ANOMALIES_PER_INSTRUMENT[anomaly]]
 
 ANOMALY_CHOICES_NIRCAM = [(anomaly, inflection.titleize(anomaly)) for anomaly in ANOMALIES_PER_INSTRUMENT
@@ -99,10 +104,10 @@
 ANOMALY_CHOICES_NIRISS = [(anomaly, inflection.titleize(anomaly)) for anomaly in ANOMALIES_PER_INSTRUMENT
                           if 'niriss' in ANOMALIES_PER_INSTRUMENT[anomaly]]
 
-ANOMALY_CHOICES_NIRSPEC = [(anomaly, inflection.titleize(anomaly)) if anomaly != "dominant_msa_leakage"
-                           else (anomaly, "Dominant MSA Leakage")
-                           for anomaly in ANOMALIES_PER_INSTRUMENT
-                           if 'nirspec' in ANOMALIES_PER_INSTRUMENT[anomaly]]
+ANOMALY_CHOICES_NIRSPEC = [(anomaly, inflection.titleize(anomaly)) if anomaly not in special_cases
+                            else (anomaly, anomaly.replace('_',' '))
+                            for anomaly in ANOMALIES_PER_INSTRUMENT
+                            if 'nirspec' in ANOMALIES_PER_INSTRUMENT[anomaly]]
 
 ANOMALY_CHOICES_PER_INSTRUMENT = {'fgs': ANOMALY_CHOICES_FGS,
                                   'miri': ANOMALY_CHOICES_MIRI,


Test patch: