Skip to content

Uniform the API of the noise generation module#151

Merged
ziotom78 merged 20 commits intomasterfrom
fix134
Jan 19, 2022
Merged

Uniform the API of the noise generation module#151
ziotom78 merged 20 commits intomasterfrom
fix134

Conversation

@ziotom78
Copy link
Copy Markdown
Member

This PR introduces some breaking changes to the noise module. Specifically:

  • There are two functions to add noise: add_noise has been renamed to add_noise_to_observations (similar to add_dipole_to_observations), and a new function add_noise now works on plain NumPy arrays
  • Thanks to Numba, the 1/f noise generation is now ~10% faster and uses ~25% less memory
  • The Simulation object now creates a new number generator (based on PCG64) for each MPI process
  • New tests have been added for the noise generator (covering MPI as well)
  • The functions add_white_noise and add_one_over_f_noise are now correctly exported

@ziotom78
Copy link
Copy Markdown
Member Author

@paganol , apart from some speed/memory optimizations, this should fix #134. Does it look reasonable?

Unfortunately, to match the API used by other modules, I had to introduce a few breaking changes: add_noise is now add_noise_to_observations, and the parameter noisetype has been renamed noise_type.

@paganol
Copy link
Copy Markdown
Member

paganol commented Jan 18, 2022

Hi @ziotom78. It looks great to me. I made few corrections in the documentation. The only substantial change I made is that I put to zero the frequency zero in the 1/f model.


If this is ok for you, we can merge it

@ziotom78 ziotom78 merged commit f8a069c into master Jan 19, 2022
@ziotom78 ziotom78 deleted the fix134 branch January 19, 2022 07:48
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