Add a strict `--fail-on-no-value` option to the compute epsilon script (#22)
* Add no fail option to dp script * Rename command line arguments Co-authored-by: Lukas Wutschitz <lukas.wutschitz@microsoft.com>
This commit is contained in:
Родитель
77783cae78
Коммит
231e3f2b31
|
@ -29,4 +29,4 @@ jobs:
|
|||
python -m pip install .
|
||||
- name: Run command line scripts
|
||||
run: |
|
||||
compute-dp-epsilon --sampling-probability 5e-3 --noise-multiplier 0.8 --delta 1e-6 --num-compositions 1000
|
||||
compute-dp-epsilon --sampling-probability 5e-3 --noise-multiplier 0.8 --delta 1e-6 --num-compositions 1000 --fail-on-no-value
|
||||
|
|
|
@ -40,6 +40,10 @@ def arg_parser() -> argparse.ArgumentParser:
|
|||
"-v", "--verbose", action="store_true", default=None,
|
||||
help="Increase verbosity"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--fail-on-no-value", action="store_true", default=None,
|
||||
help="Require all accountants to return a value"
|
||||
)
|
||||
return parser
|
||||
|
||||
|
||||
|
@ -83,6 +87,8 @@ def main() -> int:
|
|||
eps_lower, eps_est, eps_upper = compute_eps(args.num_compositions)
|
||||
print(f"{name}:\t\teps_lower = {eps_lower:6.3} eps_estimate = {eps_est:6.3}, eps_upper = {eps_upper:6.3} ")
|
||||
except Exception as e:
|
||||
if args.fail_on_no_value:
|
||||
raise e
|
||||
print(f"{name}:\t\tn/a")
|
||||
return 0
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче