Giter VIP home page Giter VIP logo

Comments (6)

Dr-Irv avatar Dr-Irv commented on August 23, 2024

The previous stubs were installed on top of the pandas installation, so you had to have pandas installed. Now pandas-stubs is installed as a separate package which is separate from the pandas installation.

With respect to matplotlib, the stubs import matplotlib, so it's not clear that they would work without matplotlib installed.

The purpose of these stubs is to sit alongside pandas. I think you have to include the dependencies, but if you can prove they would work without pandas or matplotlib installed, then we could make a change.

from pandas-stubs.

twoertwein avatar twoertwein commented on August 23, 2024

With respect to matplotlib, the stubs import matplotlib, so it's not clear that they would work without matplotlib installed.

Most of matplotlib is not annotated. I think the matplotlib type used the most is Axes which unfortunately resolves to Any.

from matplotlib.axes import Axes

reveal_type(Axes)  # mypy: any, pyright: Unknown

If the goal of pandas-stubs is to eventually be part of typeshed and be recommeneded by mypy, I think pandas-stubs cannot depend on any actual code (and only contain pyi files).

Should probably keep matplotlib at least on the CI: pyright would otherwise complain that it cannot find all the matplotlib imports (and matplotlib might add annotations in the future).

from pandas-stubs.

Dr-Irv avatar Dr-Irv commented on August 23, 2024

Most of matplotlib is not annotated. I think the matplotlib type used the most is Axes which unfortunately resolves to Any.

matplotlib does have annotations that are shipped with VS Code.

from matplotlib.axes import Axes

reveal_type(Axes)  # mypy: any, pyright: Unknown

In the above example, within VS Code, you will get Type[Axes] on the reveal_type()

If the goal of pandas-stubs is to eventually be part of typeshed and be recommeneded by mypy, I think pandas-stubs cannot depend on any actual code (and only contain pyi files).

I'm not sure that the goal is to make pandas-stubs part of typeshed, although I could see that happening in the future.

from pandas-stubs.

twoertwein avatar twoertwein commented on August 23, 2024

matplotlib does have annotations that are shipped with VS Code.

Thank you, I didn't know that! If they have a standalone stub package, pandas-stubs (and pandas) should install that at least for the CI. mypy&pyright infer Axes on the pandas CI as Any/Unknown.

from pandas-stubs.

Dr-Irv avatar Dr-Irv commented on August 23, 2024

matplotlib does have annotations that are shipped with VS Code.

Thank you, I didn't know that! If they have a standalone stub package, pandas-stubs (and pandas) should install that at least for the CI. mypy&pyright infer Axes on the pandas CI as Any/Unknown.

To clarify, the matplotlib annotations are maintained by Microsoft in https://github.com/microsoft/python-type-stubs, and then Microsoft merges those stubs into the VS Code distribution.

from pandas-stubs.

Dr-Irv avatar Dr-Irv commented on August 23, 2024

closed via #66

from pandas-stubs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.