Add grid_shape pre/postcondition checks.

This PR is not ready. It simply adds the checks we want on `grid_shape`. But the code does not conform to these. In particular: `all(gs <= s for (s, gs) in zip(shape, grid_shape) if s > 0)`. 

Once this condition is satisfied and this is merged this will close issue #406
```python
ntargets = reduce(operator.mul, grid_shape, 1)
assert ntargets <= len(all_targets)
self.targets = all_targets[:ntargets]
```
?