`assert`s are for logic errors to catch bugs, and are removed under certain situations (like when generating "optimized" bytecode).  Can we guarantee that it is impossible for someone to call `normalize_grid_shape()` so that this assert doesn't trigger?  If not, then this should be an exception.  I think a `ValueError` is appropriate here.