mirror of
https://github.com/IBM/ai-privacy-toolkit.git
synced 2026-04-24 20:36:21 +02:00
Change back flake8 warnings to errors. Fix tests not to fail it. (#76)
Signed-off-by: Maya Anderson <mayaa@il.ibm.com>
This commit is contained in:
parent
f2f8ddc877
commit
3885ab9d9d
6 changed files with 14 additions and 11 deletions
2
.github/workflows/python-package.yml
vendored
2
.github/workflows/python-package.yml
vendored
|
|
@ -34,7 +34,7 @@ jobs:
|
|||
# stop the build if there are Python syntax errors
|
||||
flake8 . --count --select=E9,F63,F7 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
|
||||
- name: Test with pytest
|
||||
run: |
|
||||
pytest
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -78,9 +78,9 @@ class DatasetAssessmentManager:
|
|||
if self.config.persist_reports:
|
||||
results_log_file = "_results.log.csv"
|
||||
self._dump_scores_to_file(self.attack_scores_per_record_knn_probabilities,
|
||||
"per_record_knn_probabilities" + results_log_file, True)
|
||||
"per_record_knn_probabilities" + results_log_file, True)
|
||||
self._dump_scores_to_file(self.attack_scores_whole_dataset_knn_distance,
|
||||
"whole_dataset_knn_distance" + results_log_file, True)
|
||||
"whole_dataset_knn_distance" + results_log_file, True)
|
||||
|
||||
@staticmethod
|
||||
def _dump_scores_to_file(attack_scores: list[DatasetAttackScore], filename: str, header: bool):
|
||||
|
|
|
|||
|
|
@ -25,4 +25,8 @@ exclude =
|
|||
|
||||
[flake8]
|
||||
ignore = C901,W503
|
||||
per-file-ignores = __init__.py:F401
|
||||
per-file-ignores = __init__.py:F401
|
||||
builtins = keras,xgboost
|
||||
exclude =
|
||||
venv
|
||||
venv1
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ def teardown_function():
|
|||
|
||||
|
||||
anon_testdata = [('iris_np', iris_dataset_np, 'np', k, mgr) for k in range(2, 10, 4)] \
|
||||
+ [('diabetes_np', diabetes_dataset_np, 'np', k, mgr) for k in range(2, 10, 4)] \
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', k, mgr) for k in range(2, 10, 4)] \
|
||||
+ [('adult_pd', adult_dataset_pd, 'pd', k, mgr) for k in range(2, 10, 4)]
|
||||
+ [('diabetes_np', diabetes_dataset_np, 'np', k, mgr) for k in range(2, 10, 4)] \
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', k, mgr) for k in range(2, 10, 4)] \
|
||||
+ [('adult_pd', adult_dataset_pd, 'pd', k, mgr) for k in range(2, 10, 4)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, data, dataset_type, k, mgr", anon_testdata)
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ def teardown_function():
|
|||
|
||||
|
||||
anon_testdata = [('iris_np', iris_dataset_np, 'np', mgr1)] \
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', mgr2)] \
|
||||
+ [('iris_np', iris_dataset_np, 'np', mgr3)] \
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', mgr4)]
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', mgr2)] \
|
||||
+ [('iris_np', iris_dataset_np, 'np', mgr3)] \
|
||||
+ [('nursery_pd', nursery_dataset_pd, 'pd', mgr4)]
|
||||
|
||||
|
||||
@pytest.mark.parametrize("name, data, dataset_type, mgr", anon_testdata)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue