Skip to content

Commit

Permalink
Ignore spurious mypy typing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dmentipl committed Mar 14, 2021
1 parent 794d8af commit a1f5efe
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion plonk/analysis/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _norm(x):
return np.sqrt(x[..., 0] ** 2 + x[..., 1] ** 2 + x[..., 2] ** 2)


@numba.njit
@numba.njit # type: ignore
def _potential(position, mass):
"""Get gravitational potential on particles.
Expand Down
11 changes: 6 additions & 5 deletions plonk/analysis/sph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import numba
import numpy as np
from numba.typed import List
from numpy import ndarray

from .._logging import logger
from .._units import Quantity
Expand Down Expand Up @@ -216,7 +217,7 @@ def summation(
else:
logger.info('Finding neighbours...')
_neighbours = snap[indices].neighbours(np.arange(len(indices)))
neighbours = List()
neighbours: List[ndarray] = List()
for neigh in _neighbours:
neighbours.append(np.array(neigh))

Expand All @@ -242,7 +243,7 @@ def summation(
return result


@numba.njit
@numba.njit # type: ignore
def _compute_derivative(
indices,
neighbours,
Expand Down Expand Up @@ -293,7 +294,7 @@ def _compute_derivative(
return result


@numba.njit
@numba.njit # type: ignore
def _compute_grad_over_neighbours(
posi,
hi,
Expand All @@ -319,7 +320,7 @@ def _compute_grad_over_neighbours(
return result


@numba.njit
@numba.njit # type: ignore
def _compute_div_over_neighbours(
posi,
hi,
Expand All @@ -345,7 +346,7 @@ def _compute_div_over_neighbours(
return result


@numba.njit
@numba.njit # type: ignore
def _compute_curl_over_neighbours(
posi,
hi,
Expand Down
12 changes: 6 additions & 6 deletions plonk/utils/kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import numpy as np


@numba.njit
@numba.njit # type: ignore
def kernel_cubic(q):
"""Cubic kernel function.
Expand All @@ -29,7 +29,7 @@ def kernel_cubic(q):
return 0.0


@numba.njit
@numba.njit # type: ignore
def kernel_gradient_cubic(q):
"""Cubic kernel gradient function.
Expand All @@ -54,7 +54,7 @@ def kernel_gradient_cubic(q):
return 0.0


@numba.njit
@numba.njit # type: ignore
def kernel_quintic(q):
"""Quintic kernel function.
Expand All @@ -81,7 +81,7 @@ def kernel_quintic(q):
return 0.0


@numba.njit
@numba.njit # type: ignore
def kernel_gradient_quintic(q):
"""Quintic kernel gradient function.
Expand All @@ -108,7 +108,7 @@ def kernel_gradient_quintic(q):
return 0.0


@numba.njit
@numba.njit # type: ignore
def kernel_wendland_c4(q):
"""Wendland C4 kernel function.
Expand All @@ -133,7 +133,7 @@ def kernel_wendland_c4(q):
return 0.0


@numba.njit
@numba.njit # type: ignore
def kernel_gradient_wendland_c4(q):
"""Wendland C4 kernel gradient function.
Expand Down
10 changes: 5 additions & 5 deletions plonk/visualize/splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
IVERBOSE = -1


@numba.njit
@numba.njit # type: ignore
def w_cubic(q2: float):
"""Cubic spline kernel.
Expand All @@ -41,7 +41,7 @@ def w_cubic(q2: float):
return w


@numba.njit
@numba.njit # type: ignore
def setup_integratedkernel():
"""Set up integrated kernel.
Expand Down Expand Up @@ -76,7 +76,7 @@ def setup_integratedkernel():
return coltable


@numba.njit
@numba.njit # type: ignore
def wfromtable(q2, coltable):
"""Interpolate from integrated kernel table values to give w(q).
Expand All @@ -103,7 +103,7 @@ def wfromtable(q2, coltable):
return coltable[index] + dwdx * dxx


@numba.njit
@numba.njit # type: ignore
def interpolate_projection(
x: ndarray,
y: ndarray,
Expand Down Expand Up @@ -282,7 +282,7 @@ def interpolate_projection(
return datsmooth.T


@numba.njit
@numba.njit # type: ignore
def interpolate_slice(
x: ndarray,
y: ndarray,
Expand Down

0 comments on commit a1f5efe

Please sign in to comment.