Skip to content

Replace typing module hints with modern syntax in metrics (mAP, precision_recall_curve, multilabel, matthews)#3605

Closed
Manimaran-tech wants to merge 7 commits intopytorch:masterfrom
Manimaran-tech:fix/typing-metrics-specialized
Closed

Replace typing module hints with modern syntax in metrics (mAP, precision_recall_curve, multilabel, matthews)#3605
Manimaran-tech wants to merge 7 commits intopytorch:masterfrom
Manimaran-tech:fix/typing-metrics-specialized

Conversation

@Manimaran-tech
Copy link
Copy Markdown
Contributor

Description

Modernize type hints in specialized ignite/metrics files by replacing typing module imports with Python 3.10+ built-in syntax.

Files changed:

  • ignite/metrics/mean_average_precision.py
  • ignite/metrics/precision_recall_curve.py
  • ignite/metrics/multilabel_confusion_matrix.py
  • ignite/metrics/matthews_corrcoef.py

Related to #3591

@github-actions github-actions Bot added the module: metrics Metrics module label Feb 26, 2026
@Manimaran-tech
Copy link
Copy Markdown
Contributor Author

Manimaran-tech commented Feb 26, 2026

@vfdev-5 i have done the changes across all the pr's as u mentioned , if i failed any so kindly tell me
thank you

Copy link
Copy Markdown
Contributor Author

@Manimaran-tech Manimaran-tech left a comment

Choose a reason for hiding this comment

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

done

rec_thresholds: Optional[Union[Sequence[float], torch.Tensor]] = None,
class_mean: Optional["Literal['micro', 'macro', 'weighted']"] = "macro",
rec_thresholds: Sequence[float] | torch.Tensor | None = None,
class_mean: "Literal['micro', 'macro', 'weighted']" | None = "macro",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
class_mean: "Literal['micro', 'macro', 'weighted']" | None = "macro",
class_mean: Literal['micro', 'macro', 'weighted'] | None = "macro",

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Mar 3, 2026

This PR will be merged after #3540 due to potential conflict in ignite/metrics/mean_average_precision.py. We can either wait or remove mAP file from the PR and apply requested changes to remaining files.

@vfdev-5 vfdev-5 closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: metrics Metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants