Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Made a mistake in the compiler refactor + New linting rules (#672)
Browse files Browse the repository at this point in the history
* Fix mistake in init

* Fix code for new linting rules
  • Loading branch information
JDBetteridge authored Aug 11, 2022
1 parent 7036b5d commit 3a1b62f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyop2/codegen/rep2loopy.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def with_descrs(self, arg_id_to_descr, callables_table):

def generate_preambles(self, target):
assert isinstance(target, type(target))
yield("00_petsc", "#include <petsc.h>")
yield ("00_petsc", "#include <petsc.h>")
return


Expand Down
6 changes: 3 additions & 3 deletions pyop2/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ class Compiler(ABC):
_optflags = ()
_debugflags = ()

def __init__(self, extra_compiler_flags=None, extra_linker_flags=None, cpp=False, comm=None):
self._extra_compiler_flags = tuple(extra_compiler_flags) or ()
self._extra_linker_flags = tuple(extra_linker_flags) or ()
def __init__(self, extra_compiler_flags=(), extra_linker_flags=(), cpp=False, comm=None):
self._extra_compiler_flags = tuple(extra_compiler_flags)
self._extra_linker_flags = tuple(extra_linker_flags)

self._cpp = cpp
self._debug = configuration["debug"]
Expand Down
2 changes: 1 addition & 1 deletion pyop2/types/dat.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def load(self, filename):
# The np.save method appends a .npy extension to the file name
# if the user has not supplied it. However, np.load does not,
# so we need to handle this ourselves here.
if(filename[-4:] != ".npy"):
if filename[-4:] != ".npy":
filename = filename + ".npy"

if isinstance(self.data, tuple):
Expand Down
2 changes: 1 addition & 1 deletion pyop2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def verify_reshape(data, dtype, shape, allow_none=False):
a = np.asarray(data, dtype=t)
except ValueError:
raise DataValueError("Invalid data: cannot convert to %s!" % dtype)
except(TypeError):
except TypeError:
raise DataTypeError("Invalid data type: %s" % dtype)
try:
# Destructively modify shape. Fails if data are not
Expand Down

0 comments on commit 3a1b62f

Please sign in to comment.