Skip to content

replace typing hints in tests/ignite/metrics#3546

Merged
vfdev-5 merged 3 commits intopytorch:masterfrom
omkar-334:replace-test-metrics
Feb 22, 2026
Merged

replace typing hints in tests/ignite/metrics#3546
vfdev-5 merged 3 commits intopytorch:masterfrom
omkar-334:replace-test-metrics

Conversation

@omkar-334
Copy link
Copy Markdown
Contributor

Part of #3481

@vfdev-5 vfdev-5 requested a review from Copilot February 19, 2026 18:05
@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Feb 19, 2026

Originally, reviewing policy for the issue is to send one PR with one file changed. Here we have 20 files. I'll let copilot review it and let's see. Otherwise, we may need to split it...

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates typing annotations in Ignite metric tests to use modern Python (PEP 585/604) syntax as part of #3481’s typing-hints modernization effort.

Changes:

  • Replaces typing generics (Tuple, List, Dict, Optional, Union) with builtin generics (tuple, list, dict) and | None unions.
  • Removes now-unneeded typing imports and updates an isinstance(..., Tuple) check to tuple.
  • Adjusts several function/fixture signatures in tests to reflect the new annotation style.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/ignite/metrics/vision/test_object_detection_map.py Converts nested list/dict return/arg annotations to builtin generics.
tests/ignite/metrics/test_ssim.py Replaces Union[..., None] with `...
tests/ignite/metrics/test_precision_recall_curve.py Drops typing.Tuple import and uses tuple in isinstance check.
tests/ignite/metrics/test_mutual_information.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/test_metric.py Replaces Dict/List annotations with dict/list.
tests/ignite/metrics/test_maximum_mean_discrepancy.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/test_loss.py Replaces Tuple[...] with tuple[...] in a module forward signature.
tests/ignite/metrics/test_kl_divergence.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/test_js_divergence.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/test_hsic.py Replaces Tuple[...] with tuple[...] in fixture and test parameter typing.
tests/ignite/metrics/test_cosine_similarity.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/test_accuracy.py Replaces Union[str, torch.device] with `str
tests/ignite/metrics/regression/test_spearman_correlation.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/regression/test_pearson_correlation.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/regression/test_kendall_correlation.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/regression/test__base.py Replaces Optional[str] with `str
tests/ignite/metrics/gan/test_utils.py Replaces Optional[...]/Union[...] with `...
tests/ignite/metrics/clustering/test_silhouette_score.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/clustering/test_davies_bouldin_score.py Replaces Tuple[...] with tuple[...] in test parameter typing.
tests/ignite/metrics/clustering/test_calinski_harabasz_score.py Replaces Tuple[...] with tuple[...] in test parameter typing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@omkar-334
Copy link
Copy Markdown
Contributor Author

hey @vfdev-5 there seems to be some issue with the docs, all other tests are passing
Screenshot 2026-02-22 at 6 32 59 PM

@vfdev-5 vfdev-5 changed the title replace typing hins in tests/ignite/metrics replace typing hints in tests/ignite/metrics Feb 22, 2026
Copy link
Copy Markdown
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vfdev-5 vfdev-5 enabled auto-merge February 22, 2026 22:57
@vfdev-5 vfdev-5 added this pull request to the merge queue Feb 22, 2026
Merged via the queue into pytorch:master with commit f67abcd Feb 22, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants