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
80 changes: 0 additions & 80 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 4,
"endColumn": 19,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand Down Expand Up @@ -7401,14 +7393,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 40,
"endColumn": 55,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand Down Expand Up @@ -43705,46 +43689,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 20,
"endColumn": 24,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 20,
"endColumn": 24,
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 26,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 26,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 38,
"endColumn": 49,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand All @@ -43753,22 +43697,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
"startColumn": 23,
"endColumn": 27,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 40,
"endColumn": 41,
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
Expand Down Expand Up @@ -48143,14 +48071,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 36,
"endColumn": 51,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
Expand Down
11 changes: 8 additions & 3 deletions pymbolic/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
if TYPE_CHECKING:
from collections.abc import Callable, Iterable, Mapping

import numpy as np
from _typeshed import DataclassInstance
from numpy.typing import NDArray


__doc__ = """
Expand Down Expand Up @@ -2038,7 +2040,11 @@ def make_common_subexpression(expr: _Expression,
return CommonSubexpression(expr, prefix, scope)


def make_sym_vector(name, components, var_factory=Variable):
def make_sym_vector(
name: str,
components: int | list[int],
var_factory: Callable[[str], ExpressionNode] = Variable
) -> NDArray[np.generic]:
"""Return an object array of *components* subscripted
:class:`Variable` (or subclass) instances.

Expand All @@ -2054,8 +2060,7 @@ def make_sym_vector(name, components, var_factory=Variable):
Subscript(Variable('vec'), 2)], dtype=object)

"""
from numbers import Integral
if isinstance(components, Integral):
if is_constant(components):
components = list(range(components))

from pytools.obj_array import flat_obj_array
Expand Down
Loading