Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 13, 2024
1 parent dd8247f commit 9f88177
Show file tree
Hide file tree
Showing 43 changed files with 51 additions and 46 deletions.
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_c_si_snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
from torchmetrics.functional.audio import complex_scale_invariant_signal_noise_ratio

from unittests import BATCH_SIZE, NUM_BATCHES, _Input
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_pesq.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from torchmetrics.functional.audio import perceptual_evaluation_speech_quality

from unittests import _Input
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _average_metric_wrapper
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _average_metric_wrapper

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_pit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
)

from unittests import BATCH_SIZE, NUM_BATCHES, _Input
from unittests.audio import _average_metric_wrapper
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _average_metric_wrapper

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_11

from unittests import _Input
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _SAMPLE_NUMPY_ISSUE_895
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _SAMPLE_NUMPY_ISSUE_895

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_si_sdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from torchmetrics.functional.audio import scale_invariant_signal_distortion_ratio

from unittests import BATCH_SIZE, NUM_BATCHES, _Input
from unittests.audio import _average_metric_wrapper
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _average_metric_wrapper

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_snr.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
from torchmetrics.functional.audio import signal_noise_ratio

from unittests import _Input
from unittests.audio import _average_metric_wrapper
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _average_metric_wrapper

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/audio/test_stoi.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from torchmetrics.functional.audio import short_time_objective_intelligibility

from unittests import _Input
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _average_metric_wrapper
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.audio import _SAMPLE_AUDIO_SPEECH, _SAMPLE_AUDIO_SPEECH_BAB_DB, _average_metric_wrapper

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _input_binary, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _input_binary, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_auroc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_calibration_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_13

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_cohen_kappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/classification/test_dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from torchmetrics.utilities.checks import _input_format_classification
from torchmetrics.utilities.enums import DataType

from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.classification._inputs import _input_binary, _input_binary_logits, _input_binary_prob
from unittests.classification._inputs import _input_multiclass as _input_mcls
from unittests.classification._inputs import _input_multiclass_logits as _input_mcls_logits
Expand All @@ -33,8 +35,6 @@
from unittests.classification._inputs import _input_multilabel_multidim as _input_mlmd
from unittests.classification._inputs import _input_multilabel_multidim_prob as _input_mlmd_prob
from unittests.classification._inputs import _input_multilabel_prob as _input_mlb_prob
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_exact_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index
from unittests.classification._inputs import _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_f_beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_group_fairness.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from torchmetrics.functional.classification.group_fairness import binary_fairness

from unittests import THRESHOLD
from unittests.classification._inputs import _group_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import (
MetricTester,
Expand All @@ -39,6 +38,7 @@
from unittests._helpers.testers import _assert_allclose as _core_assert_allclose
from unittests._helpers.testers import _assert_requires_grad as _core_assert_requires_grad
from unittests._helpers.testers import _assert_tensor as _core_assert_tensor
from unittests.classification._inputs import _group_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_hamming_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_hinge.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases

torch.manual_seed(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_jaccard.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases


def _reference_sklearn_jaccard_index_binary(preds, target, ignore_index=None):
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_matthews_corrcoef.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_precision_recall.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_ranking.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
)

from unittests import NUM_CLASSES
from unittests.classification._inputs import _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index
from unittests.classification._inputs import _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_roc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
from torchmetrics.utilities.imports import _TORCH_GREATER_EQUAL_1_11

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_specificity.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/classification/test_stat_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from torchmetrics.metric import Metric

from unittests import NUM_CLASSES, THRESHOLD
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester, inject_ignore_index, remove_ignore_index
from unittests.classification._inputs import _binary_cases, _multiclass_cases, _multilabel_cases

seed_all(42)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
from torchmetrics.functional.clustering.adjusted_mutual_info_score import adjusted_mutual_info_score

from unittests import BATCH_SIZE, NUM_CLASSES
from unittests.clustering._inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.clustering._inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/clustering/test_adjusted_rand_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
from torchmetrics.clustering.adjusted_rand_score import AdjustedRandScore
from torchmetrics.functional.clustering.adjusted_rand_score import adjusted_rand_score

from unittests.clustering._inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2
from unittests._helpers.testers import MetricTester
from unittests.clustering._inputs import _float_inputs_extrinsic, _single_target_extrinsic1, _single_target_extrinsic2


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/clustering/test_calinski_harabasz_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from torchmetrics.clustering.calinski_harabasz_score import CalinskiHarabaszScore
from torchmetrics.functional.clustering.calinski_harabasz_score import calinski_harabasz_score

from unittests.clustering._inputs import _single_target_intrinsic1, _single_target_intrinsic2
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.clustering._inputs import _single_target_intrinsic1, _single_target_intrinsic2

seed_all(42)

Expand Down
2 changes: 1 addition & 1 deletion tests/unittests/clustering/test_davies_bouldin_score.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from torchmetrics.clustering.davies_bouldin_score import DaviesBouldinScore
from torchmetrics.functional.clustering.davies_bouldin_score import davies_bouldin_score

from unittests.clustering._inputs import _single_target_intrinsic1, _single_target_intrinsic2
from unittests._helpers import seed_all
from unittests._helpers.testers import MetricTester
from unittests.clustering._inputs import _single_target_intrinsic1, _single_target_intrinsic2

seed_all(42)

Expand Down
Loading

0 comments on commit 9f88177

Please sign in to comment.