Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 48 additions & 110 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,11 @@
}
},
{
"code": "reportIndexIssue",
"code": "reportUnreachable",
"range": {
"startColumn": 12,
"endColumn": 17,
"lineCount": 1
"startColumn": 8,
"endColumn": 45,
"lineCount": 7
}
},
{
Expand Down Expand Up @@ -908,11 +908,11 @@
}
},
{
"code": "reportIndexIssue",
"code": "reportUnreachable",
"range": {
"startColumn": 12,
"endColumn": 17,
"lineCount": 1
"startColumn": 8,
"endColumn": 45,
"lineCount": 7
}
},
{
Expand All @@ -924,43 +924,11 @@
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 19,
"endColumn": 41,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 32,
"endColumn": 44,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"code": "reportUnreachable",
"range": {
"startColumn": 8,
"endColumn": 17,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 19,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 8,
"endColumn": 15,
"lineCount": 1
"lineCount": 8
}
}
],
Expand Down Expand Up @@ -21186,35 +21154,11 @@
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 28,
"endColumn": 33,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 46,
"endColumn": 63,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 46,
"endColumn": 63,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"code": "reportUnreachable",
"range": {
"startColumn": 41,
"endColumn": 53,
"lineCount": 1
"startColumn": 8,
"endColumn": 56,
"lineCount": 4
}
},
{
Expand Down Expand Up @@ -28689,6 +28633,14 @@
"lineCount": 1
}
},
{
"code": "reportAbstractUsage",
"range": {
"startColumn": 19,
"endColumn": 18,
"lineCount": 4
}
},
{
"code": "reportCallIssue",
"range": {
Expand Down Expand Up @@ -28817,6 +28769,14 @@
"lineCount": 1
}
},
{
"code": "reportAbstractUsage",
"range": {
"startColumn": 19,
"endColumn": 18,
"lineCount": 4
}
},
{
"code": "reportCallIssue",
"range": {
Expand Down Expand Up @@ -44037,14 +43997,6 @@
"lineCount": 1
}
},
{
"code": "reportUnnecessaryTypeIgnoreComment",
"range": {
"startColumn": 97,
"endColumn": 117,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand All @@ -44053,38 +44005,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 12,
"endColumn": 18,
"lineCount": 1
}
},
{
"code": "reportOptionalSubscript",
"range": {
"startColumn": 21,
"endColumn": 48,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 49,
"endColumn": 70,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 49,
"endColumn": 55,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
Expand Down Expand Up @@ -44260,6 +44180,24 @@
}
}
],
"./test/test_layer_pot_eigenvalues.py": [
{
"code": "reportUnreachable",
"range": {
"startColumn": 12,
"endColumn": 21,
"lineCount": 8
}
},
{
"code": "reportUnreachable",
"range": {
"startColumn": 12,
"endColumn": 21,
"lineCount": 4
}
}
],
"./test/test_layer_pot_identity.py": [
{
"code": "reportReturnType",
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
# sumpy
"ExpansionBase": "class:sumpy.expansion.ExpansionBase",
"ExpansionFactoryBase": "class:sumpy.expansion.ExpansionFactoryBase",
"Kernel": "class:sumpy.kernel.Kernel",
"ScalarKernel": "class:sumpy.kernel.ScalarKernel",
"HelmholtzKernel": "class:sumpy.kernel.HelmholtzKernel",
"P2P": "class:sumpy.p2p.P2P",
"P2PBase": "class:sumpy.p2p.P2PBase",
Expand Down
4 changes: 2 additions & 2 deletions pytential/linalg/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

from boxtree.tree_build import TreeKind
from sumpy.expansion import ExpansionBase
from sumpy.kernel import Kernel
from sumpy.kernel import ScalarKernel

from pytential.linalg.utils import IndexList
from pytential.symbolic.dof_desc import DOFDescriptorLike
Expand Down Expand Up @@ -182,7 +182,7 @@ def __init__(self,
self.lpot_source = lpot_source

def get_expansion_for_qbx_direct_eval(
self, base_kernel: Kernel, target_kernels: Sequence[Kernel]
self, base_kernel: ScalarKernel, target_kernels: Sequence[ScalarKernel]
) -> ExpansionBase:
"""Wrapper around
``pytential.qbx.QBXLayerPotentialSource.get_expansion_for_qbx_direct_eval``
Expand Down
6 changes: 3 additions & 3 deletions pytential/qbx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
from pymbolic import ArithmeticExpression
from sumpy.expansion import LocalExpansionFactory
from sumpy.fmm import FMMLevelToOrder
from sumpy.kernel import Kernel
from sumpy.kernel import ScalarKernel

from pytential.collection import GeometryCollection, GeometryLike
from pytential.qbx.cost import AbstractQBXCostModel
Expand Down Expand Up @@ -99,7 +99,7 @@ class QBXDefaultExpansionFactory(DefaultExpansionFactoryBase):
"""An expansion factory to create QBX local, local and multipole expansions
"""
def get_qbx_local_expansion_class(self,
kernel: Kernel, /
kernel: ScalarKernel, /
) -> LocalExpansionFactory:
local_expn_class = DefaultExpansionFactoryBase.get_local_expansion_class(
self, kernel)
Expand Down Expand Up @@ -199,7 +199,7 @@ def __init__(
:arg fmm_level_to_order: A callable that takes arguments of
*(kernel, kernel_args, tree, level)* and returns the expansion
order to be used on a given *level* of *tree* with *kernel*, where
*kernel* is the :class:`sumpy.kernel.Kernel` being evaluated, and
*kernel* is the :class:`sumpy.kernel.ScalarKernel` being evaluated, and
*kernel_args* is a set of *(key, value)* tuples with evaluated
kernel arguments. May not be given if *fmm_order* is given.
:arg fmm_backend: a string denoting the desired FMM backend to use,
Expand Down
16 changes: 8 additions & 8 deletions pytential/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

import pyopencl as cl
from meshmode.discretization import Discretization
from sumpy.kernel import Kernel
from sumpy.kernel import ScalarKernel
from sumpy.p2p import P2P

from pytential.collection import GeometryCollection
Expand Down Expand Up @@ -103,16 +103,16 @@ def op_group_features(self, expr: IntG) -> tuple[Hashable, ...]:

def get_p2p(self,
actx: PyOpenCLArrayContext,
target_kernels: tuple[Kernel, ...],
source_kernels: tuple[Kernel, ...] | None = None) -> P2P:
target_kernels: tuple[ScalarKernel, ...],
source_kernels: tuple[ScalarKernel, ...] | None = None) -> P2P:
"""
:returns: a subclass of :class:`~sumpy.p2p.P2P` for evaluating
the *target_kernels* and the *source_kernels* on the source geometry.
"""

@memoize_in(actx, (PotentialSource, "p2p"))
def p2p(target_kernels: tuple[Kernel, ...],
source_kernels: tuple[Kernel, ...] | None) -> P2P:
def p2p(target_kernels: tuple[ScalarKernel, ...],
source_kernels: tuple[ScalarKernel, ...] | None) -> P2P:
if any(knl.is_complex_valued for knl in target_kernels):
value_dtype = self.complex_dtype
else:
Expand Down Expand Up @@ -364,7 +364,7 @@ def complex_dtype(self) -> np.dtype[np.complexfloating]:

# {{{ fmm setup helpers

def get_fmm_kernel(self, kernels: Iterable[Kernel]) -> Kernel | None:
def get_fmm_kernel(self, kernels: Iterable[ScalarKernel]) -> ScalarKernel | None:
fmm_kernel = None

from sumpy.kernel import TargetTransformationRemover
Expand All @@ -380,7 +380,7 @@ def get_fmm_kernel(self, kernels: Iterable[Kernel]) -> Kernel | None:

def get_fmm_output_and_expansion_dtype(
self,
kernels: Iterable[Kernel],
kernels: Iterable[ScalarKernel],
strengths: ArrayOrContainerOrScalar) -> np.dtype[Any]:
if (
any(knl.is_complex_valued for knl in kernels)
Expand All @@ -392,7 +392,7 @@ def get_fmm_output_and_expansion_dtype(
def get_fmm_expansion_wrangler_extra_kwargs(
self,
actx: PyOpenCLArrayContext,
target_kernels: tuple[Kernel, ...],
target_kernels: tuple[ScalarKernel, ...],
tree_user_source_ids: Array,
arguments: KernelArgumentMapping,
evaluator: Callable[[Operand], ArrayOrContainerOrScalar],
Expand Down
10 changes: 5 additions & 5 deletions pytential/symbolic/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from pymbolic.geometric_algebra import MultiVector
from pymbolic.mapper.dependency import Dependency
from pymbolic.typing import Expression
from sumpy.kernel import Kernel
from sumpy.kernel import ScalarKernel

from pytential.collection import GeometryCollection
from pytential.symbolic.primitives import KernelArgumentMapping, Operand
Expand Down Expand Up @@ -229,14 +229,14 @@ class ComputePotential(Statement):
"""A tuple of :class:`PotentialOutput` instances. The entries in the list
correspond to :attr:`Statement.names`.
"""
target_kernels: tuple[Kernel, ...]
"""A tuple of :class:`sumpy.kernel.Kernel` instances, indexed by
target_kernels: tuple[ScalarKernel, ...]
"""A tuple of :class:`sumpy.kernel.ScalarKernel` instances, indexed by
:attr:`PotentialOutput.target_kernel_index`.
"""
kernel_arguments: KernelArgumentMapping
"""A dictionary mapping argument names to kernel arguments."""
source_kernels: tuple[Kernel, ...]
"""A tuple of :class:`sumpy.kernel.Kernel` instances with only source
source_kernels: tuple[ScalarKernel, ...]
"""A tuple of :class:`sumpy.kernel.ScalarKernel` instances with only source
derivatives and no target derivatives. See the
:class:`~pytential.symbolic.primitives.IntG` docstring for details.
"""
Expand Down
5 changes: 3 additions & 2 deletions pytential/symbolic/pde/beltrami.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


if TYPE_CHECKING:
from sumpy.kernel import Kernel
from sumpy.kernel import ScalarKernel


# {{{ beltrami operator
Expand Down Expand Up @@ -85,7 +85,8 @@ class BeltramiOperator:
.. automethod:: operator
"""

def __init__(self, kernel: Kernel, *,
def __init__(
self, kernel: ScalarKernel, *,
dim: int | None = None,
precond: str = "left",
kernel_arguments: dict[str, Any] | None = None) -> None:
Expand Down
Loading
Loading