We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbbba2e commit a7cc672Copy full SHA for a7cc672
src/mdio/core/grid.py
@@ -145,8 +145,13 @@ def build_map(self, index_headers: HeaderArray) -> None:
145
146
# Assign trace indices
147
trace_indices = np.arange(start, end, dtype=np.uint64)
148
- self.map.oindex[live_dim_indices] = trace_indices
149
- self.live_mask.oindex[live_dim_indices] = True
+ # Compute flat indices for lower-memory scatter assignment
+ flat_indices = np.ravel_multi_index(live_dim_indices, live_shape)
150
+ flat_map = self.map.reshape(-1)
151
+ flat_mask = self.live_mask.reshape(-1)
152
+ # Use 1-D fancy indexing (no broadcast) for assignment
153
+ flat_map.vindex[flat_indices] = trace_indices
154
+ flat_mask.vindex[flat_indices] = True
155
156
157
class GridSerializer(Serializer):
0 commit comments