Added dist data, generation script, and CI
#1
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.
Types of changes
Description
Implemented
dist/generate.pyscript to generate data for testing distributions.All formulas for generating distributions implemented in the library were implemented in a simplified form.
aandbare global constants. The results of all functions are calculated without taking into account the values ofaandb. This is made for simplicity. Instead of changing the values ofaandb,mapping_intervals(see below) are added.The calculations rely on the
mpmathlibrary and are performed with a precision of 100 significant digits. However, the numbers are rounded to 17 significant digits before being output. This ensures the highest possible precision (actually higher thandoubleprecision).It is not expected that the library data will match the test data exactly, as the library provides ideal results. The library should match with a precision up to a certain significant digit (the exact precision will be determined later).
The script allows the output file name to be specified using the
-o(--output) flag. If no output file is specified, the script’s output will be directed to the standard output stream.Created
dist/dist.tomlas output of the script.The
dist/dist.tomlfile has been carefully constructed step-by-step based on the output from thedist/generate.pyscript. At each stage, it was verified that the old values remained unchanged. The calculations foruniformandchebyshevwere initially done manually using wolframalpha.com.At the beginning of the file, intervals labeled
mapping_intervalswere added, within which each test case will undergo additional testing. The expected values specified in the file are linearly mapped to each interval, and the library generates new values for each interval.Since the library first generates points on intervals like (-1, 1) or (0, 1) when creating distributions, the loss of precision during the linear mapping should be approximately the same for both generated and test data.
Added
verify_data.pyscript to verify the generated data against the saved data.To verify the generated data, a temporary file is used, which is deleted after the verification process.
Added
.github/workflows/ci.ymlto verify the data during the CI build process.To maintain the integrity of the repository, a CI script has been created to verify the test data with every change to the main branch.