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
120 changes: 72 additions & 48 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,38 @@
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 10,
"endColumn": 13,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 10,
"endColumn": 13,
"lineCount": 1
}
},
{
"code": "reportUnknownMemberType",
"range": {
"startColumn": 4,
"endColumn": 15,
"lineCount": 1
}
},
{
"code": "reportUndefinedVariable",
"range": {
"startColumn": 37,
"endColumn": 70,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
Expand Down Expand Up @@ -4225,46 +4257,6 @@
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 8,
"endColumn": 27,
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 34,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportMissingParameterType",
"range": {
"startColumn": 34,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 15,
"endColumn": 19,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 4,
"endColumn": 13,
"lineCount": 1
}
},
{
"code": "reportUnannotatedClassAttribute",
"range": {
Expand Down Expand Up @@ -15135,6 +15127,14 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 4,
"endColumn": 16,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
Expand Down Expand Up @@ -15945,6 +15945,14 @@
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
"startColumn": 4,
"endColumn": 12,
"lineCount": 1
}
},
{
"code": "reportUnknownParameterType",
"range": {
Expand Down Expand Up @@ -15993,6 +16001,14 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 4,
"endColumn": 10,
"lineCount": 1
}
},
{
"code": "reportUnknownArgumentType",
"range": {
Expand All @@ -16016,6 +16032,14 @@
"endColumn": 16,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 11,
"endColumn": 17,
"lineCount": 1
}
}
],
"./pymbolic/mapper/__init__.py": [
Expand Down Expand Up @@ -31971,6 +31995,14 @@
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
"startColumn": 4,
"endColumn": 5,
"lineCount": 1
}
},
{
"code": "reportUnknownVariableType",
"range": {
Expand Down Expand Up @@ -32467,14 +32499,6 @@
"lineCount": 1
}
},
{
"code": "reportMissingTypeStubs",
"range": {
"startColumn": 11,
"endColumn": 23,
"lineCount": 1
}
},
{
"code": "reportAny",
"range": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
. ./ci-support-v0
build_py_project_in_venv
pip install -e .[test]
python -m pip install numpy pexpect sympy scipy
python -m pip install numpy pexpect sympy scipy scipy-stubs
python -m pip install basedpyright
basedpyright

Expand Down
47 changes: 33 additions & 14 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from urllib.request import urlopen


_conf_url = \
"https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py"
_conf_url = "https://raw.githubusercontent.com/inducer/sphinxconfig/main/sphinxconfig.py"
with urlopen(_conf_url) as _inf:
exec(compile(_inf.read(), _conf_url, "exec"), globals())

Expand All @@ -28,28 +27,48 @@
"constantdict":
("https://matthiasdiener.github.io/constantdict/", None)
}

autodoc_type_aliases = {
"Expression": "Expression",
"ArithmeticExpression": "ArithmeticExpression",
}


import sys


nitpick_ignore_regex = [
# Avoids this error in pymbolic.typing.
# <unknown>:1: WARNING: py:class reference target not found: ExpressionNode [ref.class] # noqa: E501
# Understandable, because typing can't import primitives, which would be needed
# to resolve the reference.
["py:class", r"ExpressionNode"],
["py:class", r"_Expression"],
["py:class", r"p\.AlgebraicLeaf"],

# Sphinx started complaining about these in 8.2.1(-ish)
# -AK, 2025-02-24
["py:class", r"TypeAliasForwardRef"],
Comment on lines 37 to 39
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still seems to stick around. At least in the missing-reference call, the node that corresponds to this just says TypeAliasForwardRef with no information about what it's forwarding to.. so we can't dig that out :\

]

sphinxconfig_missing_reference_aliases = {
# numpy
"NDArray": "obj:numpy.typing.NDArray",
"DTypeLike": "obj:numpy.typing.DTypeLike",
"np.inexact": "class:numpy.inexact",
"np.generic": "class:numpy.generic",
# pytools typing
"T": "class:pytools.T",
"ShapeT": "class:pytools.obj_array.ShapeT",
"ObjectArray": "class:pytools.obj_array.ObjectArray",
"ObjectArray1D": "class:pytools.obj_array.ObjectArray",
# pymbolic typing
"ArithmeticExpression": "data:pymbolic.typing.ArithmeticExpression",
"Expression": "data:pymbolic.typing.Expression",
"p.AlgebraicLeaf": "class:pymbolic.primitives.AlgebraicLeaf",
"ExpressionNode": "class:pymbolic.primitives.ExpressionNode",
"_Expression": "class:pymbolic.primitives.ExpressionNode",
"Lookup": "class:pymbolic.primitives.Lookup",
"LogicalAnd": "class:pymbolic.primitives.LogicalAnd",
"LogicalOr": "class:pymbolic.primitives.LogicalOr",
"LogicalNot": "class:pymbolic.primitives.LogicalNot",
"Comparison": "class:pymbolic.primitives.Comparison",
}


def setup(app):
app.connect("missing-reference", process_autodoc_missing_reference) # noqa: F821


import sys


sys._BUILDING_SPHINX_DOCS = True
14 changes: 0 additions & 14 deletions pymbolic/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,6 @@
.. class:: _CanMultiplyT

A type variable for a type that supports multiplication.

.. class:: NDArray

See :data:`numpy.typing.NDArray`.

.. currentmodule:: np

.. class:: generic

See :class:`numpy.generic`.

.. class:: inexact

See :class:`numpy.inexact`.
"""

from __future__ import annotations
Expand Down
7 changes: 0 additions & 7 deletions pymbolic/geometric_algebra/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,6 @@
.. literalinclude:: ../test/test_pymbolic.py
:start-after: START_GA_TEST
:end-before: END_GA_TEST

References
----------

.. class:: DTypeLike

See :data:`numpy.typing.DTypeLike`.
"""


Expand Down
Loading
Loading