Skip to content

Commit

Permalink
mypy import fix try 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tapastro committed Jan 30, 2025
1 parent 2cacecd commit 64cde4d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions jwst/associations/generator/generate_per_candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ def generate_on_candidate(cid_ctype, pool, rule_defs, version_id=None, ignore_de
for i, row in enumerate(pool_cid):
if 'background' in row['asn_candidate'] and row['bkgdtarg'] == 'f':
skip_rows.append(i)
logger.debug(f"Dropping {len(skip_rows)} exposures from pool - observation "
f"candidate type does not allow association generation when a "
f"background candidate is present.")
pool_cid.remove_rows(skip_rows)

pool_cid['asn_candidate'] = [f"[('{cid}', '{ctype}')]"] * len(pool_cid)
Expand Down
7 changes: 4 additions & 3 deletions jwst/associations/load_as_asn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
from functools import partial
from os import path as os_path

from ..associations import (
from jwst.associations import (
Association,
AssociationRegistry,
libpath,
load_asn
libpath
)

from jwst.associations.load_asn import load_asn
from ..associations.asn_from_list import asn_from_list
from ..associations.lib.rules_level2_base import DMSLevel2bBase

Expand Down
12 changes: 12 additions & 0 deletions jwst/regtest/test_associations_sdp_pools.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@
'xfail': None,
'slow': False,
},
# This pair of pools test the DMS flag usage to prevent o-type asns when
# a background c-type candidate is attached to the science exposure.
'jw04225_20241213t150701_pool': {
'args': ['-i', 'o001', 'o002'],
'xfail': None,
'slow': False,
},
'jw04225_20241213t150701DMS_pool': {
'args': ['-i', 'o001', 'o002', '--DMS'],
'xfail': None,
'slow': False,
},
'jw80600_20171108T041522_pool': {
'args': [],
'xfail': 'PR #3450',
Expand Down

0 comments on commit 64cde4d

Please sign in to comment.