Skip to content

Add missing type stubs for newer visualization methods - #1418

Merged
mariobehling merged 7 commits into
fossasia:devfrom
Debajeet-1411:update-type-stubs
Jul 8, 2026
Merged

Add missing type stubs for newer visualization methods#1418
mariobehling merged 7 commits into
fossasia:devfrom
Debajeet-1411:update-type-stubs

Conversation

@Debajeet-1411

@Debajeet-1411 Debajeet-1411 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds missing declarations to py/visdom/__init__.pyi for public methods already implemented in the Visdom class:

  • sunburst()
  • dual_axis_lines()
  • properties()
  • embeddings()

Motivation

The implementation and type stub files are currently out of sync, which can result in incomplete IDE autocomplete suggestions and inaccurate static analysis for users relying on type information.

Changes

Added the corresponding method signatures to the Visdom class stub in __init__.pyi.

Impact

  • Improves IDE autocomplete and parameter hints for the affected methods.
  • Improves compatibility with static type checkers such as mypy and pyright.
  • No runtime behavior is changed.

Summary by Sourcery

Add missing type stub declarations for additional Visdom visualization methods to keep stubs in sync with the implementation.

New Features:

  • Expose type signatures for the Visdom properties, embeddings, sunburst, and dual_axis_lines methods in the public .pyi stub.

Enhancements:

  • Extend typing imports to include Callable for use in the embeddings method stub.

@sourcery-ai

sourcery-ai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds missing type stubs in py/visdom/init.pyi for four existing Visdom visualization methods so that the stub file matches the implementation and supports better static typing and IDE features.

File-Level Changes

Change Details Files
Expose newer visualization APIs in the Visdom type stub so they are available to static checkers and IDEs.
  • Extend typing imports to include Callable, required for a new callback parameter.
  • Add properties(...) method signature to the Visdom class stub, including data, win, env, and opts parameters.
  • Add embeddings(...) method signature with features, labels, an optional data_getter callback, data_type, win, env, and opts parameters.
  • Add sunburst(...) method signature with labels, parents, optional values, win, env, and opts parameters.
  • Add dual_axis_lines(...) method signature with optional X, Y1, Y2 tensors plus opts, win, and env parameters.
py/visdom/__init__.pyi

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rajnisht7 rajnisht7 left a comment

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.

@Debajeet-1411 changes looks good, just resolve the conflicts

@mariobehling
mariobehling merged commit ad6f7f6 into fossasia:dev Jul 8, 2026
6 checks passed
@Debajeet-1411
Debajeet-1411 deleted the update-type-stubs branch July 8, 2026 13:23
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.

6 participants