-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve contour.py
#782
Improve contour.py
#782
Conversation
knutnergaard
commented
Nov 20, 2024
- Add annotation.
- Add/improve documentation.
- Make minor code improvements.
- Add type annotation. - Add/improve documentation. - changed `BaseSegments.segments` to return `tuple` instead of `list`.
Remaining errors to be collected in robotools#775: ```zsh contour.py:58: error: Signature of "_reprContents" incompatible with supertype "BaseObject" [override] contour.py:58: note: Superclass: contour.py:58: note: @classmethod contour.py:58: note: def _reprContents(cls) -> List[str] contour.py:58: note: Subclass: contour.py:58: note: def _reprContents(self) -> List[str] contour.py:125: error: Incompatible types in assignment (expression has type "Callable[[], Any]", variable has type "Optional[BaseGlyph]") [assignment] contour.py:125: error: Argument 1 to "reference" has incompatible type "BaseGlyph"; expected "Callable[[], Any]" [arg-type] contour.py:277: error: "BaseContour" has no attribute "_getIdentifierforPoint"; maybe "_getIdentifierForPoint" or "getIdentifierForPoint"? [attr-defined] contour.py:477: error: Signature of "isCompatible" incompatible with supertype "InterpolationMixin" [override] contour.py:477: note: Superclass: contour.py:477: note: def isCompatible(self, other: Any, cls: Type[Any]) -> Tuple[bool, Any] contour.py:477: note: Subclass: contour.py:477: note: def isCompatible(self, other: BaseContour) -> Tuple[bool, str] contour.py:532: error: "str" has no attribute "fatal" [attr-defined] contour.py:532: error: "str" has no attribute "warning" [attr-defined] contour.py:533: error: "str" has no attribute "fatal" [attr-defined] contour.py:535: error: "str" has no attribute "warning" [attr-defined] contour.py:657: error: "BaseContour" has no attribute "_reverseContour" [attr-defined] ```
Remaining errors after 5800ca8 to be collected in #775: contour.py:58: error: Signature of "_reprContents" incompatible with supertype "BaseObject" [override]
contour.py:58: note: Superclass:
contour.py:58: note: https://github.com/classmethod
contour.py:58: note: def _reprContents(cls) -> List[str]
contour.py:58: note: Subclass:
contour.py:58: note: def _reprContents(self) -> List[str]
contour.py:125: error: Incompatible types in assignment (expression has type "Callable[[], Any]", variable has type "Optional[BaseGlyph]") [assignment]
contour.py:125: error: Argument 1 to "reference" has incompatible type "BaseGlyph"; expected "Callable[[], Any]" [arg-type]
contour.py:277: error: "BaseContour" has no attribute "_getIdentifierforPoint"; maybe "_getIdentifierForPoint" or "getIdentifierForPoint"? [attr-defined]
contour.py:477: error: Signature of "isCompatible" incompatible with supertype "InterpolationMixin" [override]
contour.py:477: note: Superclass:
contour.py:477: note: def isCompatible(self, other: Any, cls: Type[Any]) -> Tuple[bool, Any]
contour.py:477: note: Subclass:
contour.py:477: note: def isCompatible(self, other: BaseContour) -> Tuple[bool, str]
contour.py:532: error: "str" has no attribute "fatal" [attr-defined]
contour.py:532: error: "str" has no attribute "warning" [attr-defined]
contour.py:533: error: "str" has no attribute "fatal" [attr-defined]
contour.py:535: error: "str" has no attribute "warning" [attr-defined]
contour.py:657: error: "BaseContour" has no attribute "_reverseContour" [attr-defined] |
@benkiel I had to delete the |
@knutnergaard looks like the |
@benkiel Ah! Still failing, but looks like that's due to the |
@knutnergaard yup, its the path tests, just fixed that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of things and a question for @typesupply
@typesupply I will look through code again: there may be a couple of more places where it's a |
I think |
@benkiel Looks like tests fail due to a naming discrepancy going on between |
@knutnergaard the old casing shows up in a couple of places that needed fixing. We will need to note this breaking change |
@knutnergaard thank you for this! Merged! |