Skip to content

Conversation

@heplesser
Copy link
Contributor

It was always intended that multimeter/voltmeter should only accept recording intervals that were multiples of the resolution. Due to an implementation error, this did not happen and multimeter silently rounded to the nearest step. This PR ensures expected behavior and makes this explicit in the documentation. See also #3634.

@heplesser heplesser added T: Bug Wrong statements in the code or documentation S: Normal Handle this with default priority labels Nov 18, 2025
@heplesser heplesser added this to Models Nov 18, 2025
@heplesser heplesser added I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) good first issue Good for newcomers labels Nov 18, 2025
@github-project-automation github-project-automation bot moved this to To do in Models Nov 18, 2025
@clinssen
Copy link
Contributor

Thanks for the PR! It looks good and a special thumbs up for the updated example in the docs. As another sanity check, I tried to set the interval to larger and larger numbers and it only broke when I got to nest.Create("multimeter", params={"interval": 123456789012345.}), so the current solution seems robust with respect to floating point representation issues until way past any reasonable value. However, I notice that an interval of 0.1001 silently gets rounded to 0.1. Is this expected behaviour?

@heplesser
Copy link
Contributor Author

Thanks for the PR! It looks good and a special thumbs up for the updated example in the docs. As another sanity check, I tried to set the interval to larger and larger numbers and it only broke when I got to nest.Create("multimeter", params={"interval": 123456789012345.}), so the current solution seems robust with respect to floating point representation issues until way past any reasonable value. However, I notice that an interval of 0.1001 silently gets rounded to 0.1. Is this expected behaviour?

Thanks for checking the boundaries. With the upper limit, we are close to 4000 years if my calculations are right, that should suffice :). Concerning the silent rounding of 0.1001 to 0.1, this is a feature: To handle the numerical limitations of floating point numbers, NEST internally represents time in tics, which by default are 1µs. Any time passed as a floating point number will be rounded to the nearest tic and evaluation of whether it corresponds to a time step is then done in integer arithmetic based on the tics.

@heplesser heplesser requested a review from clinssen November 22, 2025 05:46
@clinssen
Copy link
Contributor

Thanks for the explanation, all signals green then from my side!

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

Labels

good first issue Good for newcomers 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: Bug Wrong statements in the code or documentation

Projects

Status: To do

Development

Successfully merging this pull request may close these issues.

2 participants