Skip to content

Commit 282c410

Browse files
committed
Revert .pylintrc and remove pylint disable
1 parent 71fb3f4 commit 282c410

File tree

17 files changed

+5
-56
lines changed

17 files changed

+5
-56
lines changed

.pylintrc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,7 @@ single-line-if-stmt=no
250250

251251
[BASIC]
252252
# Allow redefinition of input builtins
253-
# input needed in conditions and in solver
254-
# compile needed in Trainer
255-
allowed-redefined-builtins=input,compile
253+
allowed-redefined-builtins=input
256254

257255
# Naming hint for argument names
258256
argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
@@ -377,10 +375,7 @@ known-third-party=enchant
377375
[DESIGN]
378376

379377
# Maximum number of arguments for function / method
380-
max-args=15
381-
382-
# Maximum nmber of positional arguments (R0917)
383-
max-positional-arguments=15
378+
max-args=10
384379

385380
# Maximum number of attributes for a class (see R0902).
386381
max-attributes=15
@@ -395,7 +390,7 @@ max-branches=12
395390
max-locals=15
396391

397392
# Maximum number of parents for a class (see R0901).
398-
max-parents=12
393+
max-parents=7
399394

400395
# Maximum number of public methods for a class (see R0904).
401396
max-public-methods=20

pina/data/data_module.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,9 +423,6 @@ def test_dataloader(self):
423423
return self._create_dataloader("test", self.test_dataset)
424424

425425
@staticmethod
426-
# Unavoidable pylint error (we need to keep the same signature as the
427-
# parent)
428-
# pylint: disable=W0613
429426
def _transfer_batch_to_device_dummy(batch, device, dataloader_idx):
430427
return batch
431428

pina/domain/ellipsoid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ def _sample_range(self, n, mode, variables):
190190

191191
# step 1.
192192
pts = torch.randn(size=(n, dim))
193-
# pylint: disable=E1102
194193
pts = pts / torch.linalg.norm(pts, axis=-1).view((n, 1))
195194
if not self._sample_surface: # step 2.
196195
scale = torch.rand((n, 1))

pina/domain/simplex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def is_inside(self, point, check_border=False):
135135

136136
# compute barycentric coordinates
137137

138-
lambda_ = torch.linalg.solve( # pylint: disable=E1102
138+
lambda_ = torch.linalg.solve(
139139
self._vectors_shifted * 1.0, point_shift * 1.0
140140
)
141141
lambda_1 = 1.0 - torch.sum(lambda_)

pina/equation/equation_factory.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ def __init__(self, value, components=None):
2323
Default is ``None``.
2424
"""
2525

26-
# input_ is not used but it is necessary to keep the signature for
27-
# consistency
28-
# pylint: disable=W0613
2926
def equation(input_, output_):
3027
if components is None:
3128
return output_ - value

pina/graph.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,6 @@ def _build_edge_attr(pos, edge_index):
242242
)
243243

244244

245-
# Avoid signature-differs error. This is a wanted behavior of the overriden
246-
# classes since KNNGraph and RadiusGraph creates edge_index based on radius
247-
# and k-nearest neighbors respectively.
248-
# pylint: disable=signature-differs
249245
class RadiusGraph(GraphBuilder):
250246
"""
251247
A class to build a radius graph.

pina/label_tensor.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
from torch import Tensor
66

77

8-
# Avoid protected-access. We need to access the protected members of the
9-
# LabelTensor class to avoid repeated checking.
10-
# pylint: disable=protected-access
118
class LabelTensor(torch.Tensor):
129
"""Torch tensor with a label for any column."""
1310

@@ -39,9 +36,6 @@ def __init__(self, x, labels):
3936
{1: {"name": "space"['a', 'b', 'c'])
4037
4138
"""
42-
# Avoid unused argument warning. x is not used in the constructor
43-
# of the parent class.
44-
# pylint: disable=unused-argument
4539
super().__init__()
4640
if labels is not None:
4741
self.labels = labels

pina/loss/lp_loss.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from .loss_interface import LossInterface
77

88

9-
# Avoid pylint warning for torch.linalg.norm (it is callable)
10-
# pylint: disable=not-callable
119
class LpLoss(LossInterface):
1210
r"""
1311
The Lp loss implementation class. Creates a criterion that measures

pina/model/block/convolution_2d.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,6 @@ def forward(self, X):
379379
).sum(1)
380380
return conv
381381

382-
# Avoid too many arguments warning
383-
# pylint: disable=R0914
384382
def transpose_no_overlap(self, integrals, X):
385383
"""
386384
Transpose pass in the layer for no-overlapping filters

pina/model/block/gno_block.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def __init__(
2828
:param edges_features: Number of edge features.
2929
:param n_layers: Number of layers in edge transformation MLP.
3030
"""
31-
# Avoid circular import. I need to import FeedForward here
32-
# to avoid circular import with FeedForward itself.
33-
# pylint: disable=import-outside-toplevel
31+
3432
from ...model.feed_forward import FeedForward
3533

3634
super().__init__(aggr="mean") # Uses PyG's default aggregation

0 commit comments

Comments
 (0)