Skip to content

Commit

Permalink
Resolve unsubscriptable-object pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mhostetter committed Dec 11, 2022
1 parent 0c7392d commit 62bf749
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ disable = [
"too-many-lines",
"too-many-locals",
"unneeded-not",
"unsubscriptable-object", # pylint doesn't understand metaclass properties
]
min-similarity-lines = 100
max-line-length = 140
Expand Down
6 changes: 4 additions & 2 deletions src/galois/_fields/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ def arithmetic_table(

if cls.element_repr == "power":
# Order elements by powers of the primitive element
x_default = np.concatenate((np.atleast_1d(cls(0)), cls.primitive_element ** np.arange(0, cls.order - 1, dtype=cls.dtypes[-1])))
dtype = cls.dtypes[-1] # pylint: disable=unsubscriptable-object
x_default = np.concatenate((np.atleast_1d(cls(0)), cls.primitive_element ** np.arange(0, cls.order - 1, dtype=dtype)))
else:
x_default = cls.elements
y_default = x_default if operation != "/" else x_default[1:]
Expand Down Expand Up @@ -1366,7 +1367,8 @@ def field_trace(self) -> FieldArray:
subfield = field.prime_subfield
p = field.characteristic
m = field.degree
conjugates = np.power.outer(x, p ** np.arange(0, m, dtype=field.dtypes[-1]))
dtype = field.dtypes[-1] # pylint: disable=unsubscriptable-object
conjugates = np.power.outer(x, p ** np.arange(0, m, dtype=dtype))
trace = np.add.reduce(conjugates, axis=-1)
trace = subfield._view(trace)

Expand Down
4 changes: 2 additions & 2 deletions src/galois/_fields/_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def squares(cls) -> FieldArray:
"""
x = cls.elements
is_square = x.is_square()
return x[is_square]
return x[is_square] # pylint: disable=unsubscriptable-object

@property
def non_squares(cls) -> FieldArray:
Expand Down Expand Up @@ -360,7 +360,7 @@ def non_squares(cls) -> FieldArray:
"""
x = cls.elements
is_square = x.is_square()
return x[~is_square]
return x[~is_square] # pylint: disable=unsubscriptable-object

@property
def is_prime_field(cls) -> bool:
Expand Down

0 comments on commit 62bf749

Please sign in to comment.