Skip to content

Commit

Permalink
JP-2104: Do not consider GROUP candidates for WFS&C observations (#6131)
Browse files Browse the repository at this point in the history
* add validation check on acid type = group

* changelog and restart CI - codecov bug?

* add validation check on acid type = group

* changelog and restart CI - codecov bug?

* [skip ci] update changelog to 1.2.3 header
  • Loading branch information
tapastro authored Jun 11, 2021
1 parent 9a4e535 commit 9d34aa4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
1.2.3 (2021-06-08)
==================

associations
------------

- Ensure no Lv3_WFSC associations created on group candidates [#6131]

datamodels
----------

Expand Down
25 changes: 24 additions & 1 deletion jwst/associations/lib/rules_level3.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,11 +773,15 @@ def __init__(self, *args, **kwargs):
)
])

# Only valid if two members exist.
# Only valid if two members exist and candidate is not a GROUP.
self.validity.update({
'has_pair': {
'validated': False,
'check': self._has_pair
},
'is_not_group': {
'validated': False,
'check': self._validate_candidates
}
})

Expand Down Expand Up @@ -833,6 +837,25 @@ def _has_pair(self, entry=None):

return len(self.current_product['members']) == count

def _validate_candidates(self, member):
"""Disallow GROUP candidates
Parameters
----------
member : Member
Member being added. Ignored.
Returns
-------
False if candidate is GROUP.
True otherwise.
"""

# If a group candidate, reject.
if self.acid.type.lower() == 'group':
return False

return True

@RegistryMarker.rule
class Asn_Lv3WFSSNIS(AsnMixin_Spectrum):
Expand Down

0 comments on commit 9d34aa4

Please sign in to comment.