You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should define properly how singanl treatment functions should behave, and in general, how all functions should behave.
I spent a lot of time trying to understand why computevoltage and Anne full chain code was not giving me the exact same result when i noticed that the noise adding function overwrites the input. This is, to my practices, is very bad behaviour and also error prone. Functions should not change the values of input parameters, or if they do they should clearly state it for example by not returning any value (so forcing the user to understand how the function is used before actually using it, and providing the documentation)
What do you think?.
The text was updated successfully, but these errors were encountered:
mjtueros
changed the title
Signal treatment functions filosophy
Signal treatment functions philosophy
Jun 19, 2019
@azilles : apparently one can ensure that a numpy array is not mutable, as explained here. This could be added to the test suite for example:
test_add_noise():
voltage=numpy.array(some_values)
voltage.flags.writeable=Falsenoisy_voltage=add_noise(voltage) # Will raise an error if someone tries to modify voltage
I think we should define properly how singanl treatment functions should behave, and in general, how all functions should behave.
I spent a lot of time trying to understand why computevoltage and Anne full chain code was not giving me the exact same result when i noticed that the noise adding function overwrites the input. This is, to my practices, is very bad behaviour and also error prone. Functions should not change the values of input parameters, or if they do they should clearly state it for example by not returning any value (so forcing the user to understand how the function is used before actually using it, and providing the documentation)
What do you think?.
The text was updated successfully, but these errors were encountered: