Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: allow tuples instead of slice objects in sel or isel #280

Closed
shoyer opened this issue Nov 21, 2014 · 3 comments
Closed

Proposal: allow tuples instead of slice objects in sel or isel #280

shoyer opened this issue Nov 21, 2014 · 3 comments

Comments

@shoyer
Copy link
Member

shoyer commented Nov 21, 2014

e.g., we should be able to write ds.sel(time=('2000', '2010')) as an alias for ds.sel(time=slice('2000', '2010'))

@shoyer
Copy link
Member Author

shoyer commented Dec 12, 2014

Two concerns occur to me about this change:

  1. It does break backward compatibility.
  2. It currently possible to use an index of tuples (and eventually, we'll support multi-index), and this would break that.

@IamJeffG
Copy link
Contributor

I agree with your concerns and vote "-1" on this proposal.

When I read ds.sel(time=('2000', '2010')) with no outside context, I expect to get back exactly two ticks along the time axis: that equal to '2000' and that equal to '2010'. (reminiscent of #214, though multidimensional is trickier)

@shoyer
Copy link
Member Author

shoyer commented Feb 24, 2015

OK, closing.

The real fix here will require new Python syntax to support ds[time='2000':'2010']

@shoyer shoyer closed this as completed Feb 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants