Allow vose_sampler to be consumable as a library #4
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.
Requesting a pull to asmith26:master from hoganbc:library to address #3
Changes
324d084 (hoganbc, 3 hours ago)
Move sys.exit calls to script logic
This will prevent unintended exits when the code is consumed as a library.
The functionality is preserved for script users.
Tests were updated to check for the exception type.
Additional change includes closing the
bin_file
when an Exception is-thrown. There were warnings in the test output about this.
3d64a58 (hoganbc, 3 hours ago)
Move print statements and sample_n returns results
These two changes allow this project to be consumed as a library. The print
statements are moved to
main()
. There is no functional change for scriptusers.
Testing
Versions
Test results: passed
With Python 2.7
With Python3.7
Script output: same
Before
After