diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb8d11e97b9af10c5b4771664b409150514d82ec..43ad52bafa70bf11668e8d703dac76f540789d81 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,7 +35,7 @@ Pylint: - export PY_EXE=python3 - EXTRA_INSTALL="pyopencl" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-pylint.sh - - ". ./prepare-and-run-pylint.sh ${CI_PROJECT_NAME} test/test_*.py" + - . ./prepare-and-run-pylint.sh ${CI_PROJECT_NAME} test/test_*.py examples tags: - python3 except: @@ -45,7 +45,7 @@ Pylint: Flake8: script: - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/prepare-and-run-flake8.sh - - ". ./prepare-and-run-flake8.sh ${CI_PROJECT_NAME} test" + - . ./prepare-and-run-flake8.sh ${CI_PROJECT_NAME} test examples tags: - python3 except: diff --git a/examples/dg_tools.py b/examples/dg_tools.py index 47ee6fb55b6f90e83bb4a47a9dd3fa73bad2a35b..5126befb2fec72e80367e8f45e361a7d153a1ee4 100644 --- a/examples/dg_tools.py +++ b/examples/dg_tools.py @@ -88,16 +88,16 @@ class DGDiscr1D(object): Signature: ->() """ - return self.elements[0,1] - self.elements[0,0] + return self.elements[0, 1] - self.elements[0, 0] def nodes(self): """Return the vector of node coordinates. Signature: ->(n*m,) """ - centers = (self.elements[:,0] + self.elements[:,1]) / 2 - radii = (self.elements[:,1] - self.elements[:,0]) / 2 - return ((self.ref_nodes[:,np.newaxis] * radii) + centers).T.ravel() + centers = (self.elements[:, 0] + self.elements[:, 1]) / 2 + radii = (self.elements[:, 1] - self.elements[:, 0]) / 2 + return ((self.ref_nodes[:, np.newaxis] * radii) + centers).T.ravel() @property @memoized @@ -155,11 +155,11 @@ class DGDiscr1D(object): Signature: ->(n, n) """ - VrT = [] + VrT = [] # noqa: N806 for row in np.eye(self.nnodes): deriv = ortholegder(row) VrT.append(ortholegval(self.ref_nodes, deriv)) - Vr = np.vstack(VrT).T + Vr = np.vstack(VrT).T # noqa: N806 return Vr @ la.inv(self.vdm) @property @@ -205,8 +205,8 @@ class DGDiscr1D(object): Signature: ->(m, 2) """ result = np.zeros((self.nelements, 2)) - result[:,0] = -1 - result[:,1] = 1 + result[:, 0] = -1 + result[:, 1] = 1 return result @@ -326,19 +326,6 @@ class AbstractDGOps1D(object): raise NotImplementedError -def elementwise(mat, vec): - """Apply a matrix to rows of the input representing per-element - degrees of freedom. - - Inputs: - mat: Shape (a, b) - vec: Shape (c, b) - - Signature: (a, b), (c, b) -> (c, a) - """ - return np.einsum("ij,kj->ki", mat, vec) - - class DGOps1DRef(AbstractDGOps1D): """A reference NumPy implementation of the AbstractDGOps1D interface.""" diff --git a/pytato/visualization.py b/pytato/visualization.py index 77392180a3834b6ce833cedb47b7f9d9760fbd15..da02fd848817b1da3b152273e067210c4305a546 100644 --- a/pytato/visualization.py +++ b/pytato/visualization.py @@ -151,10 +151,10 @@ class DotEmitter(CodeGeneratorBase): def _emit_array(emit: DotEmitter, info: DotNodeInfo, id: str) -> None: - td_attrib = "border=\"0\"" - table_attrib = "border=\"0\" cellborder=\"1\" cellspacing=\"0\"" + td_attrib = 'border="0"' + table_attrib = 'border="0" cellborder="1" cellspacing="0"' - rows = ["