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

Automatically preprend ones in tile_shape to match data_shape #18

Merged
merged 5 commits into from
Jan 19, 2022

Conversation

alisterburt
Copy link
Contributor

This PR automatically expands the dimensionality of tile_shape to match data_shape following numpy broadcasting semantics

e.g.
Tiler(data_shape=(128,128,128), tile_shape=(128, 128)). == Tiler(data_shape=(128,128,128), tile_shape=(1, 128, 128)).

@the-lay
Copy link
Owner

the-lay commented Jan 19, 2022

Sorry for taking long to take a look!

  1. One concern that I have is that this doesn't actually follow numpy broadcasting in the same way, specifically it doesn't check if two dimensions are equal or one of them is 1. And it shouldn't, since the tile can be bigger than data. I think this can be an error causing place, so I want to add a warning to make sure users notice what is happening there.

  2. Another thing is that this adjustment should happen only when tile_shape is given to recalculate, so I moved this adjustment snippet up a bit.

  3. I've also changed comments/documentation a bit and took this as an opportunity to update the docs generator :)

Thank you very much for your contribution!

@the-lay the-lay merged commit b9adc5f into the-lay:master Jan 19, 2022
@the-lay the-lay changed the title Expand tile shape according to numpy broadcasting semantics Automatically preprend ones in tile_shape to match data_shape Jan 19, 2022
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 this pull request may close these issues.

2 participants