Recent Releases of r-argparse
r-argparse - argparse v2.2.5
- Tweaks the
parse_known_intermixed_args()tests so they work with the development version of Python.
- R
Published by trevorld over 1 year ago
r-argparse - argparse v2.2.4
ArgumentParser()'spython_cmdargument is now wrapped bynormalizePath(mustWork = FALSE).
- R
Published by trevorld over 1 year ago
r-argparse - argparse v2.2.3
Character values are now passed as "raw" strings to Python (#51).
- In particular this avoids triggering an error in Python 3.12
when creating a string with escapes not supported by
Python e.g.
default = "\\D"will continue to return a default value of"\\D"instead of triggering an error. - However, this also means that any Python accepted escape sequences will no longer be interpreted as an escape sequence. If relying on such behaviour you may need to instead use the appropriate R escape sequences or Unicode values instead of Python escape sequences:
- E.g.
default = "\\t"will now return a default value of"\\t"(atpreceded by an (escaped) backslash) instead of"\t"(a horizontal tab). - https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences
- https://en.wikipedia.org/wiki/BasicLatin(Unicode_block)
- Thanks Matthew Hall (@mdhall272) for bug report.
- In particular this avoids triggering an error in Python 3.12
when creating a string with escapes not supported by
Python e.g.
- R
Published by trevorld about 2 years ago
r-argparse - argparse v2.2.2
- Fixes bug when
add_argument()helpvalues ended in a"(#46). Thanks Oliver Dreschel (@oliverdreschel) for bug report.
- R
Published by trevorld over 3 years ago
r-argparse - argparse v2.2.1
We now support the following
ArgumentParser()methods:format_help()format_usage()parse_intermixed_args()(#45)parse_known_intermixed_args()(#45)set_defaults()(#43). Suggestion of @oliverbothe.
When an error is thrown by
ArgumentParser()$parse_args()andinteractive()isFALSEandgetOption("error")isNULLthen we now use a quieter default error handler that doesn't output a trailing "Execution halted".add_argument()now allows "numeric" as an alias for "double" for thetypeargument (#42). Suggestion of @dariober.ArgumentParser()now handlesdescriptionarguments with newlines in them (#44). Thanks Arthur Gilly (@agilly) for bug report.
- R
Published by trevorld over 3 years ago
r-argparse - argparse v2.1.6
- The errors raised by
ArgumentParser()$parse_args()are now of class "argparseparseerror".
They are now less verbose when interactive() is FALSE (#40).
There may still be a trailing "Execution halted" line output by R's default error handler
(when interactive() is FALSE).
This can be silenced by setting a new error handler near the top of your Rscript e.g.
r
if (!interactive())
options(error=function(e) quit('no', status = 1, runLast = FALSE))
- R
Published by trevorld almost 4 years ago
r-argparse - argparse v2.1.5
add_argumentnow usesas.logical()logic to cast variables to logical values iftype = "logical"andaction = "store"oraction = "append"instead of using Python'sbool()logic (#39).- We throw an error if we would get an NA by coercion.
- We no longer throw a warning when using
type = "logical"andaction = "store"suggesting users instead useaction = "store_true"oraction = "store_false".
- R
Published by trevorld about 4 years ago
r-argparse - argparse v2.1.3
- Prevents extraneous error message from being included in usage message when using Python 3.10 (#36). Thanks @dariober for bug report.
- R
Published by trevorld over 4 years ago
r-argparse - argparse v2.1.2
- Fixes bug when using an argument with
action == "append"and a non-NULLdefaultvalue (#35). Thanks @miker985 for bug report.
- R
Published by trevorld over 4 years ago
r-argparse - argparse v2.1.1
- Parsers now support
parse_known_args()(#34). Suggestion of David Lacalle Castillo (@WaterKnight1998).
- R
Published by trevorld almost 5 years ago
r-argparse - argparse v2.0.4
- May now specify a named
formatter_classargument (as a string) to asubparsers$add_parser()method. Thanks Regina (@oyxf) for bug report. - May now specify positional arguments in
ArgumentParser().
- R
Published by trevorld almost 5 years ago
r-argparse - argparse v2.0.3
- Fixes bug when accidentally passing a positional argument
to
ArgumentParser()when using Python 3.9. Thanks Kurt Hornik for bug report.
- R
Published by trevorld over 5 years ago
r-argparse - v2.0.1
argparse 2.0.1
- Improved passing of arguments to Python from R.
In particular should fix bug in using
add_helpargument inArgumentParser. Thanks George Chlipala for bug report. - Removes
getoptas a dependency.
- R
Published by trevorld over 7 years ago
r-argparse -
- Now uses
R6classes instead ofprotoclasses (#25).
The typical user shouldn't need to change anyargparsecode but I did make private the previously publicpython_codeelement of the object returned byArgumentParser(). - Parsers now support
add_subparsers(#14). Suggestion of Zebulun Arendsee. - Parsers now support
add_argument_group(#26).
Suggestion of Dario Beraldi. - Parsers now support
add_mutually_exclusive_group(#23).
Suggestion of Vince Reuter.
- R
Published by trevorld over 7 years ago
r-argparse -
- Better support for machines only running Python 2.7.
- DESCRIPTION makes explicit that it requires version 1.0.0 of
protodependency. Thanks Christophe Poulet for bug report.
- R
Published by trevorld over 8 years ago