netcdf4-python
netcdf4-python copied to clipboard
what to do when a variable is sliced with an all False Boolean index array?
Current behavior:
- for a 1D variable an empty array is returned
- for multi-dim variables an opaque exception is raised.
- for numpy arrays, an empty array is always returned
Two potential solutions:
- PR #1197: always return an exception with a more informative error message
- PR #1198: always silently return an empty array (as numpy does)
Which one do you prefer?
@dopplershift @shoyer any thoughts on this?
Returning the size zero array like NumPy feels like the right thing to do
I agree, my lean was towards mirroring NumPy behavior.
thanks - that's my thought as well. I will merge PR #1198 next week if we have no dissenting opinions by then.