-
Notifications
You must be signed in to change notification settings - Fork 411
Multimethod changes and type checking #1969
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1969 +/- ##
==========================================
+ Coverage 95.86% 96.00% +0.14%
==========================================
Files 29 29
Lines 7949 9355 +1406
Branches 1194 1592 +398
==========================================
+ Hits 7620 8981 +1361
- Misses 191 216 +25
- Partials 138 158 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…into cone-func-fix
jmwright
left a comment
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.
Thanks @adam-urbanczyk
I made a few comments, but otherwise it looks good.
|
|
||
| wire_lists = [[w] for w in _get_wires(el)] | ||
|
|
||
| # if not faces and vertices were detected return an empty list |
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.
| # if not faces and vertices were detected return an empty list | |
| # if no faces and vertices were detected return an empty list |
|
|
||
| face_lists = [[f] for f in el.Faces()] | ||
|
|
||
| # if not faces were detected return an empty list |
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.
| # if not faces were detected return an empty list | |
| # if no faces were detected return an empty list |
|
|
||
| class cqmultimethod(multimethod): | ||
| def __call__(self, *args, **kwargs): | ||
| # class cqmultimethod(multimethod): |
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.
Why is this left commented?
| return super().__call__(*args, **kwargs) | ||
| except DispatchError: | ||
| return next(iter(self.values()))(*args, **kwargs) | ||
| # try: |
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.
Same as above. Wondering why the block was left in but commented.
lorenzncode
left a comment
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.
LGTM other than a few minor typo and lint check items. Thanks @adam-urbanczyk !
|
|
||
| assert s3.map(lambda x: f).subtract().reset().val().Area() == approx(0.9) | ||
|
|
||
| # check that adding without selection does not raise |
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.
typo in comment; adding -> subtract
# check that subtract without selection does not raise|
|
||
| wire_lists: List[List[Wire]] = [] | ||
|
|
||
| ix_last = len(s) - 1 |
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.
Local variable ix_last is assigned to but never used
|
|
||
| face_lists: List[List[Face]] = [] | ||
|
|
||
| ix_last = len(s) - 1 |
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.
Local variable ix_last is assigned to but never used
| from multimethod import multimethod, DispatchError | ||
| from multimethod import ( | ||
| multidispatch as _multidispatch, | ||
| DispatchError, |
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.
multimethod.DispatchError imported but unused
|
|
||
| from ..types import Real | ||
| from ..utils import multimethod | ||
| from ..utils import multimethod, multidispatch |
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.
..utils.multimethod imported but unused
|
|
||
| assert A().f(a=0, c="s") == 1 | ||
|
|
||
| with raises(TypeError): |
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.
pytest.raises imported but unused
Quite some scope creep, but IMO this is very important
Solves #1830