Use Click to parse command-line arguments in randomstart.py#12
Open
nataliemes wants to merge 3 commits into
Open
Use Click to parse command-line arguments in randomstart.py#12nataliemes wants to merge 3 commits into
nataliemes wants to merge 3 commits into
Conversation
Member
|
Looks very nice. |
stengel
reviewed
Jun 5, 2026
| "--higherdim", | ||
| default=3, | ||
| show_default=True, | ||
| help="Number of components in the probability vector being sampled", |
Member
There was a problem hiding this comment.
change lines 90-91 to:
help="dimension [in 3..10] from which the middle 3 components will be sampled",
type=click.IntRange(3, 10),
metavar="INTEGER",
stengel
requested changes
Jun 5, 2026
Member
stengel
left a comment
There was a problem hiding this comment.
This is not the most recent file -
line 84 does not show MAX_ACCURACY and should have the following small amendments - see my email
help=f"Denominator N [in 1..{MAX_ACCURACY}]: each coordinate is rounded to the nearest multiple of 1/N",
type=click.IntRange(1, MAX_ACCURACY),
metavar="INTEGER",
This file contains hidden or 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
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 PR replaces manual command-line argument parsing with Click in
randomstart.py.Changes in detail
randomstartas a console script entry point, so it can be called directly from the terminal after installing the package (instead of callingpython randomstart.py).For example, both
randomstart --numpoints 500 --accuracy 10andrandomstart --accuracy 10 --numpoints 500are valid and mean the same thing.higherdimis outside the range [3, 10], instead of silently defaulting to 3.