-
Notifications
You must be signed in to change notification settings - Fork 322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/dem 805/implement sampling rate float parameter #1510
Feature/dem 805/implement sampling rate float parameter #1510
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1510 +/- ##
======================================
Coverage 73.8% 73.8%
======================================
Files 92 92
Lines 10446 10446
======================================
Hits 7710 7710
Misses 2736 2736 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo comments.
@astafan8 I addressed the your comments except the one with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am on a principal level against the behaviour introduced by the new parameter. I assume that the motivation for introducing a float/numeric sample rate parameter is that it is too cumbersome to write out, say, '1.80 GHz'. I sympathise with that viewpoint, and fully agree that passing 1.8e9
should work too.
What I strongly object to, however, is having parameters that silently fail when I set them. I consider setting a sample rate to 1.2e9
but actually getting one of 0.9e9
as a failure, since I am not getting what I am asking for. This is a fool-proof way to introduce very-hard-to-debug errors in measurement scripts, and against our normal policy. You'll have to work hard to convince me that this is a good idea ;)
There might be a need to handle floating-point imprecision, but that's a different story.
As a side note, the "nearest" frequency is not even well-defined. Why use a linear distance, when the allowed frequencies are evenly spaced on a logarithmic scale?
@WilliamHPNielsen I very well see your point and I'm not going to try and convince you. This behavior of setting the nearest point is how it works in the m4i driver, so there was a request for it in the uhfli driver as well.
? |
@qSaevar I think what you propose with sampling_rate = ZIUHFLI.round_to_nearest_sampling_frequency(desired_sampling_rate)
uhfli.scope_samplingrate_float(sampling_rate) is a nice and clean solution. Then the |
@WilliamHPNielsen I updated the PR so now the |
Looks terrific! |
Merge: 97c8c13 658091d Author: William H.P. Nielsen <[email protected]> Merge pull request #1510 from qutech-sd/feature/DEM-805/Implement-samepling_rate_float-parameter
Changes proposed in this pull request:
@WilliamHPNielsen @jenshnielsen @astafan8