19263, "vasslitvinov", "Shape queries on iterable things", "2022-02-17T03:51:01Z"
This issue aims at building a uniform set of queries that report on aspects of the iteration space aka the index set of iterable things:
ranges, domains, arrays
other datatypes that provide .these methods
iterators
promoted expressions
Most of these queries are currently available. This issue allows us to see how they fit together, make sure we are happy with the specifics, and request that they be made available where currently they are not.
functionality
returned value
method name
size of each dimension
rank*int tuple of sizes (rect)(irreg)
.shape
range of each dimension
rank*range tuple of ranges (rect)
.dims
compact iteration space
range or multi-dim range (rect) or iterable (irreg)
.indices
"faithful" iteration space
range (when applicable) (new proposal)
.range
ditto
domain (when applicalbe)
.domain
ditto
range or domain or nothing or user-defined? (new proposal)
tbd
(rect) : available when the iteration space is rectangular (excluding sparse)
(irreg) : available when the iteration space is an irregular domain and perhaps in some other cases
multi-dim range aka lightweight domain (new proposal) : a record-wrapped tuple of ranges with domain-like functionality, excluding support for creating arrays over it
"faithful" iteration space : provides the natural representation when available; if it is a domain, the user can declare arrays over it
Iterators and promoted expressions are not amenable to user-facing queries at the moment, however they can be in the future ex. with the iterator record proposal.