Skip to content

Conversation

samuelstjean
Copy link
Contributor

In [2]: iter = 8

In [3]: range(1, iter)
Out[3]: [1, 2, 3, 4, 5, 6, 7]

In [4]: len(range(1, iter))
Out[4]: 7

So now it should do 8 iterations by default, which is what I think is originally intended.

@@ -964,7 +964,7 @@ def recursive_response(gtab, data, mask=None, sh_order=8, peak_thr=0.01,
where_dwi = lazy_index(~gtab.b0s_mask)
response_p = np.ones(len(n))

for num_it in range(1, iter):
for num_it in range(iter):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it, would you mind changing the name of this variable? iter is a key-word (a function) in the language.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would break the backward compatibility of the function (it's an input), including the script I am revamping which lead me to see this. Unless we add deprecation warning and everything to it it might break more stuff than it could fix.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good point. Sigh.

@arokem
Copy link
Contributor

arokem commented Nov 30, 2015

@ChantalTax : could you please confirm this was your intention?

@arokem
Copy link
Contributor

arokem commented Dec 10, 2015

Hey @ChantalTax - could you please confirm that this is indeed a bug fix?

@ChantalTax
Copy link
Contributor

Hey! This seems indeed a bug fix, thanks!

@arokem
Copy link
Contributor

arokem commented Dec 10, 2015

Great. Thanks @ChantalTax for confirming! And thanks @samuelstjean for noticing this! Is there any test you could write that would prevent this bug from recurring?

@samuelstjean
Copy link
Contributor Author

er, not really, this just arose from the fact that matlab indexing starts from 1 and python indexing starts from 0 I think, it's just a small implementation detail overlook, not a real bug per se.

@arokem
Copy link
Contributor

arokem commented Dec 10, 2015

I understand that. How did you run into this? Just by running the code, or
were you getting some odd results?
On Dec 10, 2015 8:29 AM, "Samuel St-Jean" notifications@github.com wrote:

er, not really, this just arose from the fact that matlab indexing starts
from 1 and python indexing starts from 0 I think, it's just a small
implementation detail overlook, not a real bug per se.


Reply to this email directly or view it on GitHub
#797 (comment).

@arokem
Copy link
Contributor

arokem commented Dec 10, 2015

Sorry, meant to say "just by reading the code"
On Dec 10, 2015 8:31 AM, "Ariel Rokem" arokem@gmail.com wrote:

I understand that. How did you run into this? Just by running the code, or
were you getting some odd results?
On Dec 10, 2015 8:29 AM, "Samuel St-Jean" notifications@github.com
wrote:

er, not really, this just arose from the fact that matlab indexing starts
from 1 and python indexing starts from 0 I think, it's just a small
implementation detail overlook, not a real bug per se.


Reply to this email directly or view it on GitHub
#797 (comment).

@samuelstjean
Copy link
Contributor Author

Reading the code, since it returns a whole object and the auto response returns a tuple, it was breaking a bunch of debug prints in the calling script I have to run CSD.

@arokem
Copy link
Contributor

arokem commented Dec 10, 2015

OK -- thanks. I think this is fine to merge, and will wait until early next week to do so, in case anyone else has anything to add. Thanks for noticing this!

@arokem
Copy link
Contributor

arokem commented Dec 24, 2015

Whoops - forgot to hit the merge button on this one!

🎄

arokem added a commit that referenced this pull request Dec 24, 2015
@arokem arokem merged commit cb4d178 into dipy:master Dec 24, 2015
@samuelstjean samuelstjean deleted the patch-3 branch January 4, 2016 08:52
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.

3 participants