inducer / arraycontext

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

Meaning of `ArrayContainerT` #80

Closed majosm closed 3 years ago

majosm commented 3 years ago

I'm a little unclear on whether ArrayContainerT is supposed to indicate an array container only, or if it represents either an array container or an underlying array. The documentation suggests (to me) the former, but it seems like it's being used more like the latter (for example in some of the mapping functions in container/traversal.py). Is there any consensus on what it should mean?

inducer commented 3 years ago

I think it's "array or container" throughout. Do you have an example where only one or the other would work?

At any rate, I wouldn't be opposed to renaming it ArrayOrContainerT. (with deprecation... probably?)

alexfikl commented 3 years ago

I added that just for the benefit of typing annotations to parametrize generic functions with array-like things. Most things, e.g. rec_map_array_container, accept anything from very nested containers to cl.array.Array (or equivalent pytato classes), so it should stand in for any of those.

It probably deserves a better name, so :+1: from my side as well.

majosm commented 3 years ago

I think it's "array or container" throughout. Do you have an example where only one or the other would work?

At any rate, I wouldn't be opposed to renaming it ArrayOrContainerT.

I don't think I've seen one; it's mainly just the name/documentation that made me wonder. I do like ArrayOrContainerT.