Skip to content

Refactor type hints in tensorboard_logger.py for python 3.10#3492

Merged
vfdev-5 merged 4 commits intopytorch:masterfrom
gabrielfruet:refactor/3481-py310-typehints-tblogger
Jan 19, 2026
Merged

Refactor type hints in tensorboard_logger.py for python 3.10#3492
vfdev-5 merged 4 commits intopytorch:masterfrom
gabrielfruet:refactor/3481-py310-typehints-tblogger

Conversation

@gabrielfruet
Copy link
Copy Markdown
Contributor

@gabrielfruet gabrielfruet commented Jan 16, 2026

Related to #3481

Using correct type hints for Optional and Union on python 3.10, since py39 is EOL.

@github-actions github-actions bot added the module: handlers Core Handlers module label Jan 16, 2026
@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jan 16, 2026

Thanks for the PR @gabrielfruet, looks good, there is a one more update to apply and it's good to go

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jan 19, 2026

@maifeeulasad can you please fix the pyrefly issue in a separate PR:

 INFO Checking project configured at `/home/runner/work/ignite/ignite/pyrefly.toml`
ERROR Argument `str | None` is not assignable to parameter `weights` with type `Literal['linear', 'quadratic'] | None` in function `sklearn.metrics._classification.cohen_kappa_score` [bad-argument-type]
  --> ignite/metrics/cohen_kappa.py:87:58
   |
87 |         return cohen_kappa_score(y_true, y_pred, weights=self.weights)
   |                                                          ^^^^^^^^^^^^
   |
Error: Argument `str | None` is not assignable to parameter `weights` with type `Literal['linear', 'quadratic'] | None` in function `sklearn.metrics._classification.cohen_kappa_score`

Thanks!

Once fixed we can merge this PR.

@maifeeulasad
Copy link
Copy Markdown
Contributor

@vfdev-5 I would love to do so. Give me like a week. Does this work??

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jan 19, 2026

@vfdev-5 I would love to do so. Give me like a week. Does this work??

well, a week is a bit too late. No worries, I'll tackle it myself with GH copilot

@maifeeulasad
Copy link
Copy Markdown
Contributor

@vfdev-5 if two days work for you, I would still love to work on this.

@vfdev-5
Copy link
Copy Markdown
Collaborator

vfdev-5 commented Jan 19, 2026

It's almost done by gh copilot. However, you can help with #3481

@maifeeulasad
Copy link
Copy Markdown
Contributor

Definitely. Happy to help!

If you have some other tasks, please let me know.

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.

LGTM, thanks @gabrielfruet

@pytorch pytorch deleted a comment from maifeeulasad Jan 19, 2026
@vfdev-5 vfdev-5 enabled auto-merge January 19, 2026 11:19
@vfdev-5 vfdev-5 added this pull request to the merge queue Jan 19, 2026
Merged via the queue into pytorch:master with commit 7619380 Jan 19, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: handlers Core Handlers module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants