Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i index in block collection self.data_source.tiles.slice_traverse ? #181

Closed
chrishavlin opened this issue Feb 25, 2025 · 1 comment · Fixed by #182
Closed

i index in block collection self.data_source.tiles.slice_traverse ? #181

chrishavlin opened this issue Feb 25, 2025 · 1 comment · Fixed by #182
Milestone

Comments

@chrishavlin
Copy link
Contributor

The second loop here is using i from the first loop?

for i, block in enumerate(self.data_source.tiles.traverse()):
self.min_val = min(self.min_val, np.nanmin(np.abs(block.my_data[0])).min())
self.max_val = max(self.max_val, np.nanmax(np.abs(block.my_data[0])).max())
self.blocks[id(block)] = (i, block)
vert.append([1.0, 1.0, 1.0, 1.0])
dds = (block.RightEdge - block.LeftEdge) / block.source_mask.shape
dx.append(dds.tolist())
le.append(block.LeftEdge.tolist())
re.append(block.RightEdge.tolist())
for g, node, (sl, _dims, _gi) in self.data_source.tiles.slice_traverse():
block = node.data
self.blocks_by_grid[g.id - g._id_offset].append((id(block), i))
self.grids_by_block[id(node.data)] = (g.id - g._id_offset, sl)

I don't think there's anywhere in the code that uses that i. should it maybe be _gi?

@matthewturk
Copy link
Member

Great catch. I agree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants