Skip to content
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

[Lang] Fix pylint rule W0235 #3486

Merged
merged 4 commits into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
exit 0
fi
# Make sure pylint doesn't regress
pylint python/taichi/ --disable=all --enable=C0121,C0415,W0101,W0401,W0611,W0202,R0205,R0402,R1703,R1705,R1732,C0200,R0201,W0108
pylint python/taichi/ --disable=all --enable=C0121,C0415,W0101,W0401,W0611,W0202,W0235,R0205,R0402,R1703,R1705,R1732,C0200,R0201,W0108
if [ $? -eq 0 ]
then
echo "PASSED: pylint is happy"
Expand Down
3 changes: 0 additions & 3 deletions python/taichi/lang/_ndarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,6 @@ class ScalarNdarray(Ndarray):
dtype (DataType): Data type of each value.
shape (Tuple[int]): Shape of the ndarray.
"""
def __init__(self, dtype, shape):
super().__init__(dtype, shape)

@property
def shape(self):
return tuple(self.arr.shape)
Expand Down
3 changes: 1 addition & 2 deletions python/taichi/lang/exception.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
class TaichiSyntaxError(Exception):
def __init__(self, *args):
super().__init__(*args)
pass


class InvalidOperationError(Exception):
Expand Down
3 changes: 1 addition & 2 deletions python/taichi/lang/kernel_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,7 @@ def lookup(self, args):


class KernelDefError(Exception):
def __init__(self, msg):
super().__init__(msg)
pass


class KernelArgError(Exception):
Expand Down
8 changes: 1 addition & 7 deletions python/taichi/ui/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def gen_normals(vertices, indices):
class Scene(_ti_core.PyScene):
"""A 3D scene, which can contain meshes and particles, and can be rendered on a canvas
"""
def __init__(self):
super().__init__()

def set_camera(self, camera):
super().set_camera(camera.ptr)

Expand Down Expand Up @@ -133,8 +130,5 @@ def particles(self,
vbo_info = get_field_info(vbo)
super().particles(vbo_info, has_per_vertex_color, color, radius)

def point_light(self, pos, color):
def point_light(self, pos, color): # pylint: disable=W0235
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why handling this differently :-) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/taichi-dev/taichi/runs/4191773093

@k-ye CI fails, but I'm not familiar with pybind11.

super().point_light(pos, color)

def ambient_light(self, color):
super().ambient_light(color)