Skip to content

Commit 2af6140

Browse files
committed
Add target_sharding_type to match/difference tasks
1 parent c1ea98b commit 2af6140

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

python/lsst/pipe/tasks/diff_matched_tract_catalog.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,27 @@ def __init__(self, *, config=None):
106106
if config.refcat_sharding_type != "tract":
107107
if config.refcat_sharding_type == "none":
108108
old = self.cat_ref
109-
del self.cat_ref
110109
self.cat_ref = cT.Input(
111110
doc=old.doc,
112111
name=old.name,
113112
storageClass=old.storageClass,
114113
dimensions=(),
115114
deferLoad=old.deferLoad,
116115
)
116+
else:
117+
raise NotImplementedError(f"{config.refcat_sharding_type=} not implemented")
118+
if config.target_sharding_type != "tract":
119+
if config.target_sharding_type == "none":
120+
old = self.cat_target
121+
self.cat_target = cT.Input(
122+
doc=old.doc,
123+
name=old.name,
124+
storageClass=old.storageClass,
125+
dimensions=(),
126+
deferLoad=old.deferLoad,
127+
)
128+
else:
129+
raise NotImplementedError(f"{config.target_sharding_type=} not implemented")
117130

118131

119132
class MatchedCatalogFluxesConfig(pexConfig.Config):
@@ -265,6 +278,11 @@ def columns_in_target(self) -> list[str]:
265278
allowed={"tract": "Tract-based shards", "none": "No sharding at all"},
266279
default="tract",
267280
)
281+
target_sharding_type = pexConfig.ChoiceField[str](
282+
doc="The type of sharding (spatial splitting) for the target catalog",
283+
allowed={"tract": "Tract-based shards", "none": "No sharding at all"},
284+
default="tract",
285+
)
268286

269287
def validate(self):
270288
super().validate()

python/lsst/pipe/tasks/match_tract_catalog.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,27 @@ def __init__(self, *, config=None):
8585
if config.refcat_sharding_type != "tract":
8686
if config.refcat_sharding_type == "none":
8787
old = self.cat_ref
88-
del self.cat_ref
8988
self.cat_ref = cT.Input(
9089
doc=old.doc,
9190
name=old.name,
9291
storageClass=old.storageClass,
9392
dimensions=(),
9493
deferLoad=old.deferLoad,
9594
)
95+
else:
96+
raise NotImplementedError(f"{config.refcat_sharding_type=} not implemented")
97+
if config.target_sharding_type != "tract":
98+
if config.target_sharding_type == "none":
99+
old = self.cat_target
100+
self.cat_target = cT.Input(
101+
doc=old.doc,
102+
name=old.name,
103+
storageClass=old.storageClass,
104+
dimensions=(),
105+
deferLoad=old.deferLoad,
106+
)
107+
else:
108+
raise NotImplementedError(f"{config.target_sharding_type=} not implemented")
96109

97110

98111
class MatchTractCatalogSubConfig(pexConfig.Config):
@@ -167,6 +180,11 @@ class MatchTractCatalogConfig(
167180
allowed={"tract": "Tract-based shards", "none": "No sharding at all"},
168181
default="tract",
169182
)
183+
target_sharding_type = pexConfig.ChoiceField[str](
184+
doc="The type of sharding (spatial splitting) for the target catalog",
185+
allowed={"tract": "Tract-based shards", "none": "No sharding at all"},
186+
default="tract",
187+
)
170188

171189
def get_columns_in(self) -> Tuple[Set, Set]:
172190
"""Get the set of input columns required for matching.

0 commit comments

Comments
 (0)