diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-10 15:30:38 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-06-10 15:30:38 +0200 |
commit | fd2078f959092791209fca9c8732fbed28e0f589 (patch) | |
tree | 886ddc9505c47686b8603278414ecde8e16787e0 | |
parent | 26fb4b5b16538c3e6ff9251e0851daa33176a98e (diff) |
move filter-param to cli
-rwxr-xr-x | bin/analyze-archive.py | 8 | ||||
-rwxr-xr-x | bin/analyze-kconfig.py | 8 | ||||
-rw-r--r-- | lib/cli.py | 8 |
3 files changed, 16 insertions, 8 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 1766424..5996d08 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -445,14 +445,6 @@ if __name__ == "__main__": "Creates a JSON file for each state and transition.", ) parser.add_argument( - "--filter-param", - metavar="<parameter name>=<parameter value>[,<parameter name>=<parameter value>...]", - type=str, - help="Only consider measurements where <parameter name> is <parameter value>. " - "All other measurements (including those where it is None, that is, has not been set yet) are discarded. " - "Note that this may remove entire function calls from the model.", - ) - 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 c340901..0d7796a 100755 --- a/bin/analyze-kconfig.py +++ b/bin/analyze-kconfig.py @@ -181,6 +181,14 @@ def main(): # Release memory del observations + if args.filter_param: + args.filter_param = list( + map(lambda x: x.split("="), args.filter_param.split(",")) + ) + dfatool.utils.filter_aggregate_by_param( + by_name, parameter_names, args.filter_param + ) + if args.max_std: max_std = dict() if "=" in args.max_std: @@ -259,6 +259,14 @@ def add_standard_arguments(parser): type=str, help="Adjust parameter values before passing them to model generation", ) + parser.add_argument( + "--filter-param", + metavar="<parameter name>=<parameter value>[,<parameter name>=<parameter value>...]", + type=str, + help="Only consider measurements where <parameter name> is <parameter value>. " + "All other measurements (including those where it is None, that is, has not been set yet) are discarded. " + "Note that this may remove entire function calls from the model.", + ) def parse_param_shift(raw_param_shift): |