-
Notifications
You must be signed in to change notification settings - Fork 31
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
Use integer math only, dropping use of long double sample rate #20
Open
ryanvolz
wants to merge
12
commits into
MITHaystack:master
Choose a base branch
from
ryanvolz:integer_math_only
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ryanvolz
changed the title
c, python: Use integer math to calculate file sample bounds.
Use integer math only, dropping use of long double sample rate
Sep 18, 2020
ryanvolz
force-pushed
the
integer_math_only
branch
2 times, most recently
from
February 12, 2021 23:03
3b3c113
to
16657f0
Compare
ryanvolz
force-pushed
the
integer_math_only
branch
from
August 19, 2022 20:01
16657f0
to
70bfef7
Compare
ryanvolz
force-pushed
the
integer_math_only
branch
3 times, most recently
from
December 13, 2023 14:46
4151ba4
to
5b83fad
Compare
ryanvolz
force-pushed
the
integer_math_only
branch
from
June 14, 2024 21:46
5b83fad
to
489bcaa
Compare
This does away with use of `np.longdouble`s for calculations with the sample rate in the Python library, which was used to get the list of files containing a given sample index range. See 90cdb49 for the commit that does the same thing in the C library. This commit also exposes two new functions to the C API: `digital_rf_get_timestamp_floor` and `digital_rf_get_sample_ceil`. These are now used to do the file sample bound calculations, and they are exposed so that users of the library can perform these calculations in a way that is consistent with what is done internally. These functions have also been exposed in the Python binding, and a test that verifies that the sample index round-trips through them is included in the Python testing suite. Because of the added C functions, the library version has been bumped to 2.7, which means the next release of Digital RF will be 2.7.0.
ryanvolz
force-pushed
the
integer_math_only
branch
from
June 14, 2024 21:51
489bcaa
to
3581eff
Compare
ryanvolz
force-pushed
the
integer_math_only
branch
from
June 14, 2024 22:34
3581eff
to
502b5ec
Compare
…nda-forge-pinning 2024.06.14.18.16.31
…nda-forge-pinning 2024.06.17.11.29.27
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does away with use of
long double
s for calculations with the sample rate. In the C library, this was used indigital_rf_get_subdir_file
to determine file names and sample bounds. Thenp.longdouble
sample rate was similarly used in the Python library to get the list of files containing a given sample index range.The reason for this change is that not all platforms support
long double
s with at least a 64-bit mantissa. This caused at least one bug on the aarch64 platform which resulted in incorrect file bounds fromdigital_rf_get_subdir_file
. By using integer math that is implemented uniformly on all platforms, any bugs in the calculation should be more noticeable.This commit also adds two new functions to the C API:
digital_rf_get_timestamp_floor
anddigital_rf_get_sample_ceil
. These are now used to do the file sample bound calculations, and they are exposed so that users of the library can perform these calculations in a way that is consistent with what is done internally. These functions have also been exposed in the Python binding, and a test that verifies that the sample index round-trips through them is included in the Python testing suite.Because of the added C functions, the library version has been bumped to 2.7, which means the next release of Digital RF will be 2.7.0.