-
Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: HighShould be handled nextShould be handled nextT: BugWrong statements in the code or documentationWrong statements in the code or documentation
Milestone
Description
Describe the bug
When initializing neuron or synapse properties with a random parameter appearing as a denominator, NEST assigns fixed values.
To Reproduce
- (Minimal) reproducing example
import nest
n = nest.Create('iaf_psc_alpha', 10, {'V_m': 1 / nest.random.uniform(0, 1)})
print(n.V_m)Expected behavior
Expected results: 10 different membrane potential values
Observed result: 10 identical membrane potential values
Desktop/Environment (please complete the following information):
- NEST-Version: nest master @ 8dd4b52
Additional context
We have traced the error to the implementation of __rtruediv__() here:
nest-simulator/pynest/nest/lib/hl_api_types.py
Lines 1086 to 1089 in 1ddea6b
| def __rtruediv__(self, lhs): | |
| rhs_inv = CreateParameter("constant", {"value": 1 / float(self.GetValue())}) | |
| return rhs_inv._binop("mul", lhs) | |
Metadata
Metadata
Assignees
Labels
I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)Previously written code will work as before, no one should note anything changing (aside the fix)S: HighShould be handled nextShould be handled nextT: BugWrong statements in the code or documentationWrong statements in the code or documentation
Type
Projects
Status
Done