cleanvision icon indicating copy to clipboard operation
cleanvision copied to clipboard

mypy stubs for non-trivial datatypes

Open Kadam-Tushar opened this issue 1 year ago • 1 comments

There are places in codebase like this where mypy won't be to detect variable's type and it will be termed as Any.

Screenshot 2023-05-16 at 2 21 02 AM

Are we planning to add any mypy stubs for such variables? I am interested in this because in #124, one of the possible types of imagelab.info is pd.Series or pd.DataFrame but if we are not using stubs like pandas stubs then mypy will consider them (pd.Series) to Any datatype.

Kadam-Tushar avatar May 15 '23 20:05 Kadam-Tushar

Hi @Kadam-Tushar ! We are not using the pandas-stubs package because it only supports python>=3.8, whereas CleanVision currently also supports python 3.7. Also another point to note, as mentioned in the project readme the stubs are narrower than what pandas supports. We still want to add the types though, so that it is easier for new developers to understand the code and whenever we stop supporting 3.7 it is easier to use pandas-stubs.

sanjanag avatar May 15 '23 23:05 sanjanag