Skip to content

Commit

Permalink
pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
whoburg committed Jan 5, 2024
1 parent 518a7c0 commit 24e860d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gpkit/nomials/array.py
Expand Up @@ -59,13 +59,13 @@ def __truediv__(self, other):
return out

def __rtruediv__(self, other):
out = (np.ndarray.__mul__(self**-1, other))
out = np.ndarray.__mul__(self**-1, other)
out.ast = ("div", (other, self))
return out

def __add__(self, other, *, reverse_order=False):
astorder = (self, other) if not reverse_order else (other, self)
out = (np.ndarray.__add__(self, other))
out = np.ndarray.__add__(self, other)
out.ast = ("add", astorder)
return out

Expand All @@ -74,12 +74,12 @@ def __rmul__(self, other): return self.__mul__(other, reverse_order=True)
def __radd__(self, other): return self.__add__(other, reverse_order=True)

def __pow__(self, expo): # pylint: disable=arguments-differ
out = (np.ndarray.__pow__(self, expo)) # pylint: disable=too-many-function-args
out = np.ndarray.__pow__(self, expo) # pylint: disable=too-many-function-args
out.ast = ("pow", (self, expo))
return out

def __neg__(self):
out = (np.ndarray.__neg__(self))
out = np.ndarray.__neg__(self)
out.ast = ("neg", self)
return out

Expand All @@ -99,7 +99,7 @@ def str_without(self, excluded=()):
if not self.shape:
return try_str_without(self.flatten()[0], excluded)

return "[%s]" % ", ".join(
return "[%s]" % ", ".join( # pylint: disable=consider-using-f-string
[try_str_without(np.ndarray.__getitem__(self, i), excluded)
for i in range(self.shape[0])]) # pylint: disable=unsubscriptable-object

Expand All @@ -121,7 +121,7 @@ def __new__(cls, input_array):
def __array_finalize__(self, obj):
"Finalizer. Required for objects inheriting from np.ndarray."

def __array_wrap__(self, out_arr, context=None): # pylint: disable=arguments-differ
def __array_wrap__(self, out_arr, context=None): # pylint: disable=arguments-renamed
"""Called by numpy ufuncs.
Special case to avoid creation of 0-dimensional arrays
See http://docs.scipy.org/doc/numpy/user/basics.subclassing.html"""
Expand Down

0 comments on commit 24e860d

Please sign in to comment.