Skip to content

Commit a79c863

Browse files
committed
removing unnecessary functionality
1 parent 40d2bd0 commit a79c863

2 files changed

Lines changed: 11 additions & 28 deletions

File tree

src/graphnet/models/data_representation/images/image_representation.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,6 @@ def shape(self) -> List[List[int]]:
7777
"""Channel-spatial layout per image tensor (see ``GridDefinition``)."""
7878
return self._grid_definition.shape
7979

80-
def single_image_spatial_shape(self) -> Tuple[int, int, int]:
81-
"""Return spatial size as ``(height, width, depth)`` for one 3D image.
82-
83-
Raises:
84-
ValueError: If ``shape`` does not describe exactly one four-axis
85-
layout (channels plus three spatial axes).
86-
"""
87-
layouts = self.shape
88-
if len(layouts) != 1:
89-
raise ValueError(
90-
"Expected a single-image data representation (one shape "
91-
f"entry), got {len(layouts)}. For multi-image inputs, build "
92-
"the backbone explicitly for each tensor."
93-
)
94-
layout = layouts[0]
95-
if len(layout) != 4:
96-
raise ValueError(
97-
"Expected each image layout as "
98-
"[num_channels, height, width, depth]; "
99-
f"got {layout!r}."
100-
)
101-
return (layout[1], layout[2], layout[3])
102-
10380
def _set_output_feature_names(
10481
self, input_feature_names: List[str]
10582
) -> List[str]:

src/graphnet/models/data_representation/images/mappings/grid_definition.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ def __init__(
100100
) -> None:
101101
"""Construct `IC86GridDefinition`.
102102
103-
The mapping from (string, dom_number) to a position in the
104-
resulting images is generated programmatically at instantiation
105-
time from the IceCube86 detector geometry, so no auxiliary file
106-
is required.
107-
108103
Args:
109104
detector: ``IceCube86`` instance (grid is fixed to that geometry).
110105
dtype: data type used for node features. e.g. ´torch.float´
@@ -169,6 +164,8 @@ def _set_indices(
169164
) -> None:
170165
"""Set the indices for the features."""
171166
self._cnn_features_idx = []
167+
self._dom_number_idx = None
168+
self._string_idx = None
172169
for feature in feature_names:
173170
if feature == dom_number_label:
174171
self._dom_number_idx = feature_names.index(feature)
@@ -177,6 +174,15 @@ def _set_indices(
177174
else:
178175
self._cnn_features_idx.append(feature_names.index(feature))
179176

177+
if self._dom_number_idx is None:
178+
raise ValueError(
179+
f"DOM number label not found in feature names: {dom_number_label}"
180+
)
181+
if self._string_idx is None:
182+
raise ValueError(
183+
f"String label not found in feature names: {string_label}"
184+
)
185+
180186
def forward(self, data: Data, data_feature_names: List[str]) -> Data:
181187
"""Scatter pixel rows into IceCube-86 image tensor(s)."""
182188
# Initialize output arrays

0 commit comments

Comments
 (0)