Skip to content

read(): don't ignore frames if out is given?#46

Merged
mgeier merged 1 commit intomasterfrom
dont-ignore-frames
Jun 18, 2014
Merged

read(): don't ignore frames if out is given?#46
mgeier merged 1 commit intomasterfrom
dont-ignore-frames

Conversation

@mgeier
Copy link
Contributor

@mgeier mgeier commented Jun 17, 2014

We already discussed this in #37 and the current behavior is this:

If both frames and out are specified in read(), the value of frames is silently ignored (same with dtype and always_2d).

While implementing the blocks() feature (#35), however, I found that it may be better to change this behavior slightly.

What about not ignoring frames?

That would mean if frames is smaller than the length of out, it is taken into account, if it is larger, it would still be ignored.
This would be similar to the default Python indexing behavior, where an index larger than the maximum index is silently truncated to the maximum index.

dtype and always_2d would still be ignored.

Is this a bad idea?

I didn't add tests to not interfere with the py.test rewrite, but we should add some test cases for this afterwards.

@bastibe
Copy link
Owner

bastibe commented Jun 17, 2014

I don't see any harm in this. Looks good.

By the way, you can see an up-to-date version of the (ongoing) test rewrite in the tests branch. Feel free to add your own. I am removing UnitTest based tests as I add test.py based ones.

@mgeier mgeier merged commit 496451b into master Jun 18, 2014
@mgeier mgeier deleted the dont-ignore-frames branch June 18, 2014 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants