Giter Club home page Giter Club logo

lazy-type-hint's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Manuel, roboticist with interests in programming and Artificial Intelligence.
  • ๐ŸŒฑ Iโ€™m always learning about Python and C++, but recently added some knowledge in VIM and LUA.
  • ๐Ÿ’ž๏ธ I like collaborating in projects that ease the work of the developpers, by automatizing tasks and linting code.
  • ๐Ÿ“ซ Feel free to contact me! [email protected]

lazy-type-hint's People

Contributors

mflova avatar

Stargazers

 avatar  avatar

Watchers

 avatar

lazy-type-hint's Issues

Wrong pandas type information with empty column names

When multiple empty column names are given, there is a high risk that they end up referencing other the wrong dataframes. This is because the type alias created for the dataframes depends on the name of the column. If the name is an empty string, there is a high chance of overlapping

slow performance on big lists

i tried your tool with a dict of lists with diff. types (bytes, int, float, str), each list contains about 50000 elements.
it took nearly 6 seconds to execute the follwowing command:

th_data_dict = LazyTypeHintLive().from_data(data_dict, class_name="enc_data")

but all in all a quiet nice tool

Extend type hints from outside

When type hinting new pandas accessors, these will not be properly type hinted. Consider the possibility of adding hardcoded lines and imports. Lines to be added to the class. Something like:

{extra_imports}

class MyDataFrame(pd.DataFrame):

    {line_given_by_the_user}

    @overload  # type: ignore
    def __getitem__(self, key: Literal['HA40+']) -> pd.Series["Quantity"]:
        ...

Where line_given_by_the_user can be: pint: PintAccessor and {extra_imports} being PintAccessor corresponding import

How this information is given is still to be decided

EDIT: Another alternative would be to scan all accessors within a pandas dataframe and include them in the class scope of the dataframe (including associated import)

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.