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
Remove rng parameter of binary_blobs() function in plot_random_walker_segmentation.py #7219
base: main
Are you sure you want to change the base?
Conversation
Using the rng parameter throws TypeError: TypeError: binary_blobs() got an unexpected keyword argument 'rng'
Hey @aymuos15, thanks for the suggestion. I am a bit confused why you get the TypeError.
I agree, though I think in general we try to pin our examples so they are completely reproduce-able. So I am hesitant to remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR, @aymuos15 ! I personally do not have a strong preference on what is better here - higher simplicity or higher reproducibility.
@lagru You are right. It was a version error. I apologise for not checking before. Was a mistake on my part. Will close the request if that is okay with you. Thank you for pointing it out. @soupault I personally feel the lesser the parameters in a base example, the better. But this is just a update issue on colab so doesn't matter that much I guess? |
Ideally we could have both. It seems we don't use explicit seeds in a lot of gallery examples.
Most cases are for noise though. But there is precedent for both options. In this case, I feel like for functions whose API involves randomness it's actually not a bad thing to make its usage visible. So I'm +0.1 on keeping it the way it is. @aymuos15, feel welcome to leave this open for a few days in case other devs feel different. :) |
In the scipy lecture notes, we use a long integer seed, and explain somewhere why we set a seed in examples. |
I'm in favour of
|
Hi all. Apologies for the late response. I will be in favour of: "we use a long integer seed, and explain somewhere why we set a seed in examples." Will edit this PR by the end of next week, I am away at the moment. Thank you. |
Using the rng parameter throws the following TypeError:
TypeError: binary_blobs() got an unexpected keyword argument 'rng'
Description
Parameter rng removal in line:
data = skimage.img_as_float(binary_blobs(length=128, rng=1))
of Random walker segmentation Example.
To reproduce error and fix: https://colab.research.google.com/drive/1iy8InDNAoadAaNkn0WuyND6S0a3VFmEx?usp=sharing
Removing it does not make any change to the aim of the tutorial; which is showing the segmentation capabilities.