google / google/Xee

[FR]: Preallocate tiles with NumPy arrays for better performance and code clarity

Open
#280 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
371
Forks
48
PR merge metrics
No merged PRs in 30d

Description

### Feature Summary

Replace nested list pre-allocation of 'tiles' with NumPy arrays using `np.empty(shape, dtype=object)`. Update all tile access patterns from tiles[i][j][k] to tiles[i, j, k] for consistency and improved code readability.

### Use Cases

- Enables more pythonic and efficient handling of multi-dimensional tiles and blocks.
- Reduces memory allocation overhead and potentially improves execution performance.
- Makes tile-based operations more readable and maintainable, especially for future features dependent on array shape.
- Cleaner integration of code with scientific Python ecosystem and facilitates future optimizations leveraging NumPy.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.