Skip to content

Align behavior of random parameters with numpy.random.#3738

Open
heplesser wants to merge 6 commits intonest:masterfrom
heplesser:fix-3736
Open

Align behavior of random parameters with numpy.random.#3738
heplesser wants to merge 6 commits intonest:masterfrom
heplesser:fix-3736

Conversation

@heplesser
Copy link
Contributor

@heplesser heplesser commented Feb 11, 2026

This PR aligns the non-spatial normal, lognormal and exponential parameters in NEST by allowing std == 0 or beta == 0, respectively. For the exponential parameter, a test against negative beta is introduced.

This PR only modifies the plain random parameters. For spatial random parameters, we still require that parameters are strictly positive.

This fixes #3736.

@heplesser heplesser added this to Kernel Feb 11, 2026
@heplesser heplesser added T: Enhancement New functionality, model or documentation S: Normal Handle this with default priority I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Feb 11, 2026
@github-project-automation github-project-automation bot moved this to In progress in Kernel Feb 11, 2026
Copy link

@tomtetzlaff tomtetzlaff left a comment

Choose a reason for hiding this comment

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

Thanks a lot, @heplesser, for this fast fix. All three functions nest.random.normal(), nest.random.lognormal() and nest.random.exponential() behave as expected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Enhancement New functionality, model or documentation

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

Permit std=0 in nest.random.normal()

2 participants