Skip to content

Commit 05f1b66

Browse files
author
pfinashx
committed
Fixed linters
1 parent e3b8e9e commit 05f1b66

File tree

3 files changed

+213
-214
lines changed

3 files changed

+213
-214
lines changed

external/anomaly/tests/conftest.py

+26-12
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,62 @@
1212
# See the License for the specific language governing permissions
1313
# and limitations under the License.
1414

15-
from ote_sdk.test_suite.pytest_insertions import *
15+
import pytest
16+
from ote_sdk.test_suite.pytest_insertions import (
17+
get_pytest_plugins_from_ote,
18+
ote_conftest_insertion,
19+
ote_pytest_generate_tests_insertion,
20+
ote_pytest_addoption_insertion,
21+
)
1622
from ote_sdk.test_suite.training_tests_common import REALLIFE_USECASE_CONSTANT
1723

1824
pytest_plugins = get_pytest_plugins_from_ote()
1925

20-
ote_conftest_insertion(default_repository_name='ote/training_extensions/external/anomaly')
26+
ote_conftest_insertion(default_repository_name="ote/training_extensions/external/anomaly")
27+
2128

2229
@pytest.fixture
2330
def ote_test_domain_fx():
24-
return 'custom-anomaly-classification'
31+
return "custom-anomaly-classification"
32+
2533

2634
@pytest.fixture
2735
def ote_test_scenario_fx(current_test_parameters_fx):
2836
assert isinstance(current_test_parameters_fx, dict)
29-
if current_test_parameters_fx.get('usecase') == REALLIFE_USECASE_CONSTANT:
30-
return 'performance'
37+
if current_test_parameters_fx.get("usecase") == REALLIFE_USECASE_CONSTANT:
38+
return "performance"
3139
else:
32-
return 'integration'
40+
return "integration"
3341

34-
@pytest.fixture(scope='session')
42+
43+
@pytest.fixture(scope="session")
3544
def ote_templates_root_dir_fx():
3645
import os.path as osp
3746
import logging
47+
3848
logger = logging.getLogger(__name__)
3949
root = osp.dirname(osp.dirname(osp.realpath(__file__)))
40-
root = f'{root}/anomaly_classification/'
41-
logger.debug(f'overloaded ote_templates_root_dir_fx: return {root}')
50+
root = f"{root}/anomaly_classification/"
51+
logger.debug(f"overloaded ote_templates_root_dir_fx: return {root}")
4252
return root
4353

44-
@pytest.fixture(scope='session')
54+
55+
@pytest.fixture(scope="session")
4556
def ote_reference_root_dir_fx():
4657
import os.path as osp
4758
import logging
59+
4860
logger = logging.getLogger(__name__)
4961
root = osp.dirname(osp.dirname(osp.realpath(__file__)))
50-
root = f'{root}/tests/reference/'
51-
logger.debug(f'overloaded ote_reference_root_dir_fx: return {root}')
62+
root = f"{root}/tests/reference/"
63+
logger.debug(f"overloaded ote_reference_root_dir_fx: return {root}")
5264
return root
5365

66+
5467
# pytest magic
5568
def pytest_generate_tests(metafunc):
5669
ote_pytest_generate_tests_insertion(metafunc)
5770

71+
5872
def pytest_addoption(parser):
5973
ote_pytest_addoption_insertion(parser)
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
1-
'ACTION-training_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
2-
'metrics.accuracy.f-measure':
3-
'target_value': 0.73
4-
'max_diff_if_less_threshold': 0.01
5-
'max_diff_if_greater_threshold': 0.04
6-
'ACTION-export_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
7-
'metrics.accuracy.f-measure':
8-
'base': 'training_evaluation.metrics.accuracy.f-measure'
9-
'max_diff': 0.01
10-
'ACTION-pot_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
11-
'metrics.accuracy.f-measure':
12-
'base': 'export_evaluation.metrics.accuracy.f-measure'
13-
'max_diff': 0.03
14-
'ACTION-nncf_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
15-
'metrics.accuracy.f-measure':
16-
'base': 'training_evaluation.metrics.accuracy.f-measure'
17-
'max_diff_if_less_threshold': 0.01
18-
'ACTION-nncf_export_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
19-
'metrics.accuracy.f-measure':
20-
'base': 'nncf_evaluation.metrics.accuracy.f-measure'
21-
'max_diff': 0.01
1+
? "ACTION-training_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
2+
: "metrics.accuracy.f-measure":
3+
"target_value": 0.73
4+
"max_diff_if_less_threshold": 0.01
5+
"max_diff_if_greater_threshold": 0.04
6+
? "ACTION-export_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
7+
: "metrics.accuracy.f-measure":
8+
"base": "training_evaluation.metrics.accuracy.f-measure"
9+
"max_diff": 0.01
10+
? "ACTION-pot_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
11+
: "metrics.accuracy.f-measure":
12+
"base": "export_evaluation.metrics.accuracy.f-measure"
13+
"max_diff": 0.03
14+
? "ACTION-nncf_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
15+
: "metrics.accuracy.f-measure":
16+
"base": "training_evaluation.metrics.accuracy.f-measure"
17+
"max_diff_if_less_threshold": 0.01
18+
? "ACTION-nncf_export_evaluation,model-ote_anomaly_classification_padim,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
19+
: "metrics.accuracy.f-measure":
20+
"base": "nncf_evaluation.metrics.accuracy.f-measure"
21+
"max_diff": 0.01
2222

23-
'ACTION-training_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
24-
'metrics.accuracy.f-measure':
25-
'target_value': 0.74
26-
'max_diff_if_less_threshold': 0.01
27-
'max_diff_if_greater_threshold': 0.04
28-
'ACTION-export_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
29-
'metrics.accuracy.f-measure':
30-
'base': 'training_evaluation.metrics.accuracy.f-measure'
31-
'max_diff': 0.01
32-
'ACTION-pot_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
33-
'metrics.accuracy.f-measure':
34-
'base': 'export_evaluation.metrics.accuracy.f-measure'
35-
'max_diff': 0.03
36-
'ACTION-nncf_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
37-
'metrics.accuracy.f-measure':
38-
'base': 'training_evaluation.metrics.accuracy.f-measure'
39-
'max_diff_if_less_threshold': 0.01
40-
'ACTION-nncf_export_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife':
41-
'metrics.accuracy.f-measure':
42-
'base': 'nncf_evaluation.metrics.accuracy.f-measure'
43-
'max_diff': 0.01
23+
? "ACTION-training_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
24+
: "metrics.accuracy.f-measure":
25+
"target_value": 0.74
26+
"max_diff_if_less_threshold": 0.01
27+
"max_diff_if_greater_threshold": 0.04
28+
? "ACTION-export_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
29+
: "metrics.accuracy.f-measure":
30+
"base": "training_evaluation.metrics.accuracy.f-measure"
31+
"max_diff": 0.01
32+
? "ACTION-pot_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
33+
: "metrics.accuracy.f-measure":
34+
"base": "export_evaluation.metrics.accuracy.f-measure"
35+
"max_diff": 0.03
36+
? "ACTION-nncf_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
37+
: "metrics.accuracy.f-measure":
38+
"base": "training_evaluation.metrics.accuracy.f-measure"
39+
"max_diff_if_less_threshold": 0.01
40+
? "ACTION-nncf_export_evaluation,model-ote_anomaly_classification_stfpm,dataset-mvtec,patience-CONFIG,batch-CONFIG,usecase-reallife"
41+
: "metrics.accuracy.f-measure":
42+
"base": "nncf_evaluation.metrics.accuracy.f-measure"
43+
"max_diff": 0.01

0 commit comments

Comments
 (0)