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 25ae414 commit cf6ec92
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gpkit/small_classes.py
Expand Up @@ -2,6 +2,7 @@
from operator import xor
from functools import reduce
import numpy as np
from scipy.sparse import csr_matrix
from .units import Quantity, qty # pylint: disable=unused-import

Strings = (str,)
Expand All @@ -14,11 +15,12 @@ def __instancecheck__(cls, obj):
return getattr(obj, "hmap", None) and len(obj.hmap) == 1 and not obj.vks


class FixedScalar(metaclass=FixedScalarMeta): # pylint: disable=no-init
class FixedScalar(metaclass=FixedScalarMeta):
# pylint: disable=too-few-public-methods
"Instances of this class are scalar Nomials with no variables"


class Count:
class Count: # pylint: disable=too-few-public-methods
"Like python 2's itertools.count, for Python 3 compatibility."
def __init__(self):
self.count = -1
Expand Down Expand Up @@ -57,7 +59,6 @@ def __eq__(self, other):

def tocsr(self):
"Converts to a Scipy sparse csr_matrix"
from scipy.sparse import csr_matrix
return csr_matrix((self.data, (self.row, self.col)))

def dot(self, arg):
Expand Down Expand Up @@ -128,8 +129,8 @@ def _append_dict(d_in, d_out):
try:
d_out[k].append(v)
except KeyError as e:
raise RuntimeWarning("Key `%s` was added after the first sweep."
% k) from e
msg = f"Key `{k}` was added after the first sweep."
raise RuntimeWarning(msg) from e
return d_out


Expand Down

0 comments on commit cf6ec92

Please sign in to comment.