summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/analyze-archive.py19
-rwxr-xr-xbin/analyze-kconfig.py18
-rw-r--r--lib/cli.py27
3 files changed, 24 insertions, 40 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py
index f1b9f71..b29091d 100755
--- a/bin/analyze-archive.py
+++ b/bin/analyze-archive.py
@@ -362,6 +362,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter, description=__doc__
)
+ dfatool.cli.add_standard_arguments(parser)
parser.add_argument(
"--info",
action="store_true",
@@ -449,12 +450,6 @@ if __name__ == "__main__":
"Creates a JSON file for each state and transition.",
)
parser.add_argument(
- "--export-dref",
- metavar="FILE",
- type=str,
- help="Export model and model quality to LaTeX dataref file",
- )
- parser.add_argument(
"--filter-param",
metavar="<parameter name>=<parameter value>[,<parameter name>=<parameter value>...]",
type=str,
@@ -470,18 +465,6 @@ if __name__ == "__main__":
help="Set log level",
)
parser.add_argument(
- "--cross-validate",
- metavar="<method>:<count>",
- type=str,
- help="Perform cross validation when computing model quality. "
- "Only works with --show-quality=table at the moment.",
- )
- parser.add_argument(
- "--parameter-aware-cross-validation",
- action="store_true",
- help="Perform parameter-aware cross-validation: ensure that parameter values (and not just observations) are mutually exclusive between training and validation sets.",
- )
- parser.add_argument(
"--with-safe-functions",
action="store_true",
help="Include 'safe' functions (safe_log, safe_inv, safe_sqrt) which are also defined for 0 and -1. "
diff --git a/bin/analyze-kconfig.py b/bin/analyze-kconfig.py
index d4b87c6..bd9cccb 100755
--- a/bin/analyze-kconfig.py
+++ b/bin/analyze-kconfig.py
@@ -27,6 +27,7 @@ def main():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter, description=__doc__
)
+ dfatool.cli.add_standard_arguments(parser)
parser.add_argument(
"--show-failing-symbols",
action="store_true",
@@ -66,12 +67,6 @@ def main():
metavar="FILE",
)
parser.add_argument(
- "--export-dref",
- type=str,
- help="Export model and model quality to LaTeX dataref file",
- metavar="FILE",
- )
- parser.add_argument(
"--config",
type=str,
help="Show model results for symbols in .config file",
@@ -93,17 +88,6 @@ def main():
metavar="N",
)
parser.add_argument(
- "--cross-validate",
- type=str,
- help="Report modul accuracy via Cross-Validation",
- metavar="METHOD:COUNT",
- )
- parser.add_argument(
- "--parameter-aware-cross-validation",
- action="store_true",
- help="Perform parameter-aware cross-validation: ensure that parameter values (and not just observations) are mutually exclusive between training and validation sets.",
- )
- parser.add_argument(
"--show-model",
choices=["static", "paramdetection", "param", "all", "tex", "html"],
action="append",
diff --git a/lib/cli.py b/lib/cli.py
index bb1b111..a1e4a58 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -1,10 +1,6 @@
#!/usr/bin/env python3
-from dfatool.functions import (
- SplitFunction,
- AnalyticFunction,
- StaticFunction,
-)
+from dfatool.functions import SplitFunction, AnalyticFunction, StaticFunction
def print_static(model, static_model, name, attribute):
@@ -98,3 +94,24 @@ def model_quality_table(header, result_lists, info_list):
else:
buf += "{:7}----{:8}".format("", "")
print(buf)
+
+
+def add_standard_arguments(parser):
+ parser.add_argument(
+ "--export-dref",
+ metavar="FILE",
+ type=str,
+ help="Export model and model quality to LaTeX dataref file",
+ )
+ parser.add_argument(
+ "--cross-validate",
+ metavar="<method>:<count>",
+ type=str,
+ help="Perform cross validation when computing model quality. "
+ "Only works with --show-quality=table at the moment.",
+ )
+ parser.add_argument(
+ "--parameter-aware-cross-validation",
+ action="store_true",
+ help="Perform parameter-aware cross-validation: ensure that parameter values (and not just observations) are mutually exclusive between training and validation sets.",
+ )