nncf icon indicating copy to clipboard operation
nncf copied to clipboard

[Fixed]: Issues resolved raised by mypy for issue Make #22313

Open AtharvaPore01 opened this issue 1 year ago • 4 comments

Changes

Missing Type Annotations:

  • Many errors stem from functions or variables lacking explicit type annotations.

Incorrect Function Signatures:

  • Some errors indicate mismatches between function arguments, return types, or overridden methods.

List and Array Operations:

  • Errors involve incorrect usage of lists or arrays, such as incompatible types or invalid operations.

Missing Return Statements:

  • Functions marked as returning a value must return something.

Missing Type Annotations

  • A significant number of functions are missing type annotations. This is indicated by errors like Function is missing a type annotation for one or more arguments [no-untyped-def].

Incorrect or Missing Implementation of __eq__ Method:

  • There were several errors related to the implementation of the __eq__ method in different classes. The method's signature must accept an argument of type object and then check if the passed object is of the expected type.

Type Argument Issues in Generic Types:

  • Errors like Missing type parameters for generic type suggest that you are using generic types (like ndarray, deque, List) without specifying their type parameters.

Incompatible Types and Assignments:

  • There were various errors where the types of variables or return types didn't match what was expected. This can be due to incorrect assignment or returning the wrong type from a function.

Mypy-specific Issues and Recommendations:

  • Some errors were specific to mypy, a static type checker, which includes recommendations on how to make the code compliant with type checking, such as adhering to the expected method signatures in subclasses.

Miscellaneous Errors:

  • These include issues like methods missing return type annotations (even when they don't return any value, -> None should be used), the use of a function as a type that is invalid, and a method in a subclass that does not return a value, contradicting the superclass's method signature.

Other Issues:

  • A few errors relate to missing attributes or incorrect usage of specific functions.

Reason for changes

As stated in issue #22313, the main reason behind solving the errors above as they were raised by running the mypy.ini file.

Ticket Number:

#22313

AtharvaPore01 avatar Jan 31 '24 01:01 AtharvaPore01

Codecov Report

Attention: 140 lines in your changes are missing coverage. Please review.

Comparison is base (a7b67f4) 90.55% compared to head (d4a3bdc) 3.88%. Report is 40 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   openvinotoolkit/openvino#2438       +/-   ##
===========================================
- Coverage    90.55%   3.88%   -86.68%     
===========================================
  Files          493     498        +5     
  Lines        44994   45519      +525     
===========================================
- Hits         40746    1767    -38979     
- Misses        4248   43752    +39504     
Files Coverage Δ
nncf/common/graph/transformations/commands.py 75.00% <0.00%> (-22.02%) :arrow_down:
nncf/common/logging/track_progress.py 0.00% <0.00%> (-87.94%) :arrow_down:
nncf/common/tensor_statistics/reduction.py 0.00% <0.00%> (-100.00%) :arrow_down:
nncf/common/tensor_statistics/aggregator.py 15.25% <0.00%> (-84.75%) :arrow_down:
nncf/common/tensor_statistics/statistic_point.py 6.25% <20.00%> (-85.24%) :arrow_down:
nncf/common/tensor_statistics/statistics.py 0.00% <0.00%> (-89.10%) :arrow_down:
nncf/common/tensor_statistics/collectors.py 2.06% <2.19%> (-86.91%) :arrow_down:

... and 441 files with indirect coverage changes

Flag Coverage Δ
COMMON ?
ONNX ?
OPENVINO ?
TENSORFLOW 3.88% <2.77%> (-26.31%) :arrow_down:
TORCH ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
common 10.97% <2.77%> (-82.34%) :arrow_down:
torch 0.00% <ø> (-92.95%) :arrow_down:
tensorflow 0.00% <ø> (-94.00%) :arrow_down:
onnx 0.00% <ø> (-95.71%) :arrow_down:
openvino 0.00% <ø> (-91.60%) :arrow_down:
ptq 4.55% <ø> (-83.92%) :arrow_down:

codecov[bot] avatar Jan 31 '24 01:01 codecov[bot]

hey @AtharvaPore01 do you have time to finish this PR? Or should we move it back to the pool?

mlukasze avatar Mar 19 '24 08:03 mlukasze

@mlukasze Hi, Sorry for the delay from my side. I appreciate your patience. I'm currently tied up with some urgent tasks but will prioritize completing the PR as soon as possible. Your understanding is greatly appreciated.

AtharvaPore01 avatar Mar 22 '24 15:03 AtharvaPore01

@AtharvaPore01 , do you plan to continue to work on this PR?

MaximProshin avatar May 14 '24 12:05 MaximProshin