inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

[bugfix]: do not exit early for 0-size arrays #167

Closed kaushikcfd closed 2 years ago

kaushikcfd commented 2 years ago

In some cases, this would lose metadata.

Co-authored-by: Matthew Smith mjsmith6@illinois.edu


Originally proposed in https://github.com/kaushikcfd/arraycontext/pull/3 and makes sense now that pytato is smarter about empty arrays after https://github.com/inducer/pytato/pull/320.

kaushikcfd commented 2 years ago

Since this is not solving a real problem, I'll close this. See https://github.com/inducer/arraycontext/pull/167#discussion_r893908967.

inducer commented 2 years ago

Sounds good by me! :)

inducer commented 2 years ago

Revived in #168.

majosm commented 2 years ago

IIRC, the reason this was causing me issues is that by exiting early, it wasn’t bubbling up the axis information from the contained expression to the final result array. Thus any axis tagging done inside was being thrown away.

kaushikcfd commented 2 years ago

Thus any axis tagging done inside was being thrown away.

@inducer this makes sense. Essentially, we weren't calling self.transform_dag to propagate the axes tags.

inducer commented 2 years ago

@majosm Thanks for following up! Added a comment to explain this in #169.