diff --git a/.basedpyright/baseline.json b/.basedpyright/baseline.json index f9aa7494..0631e068 100644 --- a/.basedpyright/baseline.json +++ b/.basedpyright/baseline.json @@ -237,46 +237,6 @@ } ], "./pymbolic/__init__.py": [ - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 35, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 67, - "endColumn": 71, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 32, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 58, - "endColumn": 64, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 12, - "lineCount": 1 - } - }, { "code": "reportUnknownVariableType", "range": { @@ -2196,566 +2156,300 @@ } } ], - "./pymbolic/functions.py": [ + "./pymbolic/geometric_algebra/__init__.py": [ { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 50, + "endColumn": 72, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 52, + "endColumn": 55, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 55, - "endColumn": 59, + "startColumn": 12, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 15, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 15, + "endColumn": 83, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 55, - "endColumn": 59, + "startColumn": 15, + "endColumn": 85, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportOperatorIssue", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 16, + "endColumn": 73, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 15, + "endColumn": 78, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 55, - "endColumn": 59, + "startColumn": 15, + "endColumn": 80, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 45, + "endColumn": 72, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportImplicitOverride", "range": { "startColumn": 8, - "endColumn": 9, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 55, - "endColumn": 59, + "startColumn": 4, + "endColumn": 35, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 16, + "endColumn": 19, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 9, + "startColumn": 27, + "endColumn": 30, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 55, - "endColumn": 59, + "startColumn": 19, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 19, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 55, + "endColumn": 65, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 56, - "endColumn": 60, + "startColumn": 12, + "endColumn": 22, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 26, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 57, + "endColumn": 61, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 56, - "endColumn": 60, + "startColumn": 66, + "endColumn": 76, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 22, + "endColumn": 27, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 9, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 56, - "endColumn": 60, + "startColumn": 22, + "endColumn": 27, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 10, - "endColumn": 11, + "startColumn": 23, + "endColumn": 28, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 10, - "endColumn": 11, + "startColumn": 23, + "endColumn": 28, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 57, - "endColumn": 61, + "startColumn": 27, + "endColumn": 32, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 21, + "endColumn": 26, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 21, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 56, - "endColumn": 60, + "startColumn": 22, + "endColumn": 27, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportMissingParameterType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 22, + "endColumn": 27, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 9, - "endColumn": 10, + "startColumn": 27, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 60, - "endColumn": 67, + "startColumn": 25, + "endColumn": 30, "lineCount": 1 } - } - ], - "./pymbolic/geometric_algebra/__init__.py": [ + }, { - "code": "reportAny", + "code": "reportMissingParameterType", "range": { - "startColumn": 50, - "endColumn": 72, + "startColumn": 25, + "endColumn": 30, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownParameterType", "range": { - "startColumn": 52, - "endColumn": 55, + "startColumn": 26, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportMissingParameterType", "range": { - "startColumn": 12, - "endColumn": 16, + "startColumn": 26, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 15, - "endColumn": 39, + "startColumn": 27, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 15, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 85, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 16, - "endColumn": 73, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 78, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 80, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 45, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 16, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 27, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 19, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 55, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 26, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 57, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 66, - "endColumn": 76, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 27, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 21, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 21, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 27, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 25, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 27, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 30, + "startColumn": 25, + "endColumn": 30, "lineCount": 1 } }, @@ -3489,30 +3183,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 31, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": { @@ -3537,14 +3207,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": { @@ -3569,14 +3231,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": { @@ -3897,6 +3551,14 @@ "lineCount": 1 } }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 8, + "endColumn": 20, + "lineCount": 1 + } + }, { "code": "reportImplicitOverride", "range": { @@ -3905,6 +3567,14 @@ "lineCount": 1 } }, + { + "code": "reportUnknownParameterType", + "range": { + "startColumn": 27, + "endColumn": 31, + "lineCount": 1 + } + }, { "code": "reportMissingParameterType", "range": { @@ -3913,6 +3583,14 @@ "lineCount": 1 } }, + { + "code": "reportUnknownVariableType", + "range": { + "startColumn": 15, + "endColumn": 19, + "lineCount": 1 + } + }, { "code": "reportMissingSuperCall", "range": { @@ -4859,14 +4537,6 @@ } ], "./pymbolic/geometric_algebra/primitives.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, { "code": "reportUnknownParameterType", "range": { @@ -8379,14 +8049,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8403,22 +8065,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8435,22 +8081,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8467,62 +8097,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8539,14 +8113,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8563,78 +8129,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -8651,14 +8145,6 @@ "lineCount": 1 } }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, { "code": "reportUnusedParameter", "range": { @@ -9060,6518 +8546,86 @@ } } ], - "./pymbolic/mapper/analysis.py": [ - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 22, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 18, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 8, - "endColumn": 12, - "lineCount": 1 - } - } - ], "./pymbolic/mapper/c_code.py": [ { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 18, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 12, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 12, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 12, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", + "code": "reportAttributeAccessIssue", "range": { "startColumn": 13, "endColumn": 24, "lineCount": 1 } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 42, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 48, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnusedVariable", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 40, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 39, - "lineCount": 1 - } - }, + } + ], + "./pymbolic/mapper/constant_converter.py": [ { "code": "reportUnknownParameterType", "range": { - "startColumn": 19, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 19, + "startColumn": 23, "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 28, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 36, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 36, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 37, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 28, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 42, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 32, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 32, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 42, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 53, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 29, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 31, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 35, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 35, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 45, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 45, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 40, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 31, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportRedeclaration", - "range": { - "startColumn": 20, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 46, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 50, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 16, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 35, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 39, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 29, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 43, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 31, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 46, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportPossiblyUnboundVariable", - "range": { - "startColumn": 15, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 14, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/collector.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 38, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 67, - "lineCount": 2 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 52, - "endColumn": 64, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 21, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 21, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 78, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 61, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 67, - "endColumn": 70, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/constant_converter.py": [ - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 38, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 53, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 53, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 32, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 15, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 23, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 39, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/constant_folder.py": [ - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 20, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 28, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportAssignmentType", - "range": { - "startColumn": 12, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportAssignmentType", - "range": { - "startColumn": 12, - "endColumn": 51, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/cse_tagger.py": [ - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 20, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 39, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 39, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 66, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 19, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 33, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 19, - "endColumn": 74, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 43, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 11, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 11, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 19, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/dependency.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnusedVariable", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 82, - "lineCount": 1 - } - }, - { - "code": "reportUnsafeMultipleInheritance", - "range": { - "startColumn": 6, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 29, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/differentiator.py": [ - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 31, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 46, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 15, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 15, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 62, - "endColumn": 66, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 37, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 31, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 43, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 28, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 8, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 17, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 17, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 12, - "endColumn": 52, - "lineCount": 5 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 34, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 50, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 50, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 68, - "endColumn": 72, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 38, - "endColumn": 64, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 36, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 29, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 29, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 43, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 52, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 76, - "lineCount": 3 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 17, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 48, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 54, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 35, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 50, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 56, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 38, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 9, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 37, - "lineCount": 2 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 37, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 37, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 29, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 8, - "endColumn": 14, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 44, - "lineCount": 4 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 8, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 48, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 48, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 55, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 55, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 27, - "lineCount": 4 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 18, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 18, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 18, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 18, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 11, - "endColumn": 22, - "lineCount": 3 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 19, - "endColumn": 21, - "lineCount": 3 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 18, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 10, - "endColumn": 20, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/distributor.py": [ - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 39, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 39, - "endColumn": 51, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 54, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 30, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 30, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 48, - "endColumn": 52, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 17, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 17, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 19, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 40, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 16, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 25, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 50, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 66, - "endColumn": 79, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 23, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 20, - "endColumn": 44, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 30, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 30, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 47, - "endColumn": 58, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 46, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 39, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownLambdaType", - "range": { - "startColumn": 42, - "endColumn": 43, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/evaluator.py": [ - { - "code": "reportCallIssue", - "range": { - "startColumn": 15, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 83, - "lineCount": 1 - } - }, - { - "code": "reportCallIssue", - "range": { - "startColumn": 15, - "endColumn": 55, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 55, - "lineCount": 1 - } - }, - { - "code": "reportIndexIssue", - "range": { - "startColumn": 15, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 59, - "lineCount": 1 - } - }, - { - "code": "reportCallIssue", - "range": { - "startColumn": 15, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 19, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 68, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportOperatorIssue", - "range": { - "startColumn": 15, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 69, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportIncompatibleMethodOverride", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportReturnType", - "range": { - "startColumn": 15, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 33, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportReturnType", - "range": { - "startColumn": 15, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportReturnType", - "range": { - "startColumn": 15, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 31, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 44, - "endColumn": 46, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 15, - "endColumn": 54, - "lineCount": 2 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 19, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 62, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 19, - "endColumn": 61, - "lineCount": 1 - } - }, - { - "code": "reportReturnType", - "range": { - "startColumn": 15, - "endColumn": 57, - "lineCount": 1 - } - }, - { - "code": "reportReturnType", - "range": { - "startColumn": 19, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 19, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnsafeMultipleInheritance", - "range": { - "startColumn": 6, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 51, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 51, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportArgumentType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 24, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 51, - "endColumn": 67, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 51, - "endColumn": 67, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/flattener.py": [ - { - "code": "reportUnusedParameter", - "range": { - "startColumn": 37, - "endColumn": 41, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/flop_counter.py": [ - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/graphviz.py": [ - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 21, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 13, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 54, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 36, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 44, - "endColumn": 54, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 21, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 43, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 21, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 20, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 46, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 46, - "endColumn": 53, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 11, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 16, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 28, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 28, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 14, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 23, - "endColumn": 41, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 34, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 22, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 24, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 29, - "endColumn": 33, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 22, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 54, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 66, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 54, - "endColumn": 65, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 66, - "endColumn": 70, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 20, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 39, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 17, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 17, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 20, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 23, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 26, - "endColumn": 39, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 40, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 18, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 20, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 32, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 36, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportImplicitOverride", - "range": { - "startColumn": 8, - "endColumn": 32, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 39, - "endColumn": 43, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 12, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 45, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 12, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 15, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 26, - "endColumn": 30, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 17, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 17, - "endColumn": 27, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 8, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 24, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 23, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 13, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 13, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/optimize.py": [ - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 31, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 31, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 36, - "endColumn": 50, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 24, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportMissingTypeArgument", - "range": { - "startColumn": 27, - "endColumn": 35, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 4, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 13, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 13, - "endColumn": 16, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 20, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 20, - "endColumn": 26, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 27, - "endColumn": 37, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 32, - "endColumn": 47, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 11, - "endColumn": 10, - "lineCount": 4 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 16, - "endColumn": 19, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 14, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 25, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportAny", - "range": { - "startColumn": 31, - "endColumn": 49, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 42, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 44, - "endColumn": 48, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", + "code": "reportMissingParameterType", "range": { - "startColumn": 12, - "endColumn": 16, + "startColumn": 23, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 24, - "endColumn": 35, + "startColumn": 34, + "endColumn": 46, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportMissingParameterType", "range": { - "startColumn": 24, - "endColumn": 35, + "startColumn": 34, + "endColumn": 46, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 43, - "endColumn": 56, + "startColumn": 53, + "endColumn": 65, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportMissingParameterType", "range": { - "startColumn": 23, - "endColumn": 32, + "startColumn": 53, + "endColumn": 65, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 23, - "endColumn": 32, + "startColumn": 13, + "endColumn": 22, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 34, - "endColumn": 45, + "startColumn": 32, + "endColumn": 50, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 34, - "endColumn": 45, + "startColumn": 8, + "endColumn": 25, "lineCount": 1 } }, @@ -15579,7 +8633,15 @@ "code": "reportUnannotatedClassAttribute", "range": { "startColumn": 13, - "endColumn": 22, + "endColumn": 25, + "lineCount": 1 + } + }, + { + "code": "reportUnknownMemberType", + "range": { + "startColumn": 8, + "endColumn": 25, "lineCount": 1 } }, @@ -15587,15 +8649,15 @@ "code": "reportUnannotatedClassAttribute", "range": { "startColumn": 13, - "endColumn": 24, + "endColumn": 25, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownParameterType", "range": { "startColumn": 8, - "endColumn": 18, + "endColumn": 20, "lineCount": 1 } }, @@ -15603,1048 +8665,1052 @@ "code": "reportImplicitOverride", "range": { "startColumn": 8, - "endColumn": 18, + "endColumn": 20, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 25, - "endColumn": 29, + "startColumn": 27, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportMissingParameterType", "range": { - "startColumn": 15, - "endColumn": 73, - "lineCount": 5 + "startColumn": 27, + "endColumn": 31, + "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 37, - "endColumn": 40, + "startColumn": 11, + "endColumn": 20, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 44, - "endColumn": 53, + "startColumn": 19, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportUnknownVariableType", "range": { - "startColumn": 49, - "endColumn": 53, + "startColumn": 19, + "endColumn": 42, "lineCount": 1 } }, { "code": "reportUnknownVariableType", "range": { - "startColumn": 40, - "endColumn": 42, + "startColumn": 8, + "endColumn": 12, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 46, - "endColumn": 59, + "startColumn": 15, + "endColumn": 24, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 51, - "endColumn": 59, + "startColumn": 15, + "endColumn": 19, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 53, - "endColumn": 59, + "startColumn": 15, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 26, - "endColumn": 36, + "startColumn": 23, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 26, - "endColumn": 36, + "startColumn": 23, + "endColumn": 46, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 38, - "endColumn": 50, + "startColumn": 23, + "endColumn": 27, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 38, - "endColumn": 50, + "startColumn": 19, + "endColumn": 39, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/constant_folder.py": [ { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownVariableType", "range": { - "startColumn": 13, - "endColumn": 23, + "startColumn": 19, + "endColumn": 33, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportArgumentType", "range": { - "startColumn": 13, - "endColumn": 25, + "startColumn": 41, + "endColumn": 46, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/cse_tagger.py": [ { - "code": "reportImplicitOverride", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 18, + "startColumn": 19, + "endColumn": 74, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/dependency.py": [ { - "code": "reportAny", + "code": "reportUnknownMemberType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 19, + "endColumn": 53, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 28, - "endColumn": 31, + "startColumn": 19, + "endColumn": 82, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnsafeMultipleInheritance", "range": { - "startColumn": 28, - "endColumn": 31, + "startColumn": 6, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 33, - "endColumn": 37, + "startColumn": 8, + "endColumn": 29, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/differentiator.py": [ { - "code": "reportMissingParameterType", + "code": "reportArgumentType", "range": { - "startColumn": 33, - "endColumn": 37, + "startColumn": 37, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 28, - "endColumn": 31, + "startColumn": 19, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportArgumentType", "range": { - "startColumn": 28, - "endColumn": 31, + "startColumn": 33, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportReturnType", "range": { - "startColumn": 29, - "endColumn": 32, + "startColumn": 15, + "endColumn": 21, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/distributor.py": [ { - "code": "reportUnknownParameterType", + "code": "reportArgumentType", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 20, + "endColumn": 58, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/evaluator.py": [ { - "code": "reportMissingParameterType", + "code": "reportCallIssue", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 15, + "endColumn": 83, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 34, - "endColumn": 39, + "startColumn": 15, + "endColumn": 83, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportCallIssue", "range": { - "startColumn": 34, - "endColumn": 39, + "startColumn": 15, + "endColumn": 55, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 39, - "endColumn": 43, + "startColumn": 15, + "endColumn": 55, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportIndexIssue", "range": { - "startColumn": 30, - "endColumn": 35, + "startColumn": 15, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownVariableType", "range": { - "startColumn": 29, - "endColumn": 79, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 31, - "endColumn": 44, + "startColumn": 15, + "endColumn": 59, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportCallIssue", "range": { - "startColumn": 27, - "endColumn": 40, + "startColumn": 15, + "endColumn": 62, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 24, - "endColumn": 28, + "startColumn": 15, + "endColumn": 62, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportArgumentType", "range": { - "startColumn": 24, - "endColumn": 28, + "startColumn": 19, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportOperatorIssue", "range": { - "startColumn": 8, - "endColumn": 12, + "startColumn": 15, + "endColumn": 68, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 16, - "endColumn": 25, + "startColumn": 15, + "endColumn": 68, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportOperatorIssue", "range": { - "startColumn": 26, - "endColumn": 40, + "startColumn": 15, + "endColumn": 69, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 26, - "endColumn": 40, + "startColumn": 15, + "endColumn": 69, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportOperatorIssue", "range": { - "startColumn": 13, - "endColumn": 27, + "startColumn": 15, + "endColumn": 68, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 18, + "startColumn": 15, + "endColumn": 68, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportOperatorIssue", "range": { - "startColumn": 25, - "endColumn": 29, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 23, - "endColumn": 32, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportOperatorIssue", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportUnknownVariableType", "range": { - "startColumn": 36, - "endColumn": 40, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportOperatorIssue", "range": { - "startColumn": 25, - "endColumn": 29, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportAttributeAccessIssue", + "code": "reportUnknownVariableType", "range": { - "startColumn": 25, - "endColumn": 29, + "startColumn": 15, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportOperatorIssue", "range": { - "startColumn": 16, - "endColumn": 37, + "startColumn": 15, + "endColumn": 36, "lineCount": 1 } }, { "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 25, + "startColumn": 15, + "endColumn": 36, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 16, - "endColumn": 22, + "startColumn": 15, + "endColumn": 69, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 33, - "endColumn": 39, + "startColumn": 15, + "endColumn": 69, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 16, - "endColumn": 37, + "startColumn": 15, + "endColumn": 70, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportIncompatibleMethodOverride", "range": { - "startColumn": 20, - "endColumn": 30, + "startColumn": 8, + "endColumn": 23, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportIncompatibleMethodOverride", "range": { - "startColumn": 49, - "endColumn": 77, + "startColumn": 8, + "endColumn": 22, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportIncompatibleMethodOverride", "range": { - "startColumn": 12, - "endColumn": 17, + "startColumn": 8, + "endColumn": 23, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportReturnType", "range": { - "startColumn": 28, - "endColumn": 39, + "startColumn": 15, + "endColumn": 50, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportArgumentType", "range": { - "startColumn": 12, - "endColumn": 16, + "startColumn": 33, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportReturnType", "range": { - "startColumn": 12, - "endColumn": 16, + "startColumn": 15, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportReturnType", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 15, + "endColumn": 48, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 25, - "endColumn": 71, - "lineCount": 3 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 34, - "endColumn": 43, + "startColumn": 31, + "endColumn": 33, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 34, - "endColumn": 43, + "startColumn": 44, + "endColumn": 46, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 54, - "endColumn": 63, - "lineCount": 1 + "startColumn": 15, + "endColumn": 54, + "lineCount": 2 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 54, - "endColumn": 70, + "startColumn": 15, + "endColumn": 62, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportArgumentType", "range": { - "startColumn": 55, - "endColumn": 64, + "startColumn": 19, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 55, - "endColumn": 70, + "startColumn": 15, + "endColumn": 62, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportArgumentType", "range": { - "startColumn": 12, - "endColumn": 16, + "startColumn": 19, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportReturnType", "range": { - "startColumn": 72, - "endColumn": 76, + "startColumn": 15, + "endColumn": 57, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportReturnType", "range": { - "startColumn": 16, - "endColumn": 20, + "startColumn": 19, + "endColumn": 22, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 77, - "endColumn": 81, + "startColumn": 19, + "endColumn": 47, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnsafeMultipleInheritance", "range": { - "startColumn": 12, - "endColumn": 34, + "startColumn": 6, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownMemberType", "range": { "startColumn": 8, - "endColumn": 15, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownMemberType", "range": { - "startColumn": 30, - "endColumn": 37, + "startColumn": 8, + "endColumn": 33, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportArgumentType", "range": { - "startColumn": 12, - "endColumn": 20, + "startColumn": 21, + "endColumn": 25, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 22, - "endColumn": 27, + "startColumn": 24, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 45, - "endColumn": 53, - "lineCount": 1 - } - } - ], - "./pymbolic/mapper/persistent_hash.py": [ - { - "code": "reportMissingTypeArgument", + "code": "reportAny", "range": { - "startColumn": 31, - "endColumn": 41, + "startColumn": 24, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 23, - "endColumn": 31, + "startColumn": 51, + "endColumn": 67, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 23, - "endColumn": 31, + "startColumn": 51, + "endColumn": 67, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportArgumentType", "range": { - "startColumn": 13, - "endColumn": 21, + "startColumn": 21, + "endColumn": 25, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 13, + "startColumn": 24, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 20, - "endColumn": 24, + "startColumn": 24, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 20, - "endColumn": 24, + "startColumn": 51, + "endColumn": 67, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 28, + "startColumn": 51, + "endColumn": 67, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/flattener.py": [ { - "code": "reportUnknownArgumentType", + "code": "reportUnusedParameter", "range": { - "startColumn": 34, - "endColumn": 38, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/optimize.py": [ { - "code": "reportImplicitOverride", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 20, + "startColumn": 4, + "endColumn": 12, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 27, - "endColumn": 31, + "startColumn": 13, + "endColumn": 16, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 27, - "endColumn": 31, + "startColumn": 13, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 8, - "endColumn": 28, + "startColumn": 20, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 29, - "endColumn": 38, + "startColumn": 20, + "endColumn": 26, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 29, - "endColumn": 45, + "startColumn": 27, + "endColumn": 37, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 20, + "startColumn": 32, + "endColumn": 47, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 27, - "endColumn": 31, - "lineCount": 1 + "startColumn": 11, + "endColumn": 10, + "lineCount": 4 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 27, - "endColumn": 31, + "startColumn": 16, + "endColumn": 19, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 28, + "startColumn": 14, + "endColumn": 24, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 34, - "endColumn": 38, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportAny", "range": { - "startColumn": 8, - "endColumn": 22, + "startColumn": 31, + "endColumn": 49, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 29, - "endColumn": 33, + "startColumn": 39, + "endColumn": 42, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 29, - "endColumn": 33, + "startColumn": 44, + "endColumn": 48, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 11, - "endColumn": 21, + "startColumn": 12, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 22, - "endColumn": 26, + "startColumn": 24, + "endColumn": 35, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 21, - "endColumn": 30, + "startColumn": 24, + "endColumn": 35, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 21, - "endColumn": 30, + "startColumn": 43, + "endColumn": 56, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 12, + "startColumn": 23, "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 38, - "endColumn": 51, + "startColumn": 23, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 38, - "endColumn": 51, + "startColumn": 34, + "endColumn": 45, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 21, - "endColumn": 31, + "startColumn": 34, + "endColumn": 45, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 21, - "endColumn": 31, + "startColumn": 13, + "endColumn": 22, "lineCount": 1 } - } - ], - "./pymbolic/mapper/stringifier.py": [ + }, { - "code": "reportUnknownParameterType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 43, - "endColumn": 47, + "startColumn": 13, + "endColumn": 24, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportAny", "range": { - "startColumn": 43, - "endColumn": 47, + "startColumn": 8, + "endColumn": 18, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportImplicitOverride", "range": { - "startColumn": 50, - "endColumn": 54, + "startColumn": 8, + "endColumn": 18, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 50, - "endColumn": 54, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 58, - "endColumn": 64, - "lineCount": 1 + "startColumn": 15, + "endColumn": 73, + "lineCount": 5 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 58, - "endColumn": 64, + "startColumn": 37, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 27, + "startColumn": 44, + "endColumn": 53, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 30, - "endColumn": 40, + "startColumn": 49, + "endColumn": 53, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 26, - "endColumn": 30, + "startColumn": 40, + "endColumn": 42, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 33, - "endColumn": 37, + "startColumn": 46, + "endColumn": 59, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 33, - "endColumn": 37, + "startColumn": 51, + "endColumn": 59, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownMemberType", "range": { - "startColumn": 41, - "endColumn": 47, + "startColumn": 53, + "endColumn": 59, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 9, - "endColumn": 13, + "startColumn": 26, + "endColumn": 36, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 9, - "endColumn": 13, + "startColumn": 26, + "endColumn": 36, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 10, - "endColumn": 16, + "startColumn": 38, + "endColumn": 50, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 10, - "endColumn": 16, + "startColumn": 38, + "endColumn": 50, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 12, - "endColumn": 31, + "startColumn": 13, + "endColumn": 23, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 52, - "endColumn": 62, + "startColumn": 13, + "endColumn": 25, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportImplicitOverride", "range": { - "startColumn": 35, - "endColumn": 54, + "startColumn": 8, + "endColumn": 18, "lineCount": 1 } }, { "code": "reportAny", "range": { - "startColumn": 57, - "endColumn": 61, + "startColumn": 12, + "endColumn": 25, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownParameterType", "range": { - "startColumn": 65, - "endColumn": 71, + "startColumn": 28, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportMissingParameterType", + "range": { + "startColumn": 28, + "endColumn": 31, + "lineCount": 1 + } + }, + { + "code": "reportUnknownParameterType", "range": { "startColumn": 33, "endColumn": 37, @@ -16652,225 +9718,225 @@ } }, { - "code": "reportAny", + "code": "reportMissingParameterType", "range": { - "startColumn": 41, - "endColumn": 47, + "startColumn": 33, + "endColumn": 37, "lineCount": 1 } }, { "code": "reportUnknownParameterType", "range": { - "startColumn": 14, - "endColumn": 18, + "startColumn": 28, + "endColumn": 31, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 14, - "endColumn": 18, + "startColumn": 28, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 16, + "startColumn": 29, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 19, - "endColumn": 40, + "startColumn": 28, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportMissingParameterType", "range": { - "startColumn": 33, - "endColumn": 41, + "startColumn": 28, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 67, - "endColumn": 81, + "startColumn": 34, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportMissingParameterType", "range": { - "startColumn": 15, - "endColumn": 62, + "startColumn": 34, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 39, + "endColumn": 43, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 24, - "endColumn": 37, + "startColumn": 30, + "endColumn": 35, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 29, + "endColumn": 79, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportAny", "range": { - "startColumn": 4, - "endColumn": 29, + "startColumn": 31, + "endColumn": 44, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 27, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 24, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 24, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 8, + "endColumn": 12, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 12, + "startColumn": 16, "endColumn": 25, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 20, - "endColumn": 33, + "startColumn": 37, + "endColumn": 41, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownParameterType", "range": { - "startColumn": 4, - "endColumn": 14, + "startColumn": 26, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportArgumentType", + "code": "reportMissingParameterType", "range": { - "startColumn": 25, - "endColumn": 32, + "startColumn": 26, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 49, - "endColumn": 52, + "startColumn": 13, + "endColumn": 27, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportImplicitOverride", "range": { - "startColumn": 58, - "endColumn": 61, + "startColumn": 8, + "endColumn": 18, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportMissingParameterType", "range": { - "startColumn": 69, - "endColumn": 72, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 20, - "endColumn": 21, + "startColumn": 23, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 23, - "endColumn": 26, + "startColumn": 28, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 8, - "endColumn": 12, + "startColumn": 36, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportMissingTypeArgument", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 14, - "endColumn": 25, + "startColumn": 25, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAttributeAccessIssue", "range": { - "startColumn": 15, + "startColumn": 25, "endColumn": 29, "lineCount": 1 } @@ -16878,24 +9944,32 @@ { "code": "reportUnknownMemberType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 16, + "endColumn": 37, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 12, + "startColumn": 8, "endColumn": 25, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAny", "range": { "startColumn": 16, - "endColumn": 31, + "endColumn": 22, + "lineCount": 1 + } + }, + { + "code": "reportAny", + "range": { + "startColumn": 33, + "endColumn": 39, "lineCount": 1 } }, @@ -16903,271 +9977,273 @@ "code": "reportUnknownMemberType", "range": { "startColumn": 16, - "endColumn": 31, + "endColumn": 37, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 21, - "endColumn": 29, + "startColumn": 20, + "endColumn": 30, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 23, - "endColumn": 27, + "startColumn": 49, + "endColumn": 77, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 23, - "endColumn": 27, + "startColumn": 12, + "endColumn": 17, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 29, - "endColumn": 33, + "startColumn": 28, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 15, - "endColumn": 30, + "startColumn": 12, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportAny", "range": { - "startColumn": 15, - "endColumn": 65, + "startColumn": 12, + "endColumn": 16, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 37, - "endColumn": 41, + "startColumn": 28, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportMissingTypeArgument", + "code": "reportAny", "range": { - "startColumn": 48, - "endColumn": 60, - "lineCount": 1 + "startColumn": 25, + "endColumn": 71, + "lineCount": 3 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 29, + "startColumn": 34, + "endColumn": 43, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 16, + "startColumn": 34, + "endColumn": 43, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 23, - "endColumn": 27, + "startColumn": 54, + "endColumn": 63, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 23, - "endColumn": 27, + "startColumn": 54, + "endColumn": 70, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 29, - "endColumn": 33, + "startColumn": 55, + "endColumn": 64, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 15, - "endColumn": 36, + "startColumn": 55, + "endColumn": 70, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportAny", "range": { - "startColumn": 15, - "endColumn": 65, + "startColumn": 12, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportAny", "range": { - "startColumn": 37, - "endColumn": 41, + "startColumn": 72, + "endColumn": 76, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportAny", "range": { - "startColumn": 20, - "endColumn": 38, + "startColumn": 16, + "endColumn": 20, "lineCount": 1 } }, { - "code": "reportRedeclaration", + "code": "reportAny", "range": { - "startColumn": 20, - "endColumn": 38, + "startColumn": 77, + "endColumn": 81, "lineCount": 1 } }, { - "code": "reportOptionalOperand", + "code": "reportUnknownMemberType", "range": { - "startColumn": 30, - "endColumn": 41, + "startColumn": 12, + "endColumn": 34, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportAny", "range": { - "startColumn": 16, - "endColumn": 24, + "startColumn": 8, + "endColumn": 15, "lineCount": 1 } }, { - "code": "reportArgumentType", + "code": "reportAny", "range": { - "startColumn": 39, - "endColumn": 47, + "startColumn": 30, + "endColumn": 37, "lineCount": 1 } }, { - "code": "reportPossiblyUnboundVariable", + "code": "reportUnknownVariableType", "range": { - "startColumn": 39, - "endColumn": 47, + "startColumn": 12, + "endColumn": 20, "lineCount": 1 } }, { - "code": "reportArgumentType", + "code": "reportAny", "range": { - "startColumn": 12, - "endColumn": 40, + "startColumn": 22, + "endColumn": 27, "lineCount": 1 } }, { - "code": "reportPossiblyUnboundVariable", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 43, - "endColumn": 51, + "startColumn": 45, + "endColumn": 53, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/persistent_hash.py": [ { - "code": "reportArgumentType", + "code": "reportMissingTypeArgument", "range": { "startColumn": 31, - "endColumn": 39, + "endColumn": 41, "lineCount": 1 } }, { - "code": "reportPossiblyUnboundVariable", + "code": "reportUnknownParameterType", "range": { - "startColumn": 31, - "endColumn": 39, + "startColumn": 23, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportReturnType", + "code": "reportMissingParameterType", "range": { - "startColumn": 15, - "endColumn": 23, + "startColumn": 23, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 15, - "endColumn": 23, + "startColumn": 13, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportPossiblyUnboundVariable", + "code": "reportImplicitOverride", "range": { - "startColumn": 15, - "endColumn": 23, + "startColumn": 8, + "endColumn": 13, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportUnknownParameterType", "range": { - "startColumn": 16, + "startColumn": 20, "endColumn": 24, "lineCount": 1 } }, { - "code": "reportAny", + "code": "reportMissingParameterType", "range": { - "startColumn": 26, - "endColumn": 33, + "startColumn": 20, + "endColumn": 24, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 23, - "endColumn": 30, + "startColumn": 8, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 13, - "endColumn": 20, + "startColumn": 34, + "endColumn": 38, "lineCount": 1 } }, @@ -17175,71 +10251,71 @@ "code": "reportImplicitOverride", "range": { "startColumn": 8, - "endColumn": 15, + "endColumn": 20, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownParameterType", "range": { - "startColumn": 8, - "endColumn": 19, + "startColumn": 27, + "endColumn": 31, "lineCount": 1 } }, { "code": "reportMissingParameterType", "range": { - "startColumn": 23, - "endColumn": 30, + "startColumn": 27, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnannotatedClassAttribute", + "code": "reportUnknownMemberType", "range": { - "startColumn": 13, - "endColumn": 20, + "startColumn": 8, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 15, + "startColumn": 29, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 29, + "endColumn": 45, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportImplicitOverride", "range": { - "startColumn": 28, - "endColumn": 32, + "startColumn": 8, + "endColumn": 20, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 16, - "endColumn": 32, + "startColumn": 27, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 16, - "endColumn": 32, + "startColumn": 27, + "endColumn": 31, "lineCount": 1 } }, @@ -17247,20 +10323,20 @@ "code": "reportUnknownMemberType", "range": { "startColumn": 8, - "endColumn": 22, + "endColumn": 28, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 35, - "endColumn": 44, + "startColumn": 34, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportImplicitOverride", "range": { "startColumn": 8, "endColumn": 22, @@ -17268,41 +10344,49 @@ } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownParameterType", + "range": { + "startColumn": 29, + "endColumn": 33, + "lineCount": 1 + } + }, + { + "code": "reportMissingParameterType", "range": { - "startColumn": 53, - "endColumn": 58, + "startColumn": 29, + "endColumn": 33, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 64, - "endColumn": 69, + "startColumn": 11, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 19, + "startColumn": 22, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnreachable", + "code": "reportUnknownMemberType", "range": { - "startColumn": 16, - "endColumn": 22, - "lineCount": 7 + "startColumn": 21, + "endColumn": 30, + "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 16, + "startColumn": 21, "endColumn": 30, "lineCount": 1 } @@ -17310,200 +10394,202 @@ { "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 20, + "startColumn": 12, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 26, - "endColumn": 33, + "startColumn": 38, + "endColumn": 51, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 21, + "startColumn": 38, + "endColumn": 51, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 22, + "startColumn": 21, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 23, + "startColumn": 21, + "endColumn": 31, "lineCount": 1 } - }, + } + ], + "./pymbolic/mapper/stringifier.py": [ { - "code": "reportImplicitOverride", + "code": "reportUnknownParameterType", "range": { - "startColumn": 8, - "endColumn": 23, + "startColumn": 22, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportMissingParameterType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 22, + "endColumn": 26, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { "startColumn": 8, - "endColumn": 19, + "endColumn": 14, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportCallIssue", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 33, + "endColumn": 37, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportArgumentType", "range": { - "startColumn": 8, - "endColumn": 17, + "startColumn": 28, + "endColumn": 47, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 15, + "startColumn": 15, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportAssignmentType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 52, + "endColumn": 85, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 15, + "startColumn": 19, + "endColumn": 40, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportArgumentType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 25, + "endColumn": 32, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 8, - "endColumn": 21, + "startColumn": 49, + "endColumn": 52, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 21, + "startColumn": 58, + "endColumn": 61, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 24, - "endColumn": 37, + "startColumn": 69, + "endColumn": 72, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 23, + "startColumn": 20, + "endColumn": 21, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 22, + "startColumn": 23, + "endColumn": 26, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 15, + "endColumn": 30, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 23, + "startColumn": 15, + "endColumn": 65, "lineCount": 1 } }, { "code": "reportUnknownMemberType", "range": { - "startColumn": 12, - "endColumn": 25, + "startColumn": 8, + "endColumn": 29, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportIncompatibleMethodOverride", "range": { "startColumn": 8, - "endColumn": 22, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownMemberType", "range": { - "startColumn": 8, - "endColumn": 24, + "startColumn": 15, + "endColumn": 36, "lineCount": 1 } }, { - "code": "reportImplicitOverride", + "code": "reportUnknownVariableType", "range": { - "startColumn": 8, - "endColumn": 22, + "startColumn": 15, + "endColumn": 71, "lineCount": 1 } } @@ -18364,184 +11450,104 @@ { "code": "reportUnknownParameterType", "range": { - "startColumn": 8, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnannotatedClassAttribute", - "range": { - "startColumn": 4, - "endColumn": 17, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 14, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 14, - "endColumn": 24, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportMissingParameterType", - "range": { - "startColumn": 26, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 31, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 33, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 4, - "endColumn": 12, - "lineCount": 1 - } - }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 13, - "endColumn": 22, + "startColumn": 8, + "endColumn": 28, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 13, - "endColumn": 22, + "startColumn": 15, + "endColumn": 17, "lineCount": 1 } }, { - "code": "reportUnknownParameterType", + "code": "reportUnannotatedClassAttribute", "range": { - "startColumn": 24, - "endColumn": 35, + "startColumn": 4, + "endColumn": 17, "lineCount": 1 } }, { - "code": "reportMissingParameterType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 24, - "endColumn": 35, + "startColumn": 14, + "endColumn": 24, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportMissingParameterType", "range": { - "startColumn": 15, + "startColumn": 14, "endColumn": 24, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportUnknownParameterType", "range": { - "startColumn": 15, - "endColumn": 51, + "startColumn": 26, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnknownVariableType", + "code": "reportMissingParameterType", "range": { - "startColumn": 8, - "endColumn": 16, + "startColumn": 26, + "endColumn": 31, "lineCount": 1 } }, { - "code": "reportUnknownMemberType", + "code": "reportUnknownArgumentType", "range": { - "startColumn": 19, - "endColumn": 39, + "startColumn": 21, + "endColumn": 31, "lineCount": 1 } }, { "code": "reportUnknownArgumentType", "range": { - "startColumn": 51, - "endColumn": 62, + "startColumn": 33, + "endColumn": 38, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 32, - "endColumn": 41, + "startColumn": 15, + "endColumn": 51, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownVariableType", "range": { - "startColumn": 43, - "endColumn": 54, + "startColumn": 8, + "endColumn": 16, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportUnknownMemberType", "range": { - "startColumn": 20, - "endColumn": 29, + "startColumn": 19, + "endColumn": 39, "lineCount": 1 } }, { - "code": "reportUnknownArgumentType", + "code": "reportArgumentType", "range": { - "startColumn": 31, - "endColumn": 42, + "startColumn": 39, + "endColumn": 50, "lineCount": 1 } }, @@ -18947,14 +11953,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, { "code": "reportIncompatibleMethodOverride", "range": { @@ -19131,22 +12129,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 19, - "endColumn": 38, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 19, - "endColumn": 62, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": { @@ -19179,14 +12161,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownParameterType", - "range": { - "startColumn": 8, - "endColumn": 15, - "lineCount": 1 - } - }, { "code": "reportIncompatibleMethodOverride", "range": { @@ -19211,14 +12185,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 15, - "endColumn": 35, - "lineCount": 1 - } - }, { "code": "reportUnknownArgumentType", "range": { @@ -19786,14 +12752,6 @@ "endColumn": 17, "lineCount": 1 } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 10, - "endColumn": 34, - "lineCount": 1 - } } ], "./pymbolic/traits.py": [ @@ -20751,14 +13709,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 25, - "endColumn": 31, - "lineCount": 1 - } - }, { "code": "reportArgumentType", "range": { @@ -21159,38 +14109,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 18, - "endColumn": 25, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 39, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 39, - "endColumn": 56, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 41, - "endColumn": 48, - "lineCount": 1 - } - }, { "code": "reportAny", "range": { @@ -22055,94 +14973,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 47, - "endColumn": 60, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 27, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 21, - "endColumn": 28, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 22, - "endColumn": 29, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 10, - "lineCount": 1 - } - }, - { - "code": "reportUnknownMemberType", - "range": { - "startColumn": 27, - "endColumn": 34, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 47, - "endColumn": 60, - "lineCount": 1 - } - }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 4, - "endColumn": 15, - "lineCount": 1 - } - }, - { - "code": "reportUnknownArgumentType", - "range": { - "startColumn": 21, - "endColumn": 32, - "lineCount": 1 - } - }, { "code": "reportArgumentType", "range": { @@ -22719,14 +15549,6 @@ "lineCount": 1 } }, - { - "code": "reportUnknownVariableType", - "range": { - "startColumn": 41, - "endColumn": 54, - "lineCount": 1 - } - }, { "code": "reportUnknownParameterType", "range": { diff --git a/pymbolic/functions.py b/pymbolic/functions.py index cf81667a..68bbae29 100644 --- a/pymbolic/functions.py +++ b/pymbolic/functions.py @@ -23,49 +23,54 @@ THE SOFTWARE. """ +from typing import TYPE_CHECKING import pymbolic.primitives as p -def sin(x): +if TYPE_CHECKING: + from pymbolic.typing import ArithmeticExpression + + +def sin(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "sin"), (x,)) -def cos(x): +def cos(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "cos"), (x,)) -def tan(x): +def tan(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "tan"), (x,)) -def log(x): +def log(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "log"), (x,)) -def exp(x): +def exp(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "exp"), (x,)) -def sinh(x): +def sinh(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "sinh"), (x,)) -def cosh(x): +def cosh(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "cosh"), (x,)) -def tanh(x): +def tanh(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "tanh"), (x,)) -def expm1(x): +def expm1(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "expm1"), (x,)) -def fabs(x): +def fabs(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "fabs"), (x,)) -def sign(x): +def sign(x: ArithmeticExpression) -> ArithmeticExpression: return p.Call(p.Lookup(p.Variable("math"), "copysign"), (1, x,)) diff --git a/pymbolic/geometric_algebra/primitives.py b/pymbolic/geometric_algebra/primitives.py index 7479da63..67e8ca66 100644 --- a/pymbolic/geometric_algebra/primitives.py +++ b/pymbolic/geometric_algebra/primitives.py @@ -40,7 +40,7 @@ class MultiVectorVariable(Variable): - mapper_method = "map_multivector_variable" + mapper_method: ClassVar[str] = "map_multivector_variable" # {{{ geometric calculus diff --git a/pymbolic/mapper/__init__.py b/pymbolic/mapper/__init__.py index 717435e3..f7e40347 100644 --- a/pymbolic/mapper/__init__.py +++ b/pymbolic/mapper/__init__.py @@ -163,15 +163,14 @@ class Mapper(Generic[ResultT, P]): """ def handle_unsupported_expression(self, - expr: object, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: + expr: p.ExpressionNode, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: """Mapper method that is invoked for :class:`pymbolic.ExpressionNode` subclasses for which a mapper method does not exist in this mapper. """ raise UnsupportedExpressionError( - "{} cannot handle expressions of type {}".format( - type(self), type(expr))) + f"{type(self)} cannot handle expressions of type {type(expr)}") def __call__(self, expr: Expression, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: @@ -223,7 +222,7 @@ def rec_fallback(self, def map_algebraic_leaf(self, expr: p.AlgebraicLeaf, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_variable(self, expr: p.Variable, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: @@ -248,110 +247,110 @@ def map_lookup(self, def map_if(self, expr: p.If, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_sum(self, expr: p.Sum, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_product(self, expr: p.Product, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_rational(self, expr: Rational, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_quotient(self, expr: p.Quotient, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_floor_div(self, expr: p.FloorDiv, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_remainder(self, expr: p.Remainder, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_power(self, expr: p.Power, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_constant(self, expr: object, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_comparison(self, expr: p.Comparison, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_min(self, expr: p.Min, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_max(self, expr: p.Max, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_list(self, expr: list[Expression], /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_tuple(self, expr: tuple[Expression, ...], /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_numpy_array(self, expr: NDArray[np.generic], /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_left_shift(self, expr: p.LeftShift, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_right_shift(self, expr: p.RightShift, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_bitwise_not(self, expr: p.BitwiseNot, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_bitwise_or(self, expr: p.BitwiseOr, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_bitwise_and(self, expr: p.BitwiseAnd, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_bitwise_xor(self, expr: p.BitwiseXor, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_logical_not(self, expr: p.LogicalNot, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_logical_or(self, expr: p.LogicalOr, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_logical_and(self, expr: p.LogicalAnd, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_nan(self, expr: p.NaN, /, *args: P.args, **kwargs: P.kwargs @@ -361,26 +360,26 @@ def map_nan(self, def map_wildcard(self, expr: p.Wildcard, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_dot_wildcard(self, expr: p.DotWildcard, /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_star_wildcard(self, expr: p.StarWildcard, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_function_symbol(self, expr: p.FunctionSymbol, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_multivector(self, expr: MultiVector[ArithmeticExpression], /, *args: P.args, **kwargs: P.kwargs ) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") # def map_common_subexpression deliberately unimplemented to avoid breaking # multiple inheritance with CSE-caching mappers @@ -388,17 +387,17 @@ def map_multivector(self, def map_substitution(self, expr: p.Substitution, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_derivative(self, expr: p.Derivative, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_slice(self, expr: p.Slice, /, *args: P.args, **kwargs: P.kwargs) -> ResultT: - raise NotImplementedError + raise NotImplementedError(f"{type(self).__name__} cannot handle {type(expr)}") def map_foreign(self, expr: object, /, @@ -421,8 +420,7 @@ def map_foreign(self, return self.map_list(cast("list[Expression]", expr), *args, **kwargs) else: raise ValueError( - "{} encountered invalid foreign object: {}".format( - self.__class__, repr(expr))) + f"{type(self)} encountered invalid foreign object: {expr!r}") class _NotInCache: @@ -503,10 +501,7 @@ class CombineMapper(Mapper[ResultT, P]): the current expression, and then call :meth:`combine` on a tuple of results. - .. method:: combine(values) - - Combine the mapped results of multiple expressions (given in *values*) - into a single result, often by summing or taking set unions. + .. automethod:: combine The :class:`pymbolic.mapper.flop_counter.FlopCounter` is a very simple example. (Look at its source for an idea of how to derive from @@ -515,7 +510,10 @@ class CombineMapper(Mapper[ResultT, P]): """ def combine(self, values: Iterable[ResultT], /) -> ResultT: - raise NotImplementedError + """Combine the mapped results of multiple expressions (given in *values*) + into a single result, often by summing or taking set unions. + """ + raise NotImplementedError(type(self).__name__) @override def map_call(self, @@ -1652,7 +1650,7 @@ class CSECachingMapperMixin(ABC, Generic[ResultT, P]): :class:`pymbolic.primitives.CommonSubexpression`, subclasses should implement the following method: - .. method:: map_common_subexpression_uncached(expr) + .. automethod:: map_common_subexpression_uncached This method deliberately does not support extra arguments in mapper dispatch, to avoid spurious dependencies of the cache on these arguments. diff --git a/pymbolic/mapper/analysis.py b/pymbolic/mapper/analysis.py index 6ab1562b..ed69c82e 100644 --- a/pymbolic/mapper/analysis.py +++ b/pymbolic/mapper/analysis.py @@ -23,10 +23,17 @@ THE SOFTWARE. """ +from typing import TYPE_CHECKING + +from typing_extensions import override from pymbolic.mapper import CachedWalkMapper +if TYPE_CHECKING: + from pymbolic.typing import Expression + + __doc__ = """ .. autoclass:: NodeCountMapper .. autofunction:: get_num_nodes @@ -35,7 +42,7 @@ # {{{ NodeCountMapper -class NodeCountMapper(CachedWalkMapper): +class NodeCountMapper(CachedWalkMapper[[]]): """ Counts the number of nodes in an expression tree. Nodes that occur repeatedly as well as :class:`~pymbolic.primitives.CommonSubexpression` @@ -46,18 +53,23 @@ class NodeCountMapper(CachedWalkMapper): The number of nodes. """ + count: int + def __init__(self) -> None: super().__init__() self.count = 0 - def post_visit(self, expr) -> None: + @override + def post_visit(self, expr: object) -> None: self.count += 1 -def get_num_nodes(expr) -> int: - """Returns the number of nodes in *expr*. Nodes that occur - repeatedly as well as :class:`~pymbolic.primitives.CommonSubexpression` - nodes are only counted once.""" +def get_num_nodes(expr: Expression) -> int: + """ + :returns: the number of nodes in *expr*. Nodes that occur + repeatedly as well as :class:`~pymbolic.primitives.CommonSubexpression` + nodes are only counted once. + """ ncm = NodeCountMapper() ncm(expr) diff --git a/pymbolic/mapper/c_code.py b/pymbolic/mapper/c_code.py index 2167faca..7c0df495 100644 --- a/pymbolic/mapper/c_code.py +++ b/pymbolic/mapper/c_code.py @@ -26,7 +26,13 @@ THE SOFTWARE. """ +from typing import TYPE_CHECKING + +from typing_extensions import override + +import pymbolic.primitives as p from pymbolic.mapper.stringifier import ( + PREC_CALL, PREC_LOGICAL_AND, PREC_LOGICAL_OR, PREC_NONE, @@ -35,7 +41,13 @@ ) -class CCodeMapper(SimplifyingSortingStringifyMapper): +if TYPE_CHECKING: + from collections.abc import Iterator, Sequence + + from pymbolic.typing import Expression + + +class CCodeMapper(SimplifyingSortingStringifyMapper[[]]): """Generate C code for expressions, while extracting :class:`pymbolic.primitives.CommonSubexpression` instances. @@ -72,33 +84,47 @@ class CCodeMapper(SimplifyingSortingStringifyMapper): for the ``cse_*`` attributes. """ - def __init__(self, reverse=True, - cse_prefix="_cse", complex_constant_base_type="double", - cse_name_list=None): + cse_prefix: str + cse_to_name: dict[Expression, str] + cse_names: set[str] + cse_name_list: list[tuple[str, str]] + complex_constant_base_type: str + + def __init__(self, + reverse: bool = True, + cse_prefix: str = "_cse", + complex_constant_base_type: str = "double", + cse_name_list: Sequence[tuple[str, str]] | None = None) -> None: if cse_name_list is None: cse_name_list = [] + super().__init__(reverse) self.cse_prefix = cse_prefix self.cse_to_name = {cse: name for name, cse in cse_name_list} - self.cse_names = {cse for name, cse in cse_name_list} - self.cse_name_list = cse_name_list[:] + self.cse_names = {cse for _name, cse in cse_name_list} + self.cse_name_list = list(cse_name_list) self.complex_constant_base_type = complex_constant_base_type - def copy(self, cse_name_list=None): + def copy(self, + cse_name_list: Sequence[tuple[str, str]] | None = None, + ) -> CCodeMapper: if cse_name_list is None: cse_name_list = self.cse_name_list + return CCodeMapper(self.reverse, self.cse_prefix, self.complex_constant_base_type, cse_name_list) - def copy_with_mapped_cses(self, cses_and_values): - return self.copy(self.cse_name_list + cses_and_values) + def copy_with_mapped_cses( + self, cses_and_values: Sequence[tuple[str, str]]) -> CCodeMapper: + return self.copy((*self.cse_name_list, *cses_and_values)) # {{{ mappings - def map_product(self, expr, enclosing_prec): + @override + def map_product(self, expr: p.Product, /, enclosing_prec: int) -> str: from pymbolic.mapper.stringifier import PREC_PRODUCT return self.parenthesize_if_needed( # Spaces prevent '**z' (times dereference z), which @@ -107,28 +133,33 @@ def map_product(self, expr, enclosing_prec): self.join_rec(" * ", expr.children, PREC_PRODUCT), enclosing_prec, PREC_PRODUCT) - def map_constant(self, x, enclosing_prec): + @override + def map_constant(self, x: object, /, enclosing_prec: int) -> str: if isinstance(x, complex): - return "std::complex<{}>({}, {})".format( - self.complex_constant_base_type, - self.map_constant(x.real, PREC_NONE), - self.map_constant(x.imag, PREC_NONE)) + base = self.complex_constant_base_type + real = self.map_constant(x.real, PREC_NONE) + imag = self.map_constant(x.imag, PREC_NONE) + + # NOTE: this will need the include to work + # FIXME: MSVC does not support , so this will not work. + # (AFAIK, it uses a struct instead and does not support arithmetic) + return f"({base} complex)({real} + {imag} * _Imaginary_I)" else: - return SimplifyingSortingStringifyMapper.map_constant( - self, x, enclosing_prec) + return super().map_constant(x, enclosing_prec) - def map_call(self, expr, enclosing_prec): - from pymbolic.mapper.stringifier import PREC_CALL, PREC_NONE - from pymbolic.primitives import Variable - if isinstance(expr.function, Variable): + @override + def map_call(self, expr: p.Call, /, enclosing_prec: int) -> str: + if isinstance(expr.function, p.Variable): func = expr.function.name else: func = self.rec(expr.function, PREC_CALL) return self.format("%s(%s)", - func, self.join_rec(", ", expr.parameters, PREC_NONE)) + func, + self.join_rec(", ", expr.parameters, PREC_NONE)) - def map_power(self, expr, enclosing_prec): + @override + def map_power(self, expr: p.Power, /, enclosing_prec: int) -> str: from pymbolic.mapper.stringifier import PREC_NONE from pymbolic.primitives import is_constant, is_zero if is_constant(expr.exponent): @@ -143,7 +174,8 @@ def map_power(self, expr, enclosing_prec): self.rec(expr.base, PREC_NONE), self.rec(expr.exponent, PREC_NONE)) - def map_floor_div(self, expr, enclosing_prec): + @override + def map_floor_div(self, expr: p.FloorDiv, /, enclosing_prec: int) -> str: # Let's see how bad of an idea this is--sane people would only # apply this to integers, right? @@ -152,22 +184,26 @@ def map_floor_div(self, expr, enclosing_prec): self.rec(expr.numerator, PREC_PRODUCT), self.rec(expr.denominator, PREC_POWER)) # analogous to ^{-1} - def map_logical_not(self, expr, enclosing_prec): - return self.parenthesize_if_needed( - "!" + self.rec(expr.child, PREC_UNARY), - enclosing_prec, PREC_UNARY) + @override + def map_logical_not(self, expr: p.LogicalNot, /, enclosing_prec: int) -> str: + child = self.rec(expr.child, PREC_UNARY) + return self.parenthesize_if_needed(f"!{child}", enclosing_prec, PREC_UNARY) - def map_logical_and(self, expr, enclosing_prec): + @override + def map_logical_and(self, expr: p.LogicalAnd, /, enclosing_prec: int) -> str: return self.parenthesize_if_needed( self.join_rec(" && ", expr.children, PREC_LOGICAL_AND), enclosing_prec, PREC_LOGICAL_AND) - def map_logical_or(self, expr, enclosing_prec): + @override + def map_logical_or(self, expr: p.LogicalOr, /, enclosing_prec: int) -> str: return self.parenthesize_if_needed( self.join_rec(" || ", expr.children, PREC_LOGICAL_OR), enclosing_prec, PREC_LOGICAL_OR) - def map_common_subexpression(self, expr, enclosing_prec): + @override + def map_common_subexpression( + self, expr: p.CommonSubexpression, /, enclosing_prec: int) -> str: try: cse_name = self.cse_to_name[expr.child] except KeyError: @@ -175,22 +211,24 @@ def map_common_subexpression(self, expr, enclosing_prec): cse_str = self.rec(expr.child, PREC_NONE) if expr.prefix is not None: - def generate_cse_names(): - yield self.cse_prefix+"_"+expr.prefix + def generate_cse_names() -> Iterator[str]: + yield f"{self.cse_prefix}_{expr.prefix}" i = 2 while True: - yield self.cse_prefix+"_"+expr.prefix + "_%d" % i + yield f"{self.cse_prefix}_{expr.prefix}_{i}" i += 1 else: - def generate_cse_names(): + def generate_cse_names() -> Iterator[str]: i = 0 while True: - yield self.cse_prefix+str(i) + yield f"{self.cse_prefix}{i}" i += 1 + cse_name = None for cse_name in generate_cse_names(): if cse_name not in self.cse_names: break + assert cse_name is not None self.cse_name_list.append((cse_name, cse_str)) self.cse_to_name[expr.child] = cse_name @@ -200,15 +238,8 @@ def generate_cse_names(): return cse_name - def map_if_positive(self, expr, enclosing_prec): - from pymbolic.mapper.stringifier import PREC_NONE - return self.format("(%s > 0 ? %s : %s)", - self.rec(expr.criterion, PREC_NONE), - self.rec(expr.then, PREC_NONE), - self.rec(expr.else_, PREC_NONE), - ) - - def map_if(self, expr, enclosing_prec): + @override + def map_if(self, expr: p.If, /, enclosing_prec: int) -> str: from pymbolic.mapper.stringifier import PREC_NONE return self.format("(%s ? %s : %s)", self.rec(expr.condition, PREC_NONE), diff --git a/pymbolic/mapper/coefficient.py b/pymbolic/mapper/coefficient.py index e13f327c..bfe44cd7 100644 --- a/pymbolic/mapper/coefficient.py +++ b/pymbolic/mapper/coefficient.py @@ -43,7 +43,7 @@ def __init__(self, target_names: Collection[str] | None = None) -> None: self.target_names = target_names @override - def map_sum(self, expr: p.Sum) -> CoeffsT: + def map_sum(self, expr: p.Sum, /) -> CoeffsT: stride_dicts = [self.rec(ch) for ch in expr.children] result: dict[p.AlgebraicLeaf | Literal[1], ArithmeticExpression] = {} @@ -57,7 +57,7 @@ def map_sum(self, expr: p.Sum) -> CoeffsT: return result @override - def map_product(self, expr: p.Product) -> CoeffsT: + def map_product(self, expr: p.Product, /) -> CoeffsT: children_coeffs = [self.rec(child) for child in expr.children] idx_of_child_with_vars = None @@ -66,8 +66,7 @@ def map_product(self, expr: p.Product) -> CoeffsT: if k != 1: if (idx_of_child_with_vars is not None and idx_of_child_with_vars != i): - raise RuntimeError( - "nonlinear expression") + raise RuntimeError("nonlinear expression") idx_of_child_with_vars = i other_coeffs: ArithmeticExpression = 1 @@ -85,7 +84,7 @@ def map_product(self, expr: p.Product) -> CoeffsT: children_coeffs[idx_of_child_with_vars].items()} @override - def map_quotient(self, expr: p.Quotient) -> CoeffsT: + def map_quotient(self, expr: p.Quotient, /) -> CoeffsT: from pymbolic.primitives import Quotient d_num = dict(self.rec(expr.numerator)) d_den = self.rec(expr.denominator) @@ -98,7 +97,7 @@ def map_quotient(self, expr: p.Quotient) -> CoeffsT: return d_num @override - def map_power(self, expr: p.Power) -> CoeffsT: + def map_power(self, expr: p.Power, /) -> CoeffsT: d_base = self.rec(expr.base) d_exponent = self.rec(expr.exponent) # d_exponent should look like {1: k} @@ -110,20 +109,20 @@ def map_power(self, expr: p.Power) -> CoeffsT: return {1: expr} @override - def map_constant(self, expr: object) -> CoeffsT: + def map_constant(self, expr: object, /) -> CoeffsT: assert p.is_arithmetic_expression(expr) from pymbolic.primitives import is_zero return {} if is_zero(expr) else {1: expr} @override - def map_variable(self, expr: p.Variable) -> CoeffsT: + def map_variable(self, expr: p.Variable, /) -> CoeffsT: if self.target_names is None or expr.name in self.target_names: return {expr: 1} else: return {1: expr} @override - def map_algebraic_leaf(self, expr: p.AlgebraicLeaf) -> CoeffsT: + def map_algebraic_leaf(self, expr: p.AlgebraicLeaf, /) -> CoeffsT: if self.target_names is None: return {expr: 1} else: diff --git a/pymbolic/mapper/collector.py b/pymbolic/mapper/collector.py index cead0d73..177a37b3 100644 --- a/pymbolic/mapper/collector.py +++ b/pymbolic/mapper/collector.py @@ -26,9 +26,10 @@ THE SOFTWARE. """ -from typing import TYPE_CHECKING, cast +from typing import TYPE_CHECKING + +from typing_extensions import override -import pymbolic import pymbolic.primitives as p from pymbolic.mapper import IdentityMapper @@ -48,9 +49,12 @@ class TermCollector(IdentityMapper[[]]): coefficients and are not used for term collection. """ - def __init__(self, parameters: Set[p.AlgebraicLeaf] | None = None): + parameters: Set[p.AlgebraicLeaf] + + def __init__(self, parameters: Set[p.AlgebraicLeaf] | None = None) -> None: if parameters is None: parameters = set() + self.parameters = parameters def get_dependencies(self, expr: Expression) -> Dependencies: @@ -90,7 +94,7 @@ def exponent(term: Expression) -> ArithmeticExpression: or not bool(self.get_dependencies(mul_term))): terms = [mul_term] else: - raise RuntimeError("split_term expects a multiplicative term") + raise RuntimeError(f"split_term expects a multiplicative term: {mul_term}") base2exp: dict[ArithmeticExpression, ArithmeticExpression] = {} for term in terms: @@ -102,8 +106,8 @@ def exponent(term: Expression) -> ArithmeticExpression: else: base2exp[mybase] = myexp - coefficients = [] - cleaned_base2exp = {} + coefficients: list[ArithmeticExpression] = [] + cleaned_base2exp: dict[ArithmeticExpression, ArithmeticExpression] = {} for item_base, item_exp in base2exp.items(): term = item_base**item_exp if self.get_dependencies(term) <= self.parameters: @@ -113,10 +117,13 @@ def exponent(term: Expression) -> ArithmeticExpression: base_exp_set = frozenset( (base, exp) for base, exp in cleaned_base2exp.items()) - return base_exp_set, cast("ArithmeticExpression", - self.rec(pymbolic.flattened_product(coefficients))) + coeffs = self.rec(p.flattened_product(coefficients)) + assert p.is_arithmetic_expression(coeffs) + + return base_exp_set, coeffs - def map_sum(self, expr: p.Sum) -> Expression: + @override + def map_sum(self, expr: p.Sum, /) -> Expression: term2coeff: dict[ Set[tuple[ArithmeticExpression, ArithmeticExpression]], ArithmeticExpression] = {} @@ -124,10 +131,12 @@ def map_sum(self, expr: p.Sum) -> Expression: term, coeff = self.split_term(child) term2coeff[term] = term2coeff.get(term, 0) + coeff - def rep2term(rep): - return pymbolic.flattened_product([base**exp for base, exp in rep]) + def rep2term( + rep: Set[tuple[ArithmeticExpression, ArithmeticExpression]] + ) -> ArithmeticExpression: + return p.flattened_product([base**exp for base, exp in rep]) - result = pymbolic.flattened_sum([ + result = p.flattened_sum([ coeff*rep2term(termrep) for termrep, coeff in term2coeff.items() ]) return result diff --git a/pymbolic/mapper/constant_converter.py b/pymbolic/mapper/constant_converter.py index 28ddd5fb..f0ba8722 100644 --- a/pymbolic/mapper/constant_converter.py +++ b/pymbolic/mapper/constant_converter.py @@ -23,10 +23,10 @@ THE SOFTWARE. """ -import pymbolic.mapper +from pymbolic.mapper import IdentityMapper -class ConstantToNumpyConversionMapper(pymbolic.mapper.IdentityMapper): +class ConstantToNumpyConversionMapper(IdentityMapper[[]]): """Because of `this numpy bug `__, sized :mod:`numpy` number (i.e. ones with definite bit width, such as :class:`numpy.complex64`) have a low likelihood of surviving expression diff --git a/pymbolic/mapper/constant_folder.py b/pymbolic/mapper/constant_folder.py index 93590888..155928ba 100644 --- a/pymbolic/mapper/constant_folder.py +++ b/pymbolic/mapper/constant_folder.py @@ -30,12 +30,14 @@ from typing import TYPE_CHECKING +from typing_extensions import Self, override + +import pymbolic.primitives as prim from pymbolic.mapper import ( CSECachingMapperMixin, IdentityMapper, Mapper, ) -from pymbolic.primitives import Product, Sum, is_arithmetic_expression from pymbolic.typing import ArithmeticExpression, Expression @@ -44,19 +46,20 @@ class ConstantFoldingMapperBase(Mapper[Expression, []]): - def is_constant(self, expr): + def is_constant(self, expr: Expression, /) -> bool: from pymbolic.mapper.dependency import DependencyMapper return not bool(DependencyMapper()(expr)) - def evaluate(self, expr): + def evaluate(self, expr: Expression, /) -> Expression | None: from pymbolic import evaluate + try: return evaluate(expr) except ValueError: return None def fold(self, - expr: Sum | Product, + expr: prim.Sum | prim.Product, op: Callable[ [ArithmeticExpression, ArithmeticExpression], ArithmeticExpression], @@ -72,10 +75,10 @@ def fold(self, queue = list(expr.children) while queue: child = self.rec(queue.pop(0)) - assert is_arithmetic_expression(child) + assert prim.is_arithmetic_expression(child) if isinstance(child, klass): - assert isinstance(child, Sum | Product) + assert isinstance(child, (prim.Sum, prim.Product)) queue = list(child.children) + queue else: if self.is_constant(child): @@ -95,7 +98,8 @@ def fold(self, else: return constructor(tuple(nonconstants)) - def map_sum(self, expr: Sum) -> Expression: + @override + def map_sum(self, expr: prim.Sum, /) -> Expression: import operator from pymbolic.primitives import flattened_sum @@ -104,7 +108,8 @@ def map_sum(self, expr: Sum) -> Expression: class CommutativeConstantFoldingMapperBase(ConstantFoldingMapperBase): - def map_product(self, expr): + @override + def map_product(self, expr: prim.Product, /) -> Expression: import operator from pymbolic.primitives import flattened_product @@ -117,8 +122,9 @@ class ConstantFoldingMapper( ConstantFoldingMapperBase, IdentityMapper[[]]): - map_common_subexpression_uncached = \ - IdentityMapper.map_common_subexpression + map_common_subexpression_uncached: ( + Callable[[Self, prim.CommonSubexpression], Expression]) = ( + IdentityMapper.map_common_subexpression) class CommutativeConstantFoldingMapper( @@ -126,5 +132,6 @@ class CommutativeConstantFoldingMapper( CommutativeConstantFoldingMapperBase, IdentityMapper[[]]): - map_common_subexpression_uncached = \ - IdentityMapper.map_common_subexpression + map_common_subexpression_uncached: ( + Callable[[Self, prim.CommonSubexpression], Expression]) = ( + IdentityMapper.map_common_subexpression) diff --git a/pymbolic/mapper/cse_tagger.py b/pymbolic/mapper/cse_tagger.py index db264463..5c1574ac 100644 --- a/pymbolic/mapper/cse_tagger.py +++ b/pymbolic/mapper/cse_tagger.py @@ -23,50 +23,65 @@ THE SOFTWARE. """ +from typing import TYPE_CHECKING +from typing_extensions import Self, override + +import pymbolic.primitives as prim from pymbolic.mapper import IdentityMapper, WalkMapper -from pymbolic.primitives import CommonSubexpression, cse_scope -class CSEWalkMapper(WalkMapper): - def __init__(self): +if TYPE_CHECKING: + from collections.abc import Callable, Hashable + + from pymbolic.typing import Expression + + +class CSEWalkMapper(WalkMapper[[]]): + subexpr_histogram: dict[Hashable, int] + + def __init__(self) -> None: self.subexpr_histogram = {} - def visit(self, expr): + @override + def visit(self, expr: object) -> bool: self.subexpr_histogram[expr] = self.subexpr_histogram.get(expr, 0) + 1 return True -class CSETagMapper(IdentityMapper): - def __init__(self, walk_mapper): +class CSETagMapper(IdentityMapper[[]]): + subexpr_histogram: dict[Hashable, int] + + def __init__(self, walk_mapper: CSEWalkMapper) -> None: self.subexpr_histogram = walk_mapper.subexpr_histogram - def map_call(self, expr): + def _map_subexpr(self, expr: prim.ExpressionNode, /) -> Expression: if self.subexpr_histogram.get(expr, 0) > 1: - return CommonSubexpression(expr, scope=cse_scope.EVALUATION) + return prim.CommonSubexpression(expr, scope=prim.cse_scope.EVALUATION) else: return getattr(IdentityMapper, expr.mapper_method)(self, expr) - map_sum = map_call - map_product = map_call - map_quotient = map_call - map_floor_div = map_call - map_remainder = map_call - map_power = map_call + map_call: Callable[[Self, prim.Call], Expression] = _map_subexpr + map_sum: Callable[[Self, prim.Sum], Expression] = _map_subexpr + map_product: Callable[[Self, prim.Product], Expression] = _map_subexpr + map_quotient: Callable[[Self, prim.Quotient], Expression] = _map_subexpr + map_floor_div: Callable[[Self, prim.FloorDiv], Expression] = _map_subexpr + map_remainder: Callable[[Self, prim.Remainder], Expression] = _map_subexpr + map_power: Callable[[Self, prim.Power], Expression] = _map_subexpr - map_left_shift = map_call - map_right_shift = map_call + map_left_shift: Callable[[Self, prim.LeftShift], Expression] = _map_subexpr + map_right_shift: Callable[[Self, prim.RightShift], Expression] = _map_subexpr - map_bitwise_not = map_call - map_bitwise_or = map_call - map_bitwise_xor = map_call - map_bitwise_and = map_call + map_bitwise_not: Callable[[Self, prim.BitwiseNot], Expression] = _map_subexpr + map_bitwise_or: Callable[[Self, prim.BitwiseOr], Expression] = _map_subexpr + map_bitwise_xor: Callable[[Self, prim.BitwiseXor], Expression] = _map_subexpr + map_bitwise_and: Callable[[Self, prim.BitwiseAnd], Expression] = _map_subexpr - map_comparison = map_call + map_comparison: Callable[[Self, prim.Comparison], Expression] = _map_subexpr - map_logical_not = map_call - map_logical_and = map_call - map_logical_or = map_call + map_logical_not: Callable[[Self, prim.LogicalNot], Expression] = _map_subexpr + map_logical_and: Callable[[Self, prim.LogicalAnd], Expression] = _map_subexpr + map_logical_or: Callable[[Self, prim.LogicalOr], Expression] = _map_subexpr - map_if = map_call - map_if_positive = map_call + map_if: Callable[[Self, prim.If], Expression] = _map_subexpr + map_if_positive: Callable[[Self, prim.If], Expression] = _map_subexpr diff --git a/pymbolic/mapper/dependency.py b/pymbolic/mapper/dependency.py index 168954e9..40da9667 100644 --- a/pymbolic/mapper/dependency.py +++ b/pymbolic/mapper/dependency.py @@ -55,6 +55,11 @@ class DependencyMapper( instances are included. """ + include_subscripts: bool + include_lookups: bool + include_calls: bool | Literal["descend_args"] + include_cses: bool + def __init__( self, include_subscripts: bool = True, @@ -87,13 +92,13 @@ def __init__( @override def map_variable( - self, expr: p.Variable, *args: P.args, **kwargs: P.kwargs + self, expr: p.Variable, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: return {expr} @override def map_call( - self, expr: p.Call, *args: P.args, **kwargs: P.kwargs + self, expr: p.Call, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: if self.include_calls == "descend_args": return self.combine([ @@ -106,14 +111,14 @@ def map_call( @override def map_call_with_kwargs( - self, expr: p.CallWithKwargs, *args: P.args, **kwargs: P.kwargs + self, expr: p.CallWithKwargs, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: if self.include_calls == "descend_args": return self.combine( [self.rec(child, *args, **kwargs) for child in expr.parameters] + [ self.rec(val, *args, **kwargs) - for name, val in expr.kw_parameters.items() + for _name, val in expr.kw_parameters.items() ] ) elif self.include_calls: @@ -123,7 +128,7 @@ def map_call_with_kwargs( @override def map_lookup( - self, expr: p.Lookup, *args: P.args, **kwargs: P.kwargs + self, expr: p.Lookup, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: if self.include_lookups: return {expr} @@ -132,7 +137,7 @@ def map_lookup( @override def map_subscript( - self, expr: p.Subscript, *args: P.args, **kwargs: P.kwargs + self, expr: p.Subscript, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: if self.include_subscripts: return {expr} @@ -141,7 +146,7 @@ def map_subscript( @override def map_common_subexpression_uncached( - self, expr: p.CommonSubexpression, *args: P.args, **kwargs: P.kwargs + self, expr: p.CommonSubexpression, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: if self.include_cses: return {expr} @@ -150,7 +155,7 @@ def map_common_subexpression_uncached( @override def map_slice( - self, expr: p.Slice, *args: P.args, **kwargs: P.kwargs + self, expr: p.Slice, /, *args: P.args, **kwargs: P.kwargs ) -> Dependencies: return self.combine([ self.rec(child, *args, **kwargs) @@ -159,7 +164,8 @@ def map_slice( ]) @override - def map_nan(self, expr: p.NaN, *args: P.args, **kwargs: P.kwargs) -> Dependencies: + def map_nan(self, expr: p.NaN, /, + *args: P.args, **kwargs: P.kwargs) -> Dependencies: return set() diff --git a/pymbolic/mapper/differentiator.py b/pymbolic/mapper/differentiator.py index df0731a9..3119311f 100644 --- a/pymbolic/mapper/differentiator.py +++ b/pymbolic/mapper/differentiator.py @@ -1,4 +1,5 @@ """ +.. autoclass:: FunctionDerivativeTaker .. autoclass:: DifferentiationMapper """ from __future__ import annotations @@ -26,58 +27,104 @@ THE SOFTWARE. """ -from typing_extensions import override +from typing import TYPE_CHECKING, Any, Concatenate, Literal, Protocol -from pytools import ndindex +from typing_extensions import Self, override -import pymbolic -import pymbolic.mapper -import pymbolic.primitives as primitives +import pymbolic.primitives as prim +from pymbolic.mapper import CSECachingMapperMixin, Mapper, P +from pymbolic.typing import ArithmeticExpression, Expression -def map_math_functions_by_name(i, func, pars, allowed_nonsmoothness="none"): - def make_f(name): - return primitives.Lookup(primitives.Variable("math"), name) +if TYPE_CHECKING: + from collections.abc import Callable, Sequence + + from numpy.typing import NDArray + +Smoothness = Literal["none", "continuous", "discontinuous"] + + +class FunctionDerivativeTaker(Protocol): + """Inherits: :class:`typing.Protocol`. + + .. automethod:: __call__ + """ + + def __call__(self, + i: int, + func: Expression, + pars: Sequence[Expression], + allowed_nonsmoothness: ( + Literal["none", "continuous", "discontinuous"]) = "none", + ) -> ArithmeticExpression: ... + + +def map_math_functions_by_name( + i: int, + func: Expression, + pars: Sequence[Expression], + allowed_nonsmoothness: Smoothness = "none", + ) -> ArithmeticExpression: + def make_f(name: str) -> prim.ExpressionNode: + return prim.Lookup(prim.Variable("math"), name) if func == make_f("sin") and len(pars) == 1: + assert i == 0 return make_f("cos")(*pars) elif func == make_f("cos") and len(pars) == 1: + assert i == 0 return -make_f("sin")(*pars) elif func == make_f("tan") and len(pars) == 1: + assert i == 0 return make_f("tan")(*pars)**2+1 elif func == make_f("log") and len(pars) == 1: - return primitives.quotient(1, pars[0]) + assert i == 0 + assert prim.is_arithmetic_expression(pars[0]) + return prim.quotient(1, pars[0]) elif func == make_f("exp") and len(pars) == 1: + assert i == 0 return make_f("exp")(*pars) elif func == make_f("sinh") and len(pars) == 1: + assert i == 0 return make_f("cosh")(*pars) elif func == make_f("cosh") and len(pars) == 1: + assert i == 0 return make_f("sinh")(*pars) elif func == make_f("tanh") and len(pars) == 1: + assert i == 0 return 1-make_f("tanh")(*pars)**2 elif func == make_f("expm1") and len(pars) == 1: + assert i == 0 return make_f("exp")(*pars) elif func == make_f("fabs") and len(pars) == 1: + assert i == 0 + + par, = pars + assert prim.is_arithmetic_expression(par) + if allowed_nonsmoothness in ["continuous", "discontinuous"]: from pymbolic.functions import sign - return sign(*pars) + return sign(par) else: - raise ValueError("fabs is not smooth" - ", pass allowed_nonsmoothness='continuous' " - "to return sign") + raise ValueError( + "'fabs' is not smooth, pass allowed_nonsmoothness='continuous' " + "to return 'sign' function") elif func == make_f("copysign") and len(pars) == 2: + # NOTE: this is the `sign(x) = copysign(1, x)` function actually, as + # defined in `pymbolic.functions`, so even though it has 2 arguments, we + # only look at derivatives with respect to the second one. if allowed_nonsmoothness == "discontinuous": return 0 else: - raise ValueError("sign is discontinuous" - ", pass allowed_nonsmoothness='discontinuous' " - "to return 0") + raise ValueError( + "'sign' is discontinuous, pass allowed_nonsmoothness='discontinuous' " + "to return 0") else: raise RuntimeError("unrecognized function, cannot differentiate") -class DifferentiationMapper(pymbolic.mapper.Mapper, - pymbolic.mapper.CSECachingMapperMixin): +class DifferentiationMapper(Mapper[Expression, P], + CSECachingMapperMixin[Expression, P]): """Example usage: .. doctest:: @@ -93,8 +140,14 @@ class DifferentiationMapper(pymbolic.mapper.Mapper, (((x + 5)**3 + x*3*(x + 5)**2)*(x + -1)**2 + (-1)*2*(x + -1)*x*(x + 5)**3) / (x + -1)**2**2 """ # noqa: E501 - def __init__(self, variable, func_map=map_math_functions_by_name, - allowed_nonsmoothness=None): + variable: prim.Variable | prim.Subscript + function_map: FunctionDerivativeTaker + allowed_nonsmoothness: Smoothness + + def __init__(self, + variable: prim.Variable | prim.Subscript, + func_map: FunctionDerivativeTaker | None = None, + allowed_nonsmoothness: Smoothness | None = None) -> None: """ :arg variable: A :class:`pymbolic.primitives.Variable` instance by which to differentiate. @@ -111,6 +164,9 @@ def __init__(self, variable, func_map=map_math_functions_by_name, Added *allowed_nonsmoothness*. """ + if func_map is None: + func_map = map_math_functions_by_name + if allowed_nonsmoothness is None: allowed_nonsmoothness = "none" @@ -121,123 +177,153 @@ def __init__(self, variable, func_map=map_math_functions_by_name, "is not a valid option") self.allowed_nonsmoothness = allowed_nonsmoothness - def rec_undiff(self, expr, *args): + def rec_arith(self, expr: Expression, /, + *args: P.args, **kwargs: P.kwargs) -> ArithmeticExpression: + result = self.rec(expr, *args, **kwargs) + assert prim.is_arithmetic_expression(result) + + return result + + def rec_undiff(self, expr: ArithmeticExpression, /, + *args: P.args, **kwargs: P.kwargs) -> ArithmeticExpression: """This method exists for the benefit of subclasses that may need to process un-differentiated subexpressions. """ return expr @override - def map_constant(self, expr, *args): + def map_constant(self, expr: object, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: return 0 @override - def map_variable(self, expr, *args): + def map_variable(self, expr: prim.Variable | prim.Subscript, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: if expr == self.variable: return 1 else: return 0 @override - def map_call(self, expr, *args): - return pymbolic.flattened_sum( + def map_call(self, expr: prim.Call, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: + pars = tuple(self.rec_undiff(p, *args, **kwargs) for p in expr.parameters) + return prim.flattened_sum( self.function_map( - i, expr.function, self.rec_undiff(expr.parameters, *args), + i, + expr.function, + pars, allowed_nonsmoothness=self.allowed_nonsmoothness) - * self.rec(par, *args) - for i, par in enumerate(expr.parameters) + * self.rec_arith(param, *args, **kwargs) + for i, param in enumerate(expr.parameters) ) - map_subscript = map_variable + map_subscript: Callable[Concatenate[Self, prim.Subscript, P], + Expression] = map_variable @override - def map_sum(self, expr, *args): - return pymbolic.flattened_sum( - self.rec(child, *args) for child in expr.children) + def map_sum(self, expr: prim.Sum, /, * + args: P.args, **kwargs: P.kwargs) -> Expression: + return prim.flattened_sum( + self.rec_arith(child, *args, **kwargs) for child in expr.children) @override - def map_product(self, expr, *args): - return pymbolic.flattened_sum( - pymbolic.flattened_product( - [self.rec_undiff(ch, *args) for ch in expr.children[0:i]] - + [self.rec(child, *args)] - + [self.rec_undiff(ch, *args) for ch in expr.children[i+1:]] + def map_product(self, expr: prim.Product, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: + return prim.flattened_sum( + prim.flattened_product( + [self.rec_undiff(ch, *args, **kwargs) for ch in expr.children[0:i]] + + [self.rec_arith(child, *args, **kwargs)] + + [self.rec_undiff(ch, *args, **kwargs) for ch in expr.children[i+1:]] ) for i, child in enumerate(expr.children)) @override - def map_quotient(self, expr, *args): + def map_quotient(self, expr: prim.Quotient, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: f = expr.numerator g = expr.denominator - df = self.rec(f, *args) - dg = self.rec(g, *args) - f = self.rec_undiff(f, *args) - g = self.rec_undiff(g, *args) + df = self.rec_arith(f, *args, **kwargs) + dg = self.rec_arith(g, *args, **kwargs) + f = self.rec_undiff(f, *args, **kwargs) + g = self.rec_undiff(g, *args, **kwargs) if (not df) and (not dg): return 0 elif (not df): return -f*dg/g**2 elif (not dg): - return self.rec(f, *args)/g + return self.rec_arith(f, *args, **kwargs) / g else: return (df*g-dg*f)/g**2 @override - def map_power(self, expr, *args): + def map_power(self, expr: prim.Power, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: f = expr.base g = expr.exponent - df = self.rec(f, *args) - dg = self.rec(g, *args) - f = self.rec_undiff(f, *args) - g = self.rec_undiff(g, *args) + df = self.rec_arith(f, *args, **kwargs) + dg = self.rec_arith(g, *args, **kwargs) + f = self.rec_undiff(f, *args, **kwargs) + g = self.rec_undiff(g, *args, **kwargs) - log = pymbolic.var("log") + log = prim.Variable("log") - if (not df) and (not dg): + if not df and not dg: return 0 - elif (not df): + elif not df: return log(f) * f**g * dg - elif (not dg): + elif not dg: return g * f**(g-1) * df else: - return log(f) * f**g * dg + \ - g * f**(g-1) * df + return log(f) * f**g * dg + g * f**(g-1) * df @override - def map_numpy_array(self, expr, *args): - import numpy - result = numpy.empty(expr.shape, dtype=object) + def map_numpy_array(self, expr: NDArray[Any], /, + *args: P.args, **kwargs: P.kwargs) -> Expression: + import numpy as np + result = np.empty(expr.shape, dtype=object) + + from pytools import ndindex for i in ndindex(result.shape): - result[i] = self.rec(expr[i], *args) + result[i] = self.rec(expr[i], *args, **kwargs) + return result @override - def map_if(self, expr, *args): + def map_if(self, expr: prim.If, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: if self.allowed_nonsmoothness != "discontinuous": - raise ValueError("cannot differentiate 'If' nodes unless " - "allowed_nonsmoothness is set to 'discontinuous'") + raise ValueError( + "cannot differentiate 'If' nodes unless allowed_nonsmoothness " + f"is set to 'discontinuous': {self.allowed_nonsmoothness!r}") return type(expr)( expr.condition, - self.rec(expr.then, *args), - self.rec(expr.else_, *args)) + self.rec(expr.then, *args, **kwargs), + self.rec(expr.else_, *args, **kwargs)) @override - def map_common_subexpression_uncached(self, expr, *args): + def map_common_subexpression_uncached( + self, expr: prim.CommonSubexpression, /, + *args: P.args, **kwargs: P.kwargs) -> Expression: return type(expr)( - self.rec(expr.child, *args), + self.rec(expr.child, *args, **kwargs), expr.prefix, expr.scope) -def differentiate(expression, - variable, - func_mapper=map_math_functions_by_name, - allowed_nonsmoothness="none"): - if not isinstance(variable, primitives.Variable | primitives.Subscript): - variable = primitives.make_variable(variable) +def differentiate(expression: Expression, + variable: str | prim.Variable | prim.Subscript, + func_mapper: FunctionDerivativeTaker | None = None, + allowed_nonsmoothness: Smoothness = "none") -> Expression: + if not isinstance(variable, prim.Variable | prim.Subscript): + variable = prim.make_variable(variable) + from pymbolic import flatten + return flatten(DifferentiationMapper( - variable, func_mapper, allowed_nonsmoothness=allowed_nonsmoothness + variable, + func_map=func_mapper, + allowed_nonsmoothness=allowed_nonsmoothness )(expression)) diff --git a/pymbolic/mapper/distributor.py b/pymbolic/mapper/distributor.py index b5a3f7f6..9cd35ca1 100644 --- a/pymbolic/mapper/distributor.py +++ b/pymbolic/mapper/distributor.py @@ -1,4 +1,5 @@ """ +.. autoclass:: ExpressionCallable .. autoclass:: DistributeMapper .. autofunction:: distribute """ @@ -27,9 +28,10 @@ THE SOFTWARE. """ -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Protocol + +from typing_extensions import override -import pymbolic import pymbolic.primitives as p from pymbolic.mapper import IdentityMapper from pymbolic.mapper.collector import TermCollector @@ -37,7 +39,16 @@ if TYPE_CHECKING: - from pymbolic.typing import Expression + from pymbolic.typing import ArithmeticExpression, Expression + + +class ExpressionCallable(Protocol): + """Inherits: :class:`typing.Protocol`. + + .. automethod:: __call__ + """ + + def __call__(self, expr: Expression, /) -> Expression: ... class DistributeMapper(IdentityMapper[[]]): @@ -53,7 +64,12 @@ class DistributeMapper(IdentityMapper[[]]): 7*x**6 + 21*x**5 + 21*x**2 + 35*x**3 + 1 + 35*x**4 + 7*x + x**7 """ - def __init__(self, collector=None, const_folder=None) -> None: + collector: ExpressionCallable + const_folder: ExpressionCallable + + def __init__(self, + collector: ExpressionCallable | None = None, + const_folder: ExpressionCallable | None = None) -> None: if collector is None: collector = TermCollector() if const_folder is None: @@ -62,22 +78,24 @@ def __init__(self, collector=None, const_folder=None) -> None: self.collector = collector self.const_folder = const_folder - def collect(self, expr): + def collect(self, expr: Expression) -> Expression: return self.collector(self.const_folder(expr)) - def map_sum(self, expr): + @override + def map_sum(self, expr: p.Sum, /) -> Expression: res = IdentityMapper.map_sum(self, expr) if isinstance(res, p.Sum): return self.collect(res) else: return res - def map_product(self, expr: p.Product) -> Expression: - def dist(prod): + @override + def map_product(self, expr: p.Product, /) -> Expression: + def dist(prod: ArithmeticExpression) -> ArithmeticExpression: if not isinstance(prod, p.Product): return prod - leading = [] + leading: list[ArithmeticExpression] = [] for i in prod.children: if isinstance(i, p.Sum): break @@ -86,47 +104,49 @@ def dist(prod): if len(leading) == len(prod.children): # no more sums found - result = pymbolic.flattened_product(prod.children) + result = p.flattened_product(prod.children) return result else: sum = prod.children[len(leading)] assert isinstance(sum, p.Sum) + rest = prod.children[len(leading)+1:] rest = dist(p.Product(rest)) if rest else 1 - result = self.collect(pymbolic.flattened_sum([ - pymbolic.flattened_product(leading) * dist(sumchild*rest) + result = self.collect(p.flattened_sum([ + p.flattened_product(leading) * dist(sumchild*rest) for sumchild in sum.children ])) + assert p.is_arithmetic_expression(result) + return result return dist(IdentityMapper.map_product(self, expr)) - def map_quotient(self, expr): + @override + def map_quotient(self, expr: p.Quotient, /) -> Expression: if p.is_zero(expr.numerator - 1): return expr else: # not the smartest thing we can do, but at least *something* - return pymbolic.flattened_product([ - type(expr)(1, self.rec(expr.denominator)), - self.rec(expr.numerator) + return p.flattened_product([ + type(expr)(1, self.rec_arith(expr.denominator)), + self.rec_arith(expr.numerator) ]) - def map_power(self, expr: p.Power) -> Expression: + @override + def map_power(self, expr: p.Power, /) -> Expression: from pymbolic.primitives import Sum newbase = self.rec(expr.base) if isinstance(newbase, p.Product): - return self.rec(pymbolic.flattened_product([ - child**expr.exponent - for child in newbase.children + return self.rec(p.flattened_product([ + child**expr.exponent for child in newbase.children ])) if isinstance(expr.exponent, int): if isinstance(newbase, Sum): - return self.rec( - pymbolic.flattened_product( - expr.exponent*(newbase,))) + return self.rec(p.flattened_product(expr.exponent*(newbase,))) else: return IdentityMapper.map_power(self, expr) else: @@ -134,10 +154,13 @@ def map_power(self, expr: p.Power) -> Expression: def distribute( - expr: Expression, parameters=None, commutative=True + expr: Expression, + parameters: frozenset[p.AlgebraicLeaf] | None = None, + commutative: bool = True ) -> Expression: if parameters is None: parameters = frozenset() + if commutative: return DistributeMapper(TermCollector(parameters))(expr) else: diff --git a/pymbolic/mapper/evaluator.py b/pymbolic/mapper/evaluator.py index 0914a76d..c034ab15 100644 --- a/pymbolic/mapper/evaluator.py +++ b/pymbolic/mapper/evaluator.py @@ -89,22 +89,24 @@ def __init__(self, context: Mapping[str, ResultT] | None = None) -> None: self.context = context @override - def map_constant(self, expr: object) -> ResultT: + def map_constant(self, expr: object, /) -> ResultT: return cast("ResultT", expr) @override - def map_variable(self, expr: p.Variable) -> ResultT: + def map_variable(self, expr: p.Variable, /) -> ResultT: try: return self.context[expr.name] except KeyError: - raise UnknownVariableError(expr.name) from None + raise UnknownVariableError( + f"cannot find '{expr.name}' in context (pass it in on evaluation)" + ) from None @override - def map_call(self, expr: p.Call) -> ResultT: + def map_call(self, expr: p.Call, /) -> ResultT: return self.rec(expr.function)(*[self.rec(par) for par in expr.parameters]) @override - def map_call_with_kwargs(self, expr: p.CallWithKwargs) -> ResultT: + def map_call_with_kwargs(self, expr: p.CallWithKwargs, /) -> ResultT: args = [self.rec(par) for par in expr.parameters] kwargs = { k: self.rec(v) @@ -113,80 +115,80 @@ def map_call_with_kwargs(self, expr: p.CallWithKwargs) -> ResultT: return self.rec(expr.function)(*args, **kwargs) @override - def map_subscript(self, expr: p.Subscript) -> ResultT: + def map_subscript(self, expr: p.Subscript, /) -> ResultT: return self.rec(expr.aggregate)[self.rec(expr.index)] @override - def map_lookup(self, expr: p.Lookup) -> ResultT: + def map_lookup(self, expr: p.Lookup, /) -> ResultT: return getattr(self.rec(expr.aggregate), expr.name) @override - def map_sum(self, expr: p.Sum) -> ResultT: + def map_sum(self, expr: p.Sum, /) -> ResultT: return sum(self.rec(child) for child in expr.children) @override - def map_product(self, expr: p.Product) -> ResultT: + def map_product(self, expr: p.Product, /) -> ResultT: from pytools import product return cast("ResultT", product(self.rec(child) for child in expr.children)) @override - def map_quotient(self, expr: p.Quotient) -> ResultT: + def map_quotient(self, expr: p.Quotient, /) -> ResultT: return self.rec(expr.numerator) / self.rec(expr.denominator) @override - def map_floor_div(self, expr: p.FloorDiv) -> ResultT: + def map_floor_div(self, expr: p.FloorDiv, /) -> ResultT: return self.rec(expr.numerator) // self.rec(expr.denominator) @override - def map_remainder(self, expr: p.Remainder) -> ResultT: + def map_remainder(self, expr: p.Remainder, /) -> ResultT: return self.rec(expr.numerator) % self.rec(expr.denominator) @override - def map_power(self, expr: p.Power) -> ResultT: + def map_power(self, expr: p.Power, /) -> ResultT: return self.rec(expr.base) ** self.rec(expr.exponent) @override - def map_left_shift(self, expr: p.LeftShift) -> ResultT: + def map_left_shift(self, expr: p.LeftShift, /) -> ResultT: return self.rec(expr.shiftee) << self.rec(expr.shift) @override - def map_right_shift(self, expr: p.RightShift) -> ResultT: + def map_right_shift(self, expr: p.RightShift, /) -> ResultT: return self.rec(expr.shiftee) >> self.rec(expr.shift) @override - def map_bitwise_not(self, expr: p.BitwiseNot) -> ResultT: + def map_bitwise_not(self, expr: p.BitwiseNot, /) -> ResultT: return ~self.rec(expr.child) @override - def map_bitwise_or(self, expr: p.BitwiseOr) -> ResultT: + def map_bitwise_or(self, expr: p.BitwiseOr, /) -> ResultT: return reduce(op.or_, (self.rec(ch) for ch in expr.children)) @override - def map_bitwise_xor(self, expr: p.BitwiseXor) -> ResultT: + def map_bitwise_xor(self, expr: p.BitwiseXor, /) -> ResultT: return reduce(op.xor, (self.rec(ch) for ch in expr.children)) @override - def map_bitwise_and(self, expr: p.BitwiseAnd) -> ResultT: + def map_bitwise_and(self, expr: p.BitwiseAnd, /) -> ResultT: return reduce(op.and_, (self.rec(ch) for ch in expr.children)) @override - def map_logical_not(self, expr: p.LogicalNot) -> bool: + def map_logical_not(self, expr: p.LogicalNot, /) -> bool: return not self.rec(expr.child) @override - def map_logical_or(self, expr: p.LogicalOr) -> bool: + def map_logical_or(self, expr: p.LogicalOr, /) -> bool: return any(self.rec(ch) for ch in expr.children) @override - def map_logical_and(self, expr: p.LogicalAnd) -> bool: + def map_logical_and(self, expr: p.LogicalAnd, /) -> bool: return all(self.rec(ch) for ch in expr.children) @override - def map_list(self, expr: list[Expression]) -> ResultT: + def map_list(self, expr: list[Expression], /) -> ResultT: return [self.rec(child) for child in expr] @override - def map_numpy_array(self, expr: NDArray[np.generic]) -> ResultT: + def map_numpy_array(self, expr: NDArray[np.generic], /) -> ResultT: import numpy result = numpy.empty(expr.shape, dtype=object) for i in ndindex(expr.shape): @@ -194,40 +196,41 @@ def map_numpy_array(self, expr: NDArray[np.generic]) -> ResultT: return result @override - def map_multivector(self, expr: MultiVector[Any]) -> ResultT: + def map_multivector(self, expr: MultiVector[Any], /) -> ResultT: return expr.map(lambda ch: self.rec(ch)) @override - def map_common_subexpression_uncached(self, expr: p.CommonSubexpression) -> ResultT: + def map_common_subexpression_uncached( + self, expr: p.CommonSubexpression, /) -> ResultT: return self.rec(expr.child) @override - def map_if(self, expr: p.If) -> ResultT: + def map_if(self, expr: p.If, /) -> ResultT: if self.rec(expr.condition): return self.rec(expr.then) else: return self.rec(expr.else_) @override - def map_comparison(self, expr: p.Comparison) -> ResultT: + def map_comparison(self, expr: p.Comparison, /) -> ResultT: import operator return getattr(operator, expr.operator_to_name[expr.operator])( self.rec(expr.left), self.rec(expr.right)) @override - def map_min(self, expr: p.Min) -> ResultT: + def map_min(self, expr: p.Min, /) -> ResultT: return min(self.rec(child) for child in expr.children) @override - def map_max(self, expr: p.Max) -> ResultT: + def map_max(self, expr: p.Max, /) -> ResultT: return max(self.rec(child) for child in expr.children) @override - def map_tuple(self, expr: tuple[Expression, ...]) -> ResultT: + def map_tuple(self, expr: tuple[Expression, ...], /) -> ResultT: return tuple([self.rec(child) for child in expr]) @override - def map_nan(self, expr: p.NaN) -> ResultT: + def map_nan(self, expr: p.NaN, /) -> ResultT: if expr.data_type is None: from math import nan return nan @@ -243,21 +246,21 @@ def __init__(self, context: Mapping[str, ResultT] | None = None) -> None: class FloatEvaluationMapper(EvaluationMapper[float]): @override - def map_constant(self, expr: object) -> float: + def map_constant(self, expr: object, /) -> float: return float(expr) @override - def map_rational(self, expr: Rational) -> float: + def map_rational(self, expr: Rational, /) -> float: return self.rec(expr.numerator) / self.rec(expr.denominator) class CachedFloatEvaluationMapper(CachedEvaluationMapper[float]): @override - def map_constant(self, expr: object) -> float: + def map_constant(self, expr: object, /) -> float: return float(expr) @override - def map_rational(self, expr: Rational) -> float: + def map_rational(self, expr: Rational, /) -> float: return self.rec(expr.numerator) / self.rec(expr.denominator) diff --git a/pymbolic/mapper/flattener.py b/pymbolic/mapper/flattener.py index 736b8794..efcde1e3 100644 --- a/pymbolic/mapper/flattener.py +++ b/pymbolic/mapper/flattener.py @@ -39,10 +39,7 @@ if TYPE_CHECKING: - from pymbolic.typing import ( - ArithmeticOrExpressionT, - Expression, - ) + from pymbolic.typing import ArithmeticOrExpressionT, Expression class FlattenMapper(IdentityMapper[[]]): @@ -59,7 +56,7 @@ class FlattenMapper(IdentityMapper[[]]): .. automethod:: is_expr_integer_valued """ - def is_expr_integer_valued(self, expr: Expression) -> bool: + def is_expr_integer_valued(self, expr: Expression, /) -> bool: """A user-supplied method to indicate whether a given *expr* is integer- valued. This enables additional simplifications that are not valid in general. The default implementation simply returns *False*. @@ -69,21 +66,21 @@ def is_expr_integer_valued(self, expr: Expression) -> bool: return False @override - def map_sum(self, expr: p.Sum) -> Expression: + def map_sum(self, expr: p.Sum, /) -> Expression: from pymbolic.primitives import flattened_sum return flattened_sum([ self.rec_arith(ch) for ch in expr.children]) @override - def map_product(self, expr: p.Product) -> Expression: + def map_product(self, expr: p.Product, /) -> Expression: from pymbolic.primitives import flattened_product return flattened_product([ self.rec_arith(ch) for ch in expr.children]) @override - def map_quotient(self, expr: p.Quotient) -> Expression: + def map_quotient(self, expr: p.Quotient, /) -> Expression: r_num = self.rec_arith(expr.numerator) r_den = self.rec_arith(expr.denominator) if p.is_zero(r_num): @@ -94,7 +91,7 @@ def map_quotient(self, expr: p.Quotient) -> Expression: return expr.__class__(r_num, r_den) @override - def map_floor_div(self, expr: p.FloorDiv) -> Expression: + def map_floor_div(self, expr: p.FloorDiv, /) -> Expression: r_num = self.rec_arith(expr.numerator) r_den = self.rec_arith(expr.denominator) if p.is_zero(r_num): @@ -106,7 +103,7 @@ def map_floor_div(self, expr: p.FloorDiv) -> Expression: return expr.__class__(r_num, r_den) @override - def map_remainder(self, expr: p.Remainder) -> Expression: + def map_remainder(self, expr: p.Remainder, /) -> Expression: r_num = self.rec_arith(expr.numerator) r_den = self.rec_arith(expr.denominator) assert p.is_arithmetic_expression(r_den) @@ -119,7 +116,7 @@ def map_remainder(self, expr: p.Remainder) -> Expression: return expr.__class__(r_num, r_den) @override - def map_power(self, expr: p.Power) -> Expression: + def map_power(self, expr: p.Power, /) -> Expression: r_base = self.rec_arith(expr.base) r_exp = self.rec_arith(expr.exponent) diff --git a/pymbolic/mapper/flop_counter.py b/pymbolic/mapper/flop_counter.py index 3c8c1d11..0d7ecc0a 100644 --- a/pymbolic/mapper/flop_counter.py +++ b/pymbolic/mapper/flop_counter.py @@ -25,7 +25,7 @@ from typing import TYPE_CHECKING -from typing_extensions import override +from typing_extensions import Self, override import pymbolic.primitives as p from pymbolic.mapper import CachedMapper, CombineMapper @@ -33,7 +33,7 @@ if TYPE_CHECKING: - from collections.abc import Iterable + from collections.abc import Callable, Iterable class FlopCounterBase(CombineMapper[ArithmeticExpression, []]): @@ -56,13 +56,13 @@ def map_sum(self, expr: p.Sum | p.Product) -> ArithmeticExpression: else: return 0 - map_product = map_sum + map_product: Callable[[Self, p.Product], ArithmeticExpression] = map_sum @override def map_quotient(self, expr: p.Quotient | p.FloorDiv) -> ArithmeticExpression: return 1 + self.rec(expr.numerator) + self.rec(expr.denominator) - map_floor_div = map_quotient + map_floor_div: Callable[[Self, p.FloorDiv], ArithmeticExpression] = map_quotient @override def map_power(self, expr: p.Power) -> ArithmeticExpression: diff --git a/pymbolic/mapper/graphviz.py b/pymbolic/mapper/graphviz.py index 6a1fd995..b7fc0b70 100644 --- a/pymbolic/mapper/graphviz.py +++ b/pymbolic/mapper/graphviz.py @@ -26,10 +26,21 @@ THE SOFTWARE. """ +from typing import TYPE_CHECKING + +from typing_extensions import Self, override + from pymbolic.mapper import WalkMapper -class GraphvizMapper(WalkMapper): +if TYPE_CHECKING: + from collections.abc import Callable, Hashable + + import pymbolic.primitives as prim + from pymbolic.geometric_algebra.primitives import Nabla, NablaComponent + + +class GraphvizMapper(WalkMapper[[]]): """Produces code for `dot `__ that yields an expression tree of the traversed expression(s). @@ -38,7 +49,14 @@ class GraphvizMapper(WalkMapper): .. versionadded:: 2015.1 """ - def __init__(self): + lines: list[str] + parent_stack: list[Hashable] + + next_unique_id: int + nodes_visited: set[int] + common_subexpressions: dict[prim.CommonSubexpression, prim.CommonSubexpression] + + def __init__(self) -> None: self.lines = [] self.parent_stack = [] @@ -46,21 +64,21 @@ def __init__(self): self.nodes_visited = set() self.common_subexpressions = {} - def get_dot_code(self): + def get_dot_code(self) -> str: """Return the dot source code for a previously traversed expression.""" - return "digraph expression {\n%s\n}" % ( - "\n".join(" "+line for line in self.lines)) + lines = "\n".join(f" {line}" for line in self.lines) + return f"digraph expression {{\n{lines}\n}}" - def get_id(self, expr): + def get_id(self, expr: object) -> str: """Generate a unique node ID for dot for *expr*""" return f"id{id(expr)}" - def map_leaf(self, expr): - self.lines.append( - '{} [label="{}", shape=box];'.format( - self.get_id(expr), str(expr).replace("\\", "\\\\"))) + def map_leaf(self, expr: prim.ExpressionNode): + sid = self.get_id(expr) + sexpr = str(expr).replace("\\", "\\\\") + self.lines.append(f'{sid} [label="{sexpr}", shape=box];') if self.visit(expr, node_printed=True): self.post_visit(expr) @@ -69,16 +87,19 @@ def generate_unique_id(self): self.next_unique_id += 1 return f"uid{self.next_unique_id}" - def visit(self, expr, node_printed=False, node_id=None): + @override + def visit(self, + expr: object, /, + node_printed: bool = False, + node_id: str | None = None) -> bool: # {{{ print connectivity if node_id is None: node_id = self.get_id(expr) if self.parent_stack: - self.lines.append("{} -> {};".format( - self.get_id(self.parent_stack[-1]), - node_id)) + sid = self.get_id(self.parent_stack[-1]) + self.lines.append(f"{sid} -> {node_id};") # }}} @@ -87,20 +108,20 @@ def visit(self, expr, node_printed=False, node_id=None): self.nodes_visited.add(id(expr)) if not node_printed: - self.lines.append( - '{} [label="{}"];'.format( - self.get_id(expr), - type(expr).__name__)) + sid = self.get_id(expr) + self.lines.append(f'{sid} [label="{type(expr).__name__}"];') self.parent_stack.append(expr) return True - def post_visit(self, expr): + @override + def post_visit(self, expr: object, /) -> None: self.parent_stack.pop(-1) - def map_sum(self, expr): - self.lines.append( - '{} [label="+",shape=circle];'.format(self.get_id(expr))) + @override + def map_sum(self, expr: prim.Sum, /) -> None: + sid = self.get_id(expr) + self.lines.append(f'{sid} [label="+",shape=circle];') if not self.visit(expr, node_printed=True): return @@ -109,9 +130,10 @@ def map_sum(self, expr): self.post_visit(expr) - def map_product(self, expr): - self.lines.append( - '{} [label="*",shape=circle];'.format(self.get_id(expr))) + @override + def map_product(self, expr: prim.Product, /) -> None: + sid = self.get_id(expr) + self.lines.append(f'{sid} [label="*",shape=circle];') if not self.visit(expr, node_printed=True): return @@ -120,55 +142,52 @@ def map_product(self, expr): self.post_visit(expr) - def map_variable(self, expr): + @override + def map_variable(self, expr: prim.Variable, /) -> None: # Shared nodes for variables do not make for pretty graphs. # So we generate our own unique IDs for them. node_id = self.generate_unique_id() - self.lines.append( - '{} [label="{}",shape=box];'.format( - node_id, - expr.name)) + self.lines.append(f'{node_id} [label="{expr.name}",shape=box];') if not self.visit(expr, node_printed=True, node_id=node_id): return self.post_visit(expr) - def map_lookup(self, expr): - self.lines.append( - '{} [label="Lookup[{}]",shape=box];'.format( - self.get_id(expr), expr.name)) + @override + def map_lookup(self, expr: prim.Lookup, /) -> None: + sid = self.get_id(expr) + self.lines.append(f'{sid} [label="Lookup[{expr.name}]",shape=box];') if not self.visit(expr, node_printed=True): return self.rec(expr.aggregate) self.post_visit(expr) - def map_constant(self, expr): + @override + def map_constant(self, expr: object) -> None: # Some constants (Python ints notably) are shared among small (and # common) values. While accurate, this doesn't make for pretty # trees. So we generate our own unique IDs for them. node_id = self.generate_unique_id() - self.lines.append( - '{} [label="{}",shape=ellipse];'.format( - node_id, - str(expr))) + self.lines.append(f'{node_id} [label="{expr}",shape=ellipse];') if not self.visit(expr, node_printed=True, node_id=node_id): return self.post_visit(expr) - def map_call(self, expr): + @override + def map_call(self, expr: prim.Call) -> None: from pymbolic.primitives import Variable + if not isinstance(expr.function, Variable): return super().map_call(expr) - self.lines.append( - '{} [label="Call[{}]",shape=box];'.format( - self.get_id(expr), str(expr.function))) + sid = self.get_id(expr) + self.lines.append(f'{sid} [label="Call[{expr.function}]",shape=box];') if not self.visit(expr, node_printed=True): return @@ -177,7 +196,8 @@ def map_call(self, expr): self.post_visit(expr) - def map_common_subexpression(self, expr): + @override + def map_common_subexpression(self, expr: prim.CommonSubexpression) -> None: try: expr = self.common_subexpressions[expr] except KeyError: @@ -192,7 +212,7 @@ def map_common_subexpression(self, expr): # {{{ geometric algebra - map_nabla_component = map_leaf - map_nabla = map_leaf + map_nabla_component: Callable[[Self, NablaComponent], None] = map_leaf + map_nabla: Callable[[Self, Nabla], None] = map_leaf # }}} diff --git a/pymbolic/mapper/optimize.py b/pymbolic/mapper/optimize.py index f70c476c..76b49012 100644 --- a/pymbolic/mapper/optimize.py +++ b/pymbolic/mapper/optimize.py @@ -26,7 +26,7 @@ import ast import contextlib from functools import cached_property, lru_cache -from typing import TYPE_CHECKING, TextIO, TypeVar, cast +from typing import TYPE_CHECKING, Any, TextIO, TypeVar, cast if TYPE_CHECKING: @@ -77,7 +77,7 @@ def _get_ast_for_module_name(module_name: str) -> ast.Module: return _get_ast_for_file(_get_file_name_for_module_name(module_name)) -def _get_module_ast_for_object(obj): +def _get_module_ast_for_object(obj: object) -> ast.Module: return _get_ast_for_module_name(obj.__module__) @@ -87,7 +87,7 @@ def _get_ast_for_class(cls: type) -> ast.ClassDef: mod_ast.body, cls.__name__, ast.ClassDef) -def _get_ast_for_method(f: Callable) -> ast.FunctionDef: +def _get_ast_for_method(f: Callable[..., Any]) -> ast.FunctionDef: dot_components = f.__qualname__.split(".") assert dot_components[-1] == f.__name__ cls_name, = dot_components[:-1] @@ -227,7 +227,7 @@ def _get_cache_key_expr(mdef): return stmt.value else: raise ValueError("unexpected statement type in get_cache_key: " - "{type(stmt).__name__} --- must only contain a single " + f"{type(stmt).__name__} --- must only contain a single " "return statement") diff --git a/pymbolic/mapper/stringifier.py b/pymbolic/mapper/stringifier.py index f668fdf2..ee44ebc6 100644 --- a/pymbolic/mapper/stringifier.py +++ b/pymbolic/mapper/stringifier.py @@ -22,7 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from typing import TYPE_CHECKING, ClassVar, Concatenate +from typing import TYPE_CHECKING, Any, ClassVar, Concatenate from warnings import warn from typing_extensions import deprecated, override @@ -34,13 +34,13 @@ if TYPE_CHECKING: - from collections.abc import Sequence + from collections.abc import Iterator, Sequence import numpy as np from numpy.typing import NDArray from pymbolic.geometric_algebra import MultiVector - from pymbolic.typing import Expression + from pymbolic.typing import ArithmeticExpression, Expression __doc__ = """ @@ -68,11 +68,7 @@ ******* .. autoclass:: StringifyMapper - - .. automethod:: __call__ - .. autoclass:: CSESplittingStringifyMapperMixin - .. autoclass:: LaTeXMapper """ @@ -105,6 +101,8 @@ class StringifyMapper(Mapper[str, Concatenate[int, P]]): When it encounters an unsupported :class:`pymbolic.ExpressionNode` subclass, it calls its :meth:`pymbolic.ExpressionNode.make_stringifier` method to get a :class:`StringifyMapper` that potentially does. + + .. automethod:: __call__ """ # {{{ replaceable string composition interface @@ -118,7 +116,8 @@ def join(self, joiner: str, seq: Sequence[Expression]) -> str: # {{{ deprecated junk @deprecated("interface not type-safe, use rec_with_parens_around_types") - def rec_with_force_parens_around(self, expr, *args, **kwargs): + def rec_with_force_parens_around( + self, expr, *args: P.args, **kwargs: P.kwargs) -> str: warn( "rec_with_force_parens_around is deprecated and will be removed in 2025. " "Use rec_with_parens_around_types instead. ", @@ -142,8 +141,8 @@ def join_rec( joiner: str, seq: Sequence[Expression], prec: int, - *args, - **kwargs, # force_with_parens_around may hide in here + *args: P.args, + **kwargs: P.kwargs, # force_with_parens_around may hide in here ) -> str: f = joiner.join("%s" for _ in seq) @@ -219,16 +218,18 @@ def parenthesize_if_needed(self, s: str, enclosing_prec: int, my_prec: int) -> s @override def handle_unsupported_expression( - self, expr, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.ExpressionNode, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: strifier = expr.make_stringifier(self) if isinstance(self, type(strifier)): - raise ValueError(f"stringifier '{self}' can't handle '{expr.__class__}'") + raise ValueError(f"stringifier '{self}' cannot handle '{type(expr)}'") + return strifier(expr, enclosing_prec, *args, **kwargs) @override def map_constant( - self, expr: object, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: object, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: result = str(expr) @@ -242,21 +243,19 @@ def map_constant( return result @override - def map_variable( - self, expr: p.Variable, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs - ) -> str: + def map_variable(self, expr: p.Variable, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs) -> str: return expr.name @override - def map_wildcard( - self, expr: p.Wildcard, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs - ) -> str: + def map_wildcard(self, expr: p.Wildcard, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs) -> str: return "*" @override def map_function_symbol( self, - expr: p.FunctionSymbol, + expr: p.FunctionSymbol, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -265,7 +264,7 @@ def map_function_symbol( @override def map_call( - self, expr: p.Call, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Call, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.format( "%s(%s)", @@ -276,7 +275,7 @@ def map_call( @override def map_call_with_kwargs( self, - expr: p.CallWithKwargs, + expr: p.CallWithKwargs, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -284,7 +283,7 @@ def map_call_with_kwargs( args_strings = tuple([ self.rec(ch, PREC_NONE, *args, **kwargs) for ch in expr.parameters ]) + tuple([ - "{}={}".format(name, self.rec(ch, PREC_NONE, *args, **kwargs)) + f"{name}={self.rec(ch, PREC_NONE, *args, **kwargs)}" for name, ch in expr.kw_parameters.items() ]) return self.format( @@ -295,7 +294,8 @@ def map_call_with_kwargs( @override def map_subscript( - self, expr: p.Subscript, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Subscript, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: if isinstance(expr.index, tuple): index_str = self.join_rec(", ", expr.index, PREC_NONE, *args, **kwargs) @@ -314,7 +314,8 @@ def map_subscript( @override def map_lookup( - self, expr: p.Lookup, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Lookup, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -326,7 +327,7 @@ def map_lookup( @override def map_sum( - self, expr: p.Sum, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Sum, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec(" + ", expr.children, PREC_SUM, *args, **kwargs), @@ -336,11 +337,12 @@ def map_sum( # {{{ multiplicative operators - multiplicative_primitives = (p.Product, p.Quotient, p.FloorDiv, p.Remainder) + multiplicative_primitives: tuple[type[p.ExpressionNode], ...] = ( + p.Product, p.Quotient, p.FloorDiv, p.Remainder) @override def map_product( - self, expr: p.Product, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Product, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec_with_parens_around_types( @@ -357,7 +359,8 @@ def map_product( @override def map_quotient( - self, expr: p.Quotient, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Quotient, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -385,7 +388,8 @@ def map_quotient( @override def map_floor_div( - self, expr: p.FloorDiv, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.FloorDiv, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -411,7 +415,8 @@ def map_floor_div( @override def map_remainder( - self, expr: p.Remainder, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Remainder, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -439,7 +444,8 @@ def map_remainder( @override def map_power( - self, expr: p.Power, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Power, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -453,7 +459,8 @@ def map_power( @override def map_left_shift( - self, expr: p.LeftShift, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.LeftShift, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( # +1 to address @@ -469,11 +476,8 @@ def map_left_shift( @override def map_right_shift( - self, - expr: p.RightShift, - enclosing_prec: int, - *args: P.args, - **kwargs: P.kwargs, + self, expr: p.RightShift, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, ) -> str: return self.parenthesize_if_needed( # +1 to address @@ -490,7 +494,7 @@ def map_right_shift( @override def map_bitwise_not( self, - expr: p.BitwiseNot, + expr: p.BitwiseNot, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -503,7 +507,8 @@ def map_bitwise_not( @override def map_bitwise_or( - self, expr: p.BitwiseOr, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.BitwiseOr, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec(" | ", expr.children, PREC_BITWISE_OR, *args, **kwargs), @@ -514,7 +519,7 @@ def map_bitwise_or( @override def map_bitwise_xor( self, - expr: p.BitwiseXor, + expr: p.BitwiseXor, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -528,7 +533,7 @@ def map_bitwise_xor( @override def map_bitwise_and( self, - expr: p.BitwiseAnd, + expr: p.BitwiseAnd, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -541,7 +546,8 @@ def map_bitwise_and( @override def map_comparison( - self, expr: p.Comparison, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Comparison, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -557,7 +563,7 @@ def map_comparison( @override def map_logical_not( self, - expr: p.LogicalNot, + expr: p.LogicalNot, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -570,7 +576,8 @@ def map_logical_not( @override def map_logical_or( - self, expr: p.LogicalOr, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.LogicalOr, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec(" or ", expr.children, PREC_LOGICAL_OR, *args, **kwargs), @@ -581,7 +588,7 @@ def map_logical_or( @override def map_logical_and( self, - expr: p.LogicalAnd, + expr: p.LogicalAnd, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -595,7 +602,7 @@ def map_logical_and( @override def map_list( self, - expr: list[Expression], + expr: list[Expression], /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -604,12 +611,10 @@ def map_list( "[%s]", self.join_rec(", ", expr, PREC_NONE, *args, **kwargs) ) - map_vector = map_list - @override def map_tuple( self, - expr: tuple[Expression, ...], + expr: tuple[Expression, ...], /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -625,7 +630,7 @@ def map_tuple( @override def map_numpy_array( self, - expr: NDArray[np.generic], + expr: NDArray[np.generic], /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -646,16 +651,14 @@ def map_numpy_array( " {}: {}\n".format(",".join(str(i_i) for i_i in i), val) for i, val in numpy.ndenumerate(str_array) ] - if max_length > 70: - splitter = " " + "-" * 75 + "\n" - return "array(\n{})".format(splitter.join(lines)) - else: - return "array(\n{})".format("".join(lines)) + splitter = (" " + "-" * 75 + "\n") if max_length > 70 else "" + + return f"array(\n{splitter.join(lines)})" @override def map_multivector( self, - expr: MultiVector, + expr: MultiVector[Any], /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -664,14 +667,14 @@ def map_multivector( def map_common_subexpression( self, - expr: p.CommonSubexpression, + expr: p.CommonSubexpression, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, ) -> str: - from pymbolic.primitives import CommonSubexpression - - type_name = "CSE" if type(expr) is CommonSubexpression else type(expr).__name__ + type_name = ( + "CSE" if type(expr) is p.CommonSubexpression + else type(expr).__name__) return self.format( "%s(%s)", type_name, self.rec(expr.child, PREC_NONE, *args, **kwargs) @@ -679,21 +682,22 @@ def map_common_subexpression( @override def map_if( - self, expr: p.If, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.If, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: + then_ = self.rec(expr.then, PREC_LOGICAL_OR, *args, **kwargs) + cond_ = self.rec(expr.condition, PREC_LOGICAL_OR, *args, **kwargs) + else_ = self.rec(expr.else_, PREC_LOGICAL_OR, *args, **kwargs) + return self.parenthesize_if_needed( - "{} if {} else {}".format( - self.rec(expr.then, PREC_LOGICAL_OR, *args, **kwargs), - self.rec(expr.condition, PREC_LOGICAL_OR, *args, **kwargs), - self.rec(expr.else_, PREC_LOGICAL_OR, *args, **kwargs), - ), + f"{then_} if {cond_} else {else_}", enclosing_prec, PREC_IF, ) @override def map_min( - self, expr: p.Min, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Min, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: what = type(expr).__name__.lower() return self.format( @@ -704,7 +708,7 @@ def map_min( @override def map_max( - self, expr: p.Max, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Max, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: what = type(expr).__name__.lower() return self.format( @@ -715,34 +719,34 @@ def map_max( @override def map_derivative( - self, expr: p.Derivative, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Derivative, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: - derivs = " ".join(f"d/d{v}" for v in expr.variables) - - return "{} {}".format( - derivs, self.rec(expr.child, PREC_PRODUCT, *args, **kwargs) - ) + ddv = " ".join(f"d/d{v}" for v in expr.variables) + child = self.rec(expr.child, PREC_PRODUCT, *args, **kwargs) + return f"{ddv} {child}" @override def map_substitution( self, - expr: p.Substitution, + expr: p.Substitution, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, ) -> str: substs = ", ".join( - "{}={}".format(name, self.rec(val, PREC_NONE, *args, **kwargs)) + f"{name}={self.rec(val, PREC_NONE, *args, **kwargs)}" for name, val in zip(expr.variables, expr.values, strict=True) ) + child = self.rec(expr.child, PREC_NONE, *args, **kwargs) - return "[%s]{%s}" % (self.rec(expr.child, PREC_NONE, *args, **kwargs), substs) + return f"[{child}]{substs}" @override def map_slice( - self, expr: p.Slice, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Slice, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: - children = [] + children: list[str] = [] for child in expr.children: if child is None: children.append("") @@ -755,14 +759,15 @@ def map_slice( @override def map_nan( - self, expr: p.NaN, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.NaN, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return "NaN" # }}} @override - def __call__(self, expr, prec=PREC_NONE, *args: P.args, **kwargs: P.kwargs) -> str: + def __call__(self, expr: Expression, /, prec: int = PREC_NONE, + *args: P.args, **kwargs: P.kwargs) -> str: """Return a string corresponding to *expr*. If the enclosing precedence level *prec* is higher than *prec* (see :ref:`prec-constants`), parenthesize the result. @@ -771,13 +776,16 @@ def __call__(self, expr, prec=PREC_NONE, *args: P.args, **kwargs: P.kwargs) -> s return Mapper.__call__(self, expr, prec, *args, **kwargs) -class CachedStringifyMapper(StringifyMapper[P], CachedMapper): +class CachedStringifyMapper(StringifyMapper[P], + CachedMapper[str, Concatenate[int, P]]): def __init__(self) -> None: StringifyMapper.__init__(self) CachedMapper.__init__(self) - def __call__(self, expr, prec=PREC_NONE, *args: P.args, **kwargs: P.kwargs) -> str: - return CachedMapper.__call__(expr, prec, *args, **kwargs) + @override + def __call__(self, expr: Expression, /, prec: int = PREC_NONE, + *args: P.args, **kwargs: P.kwargs) -> str: + return CachedMapper.__call__(self, expr, prec, *args, **kwargs) # }}} @@ -823,7 +831,7 @@ def __init__(self) -> None: def map_common_subexpression( self, - expr: p.CommonSubexpression, + expr: p.CommonSubexpression, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -835,24 +843,28 @@ def map_common_subexpression( if expr.prefix is not None: - def generate_cse_names(): + def generate_cse_names() -> Iterator[str]: + assert expr.prefix is not None + yield expr.prefix i = 2 while True: - yield expr.prefix + f"_{i}" + yield f"{expr.prefix}_{i}" i += 1 else: - def generate_cse_names(): + def generate_cse_names() -> Iterator[str]: i = 0 while True: yield "CSE" + str(i) i += 1 + cse_name = None for cse_name in generate_cse_names(): if cse_name not in self.cse_names: break + assert cse_name is not None self.cse_name_list.append((cse_name, str_child)) self.cse_to_name[expr.child] = cse_name @@ -861,9 +873,10 @@ def generate_cse_names(): return cse_name def get_cse_strings(self) -> list[str]: + cse_name_list: list[tuple[str, str]] = getattr(self, "cse_name_list", []) return [ f"{cse_name} : {cse_str}" - for cse_name, cse_str in sorted(getattr(self, "cse_name_list", [])) + for cse_name, cse_str in sorted(cse_name_list) ] @@ -874,19 +887,23 @@ def get_cse_strings(self) -> list[str]: class SortingStringifyMapper(StringifyMapper[P]): - def __init__(self, reverse=True): + reverse: bool + + def __init__(self, reverse: bool = True) -> None: super().__init__() self.reverse = reverse + @override def map_sum( - self, expr: p.Sum, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Sum, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: entries = [self.rec(i, PREC_SUM, *args, **kwargs) for i in expr.children] entries.sort(reverse=self.reverse) return self.parenthesize_if_needed("+".join(entries), enclosing_prec, PREC_SUM) + @override def map_product( - self, expr: p.Product, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Product, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: entries = [self.rec(i, PREC_PRODUCT, *args, **kwargs) for i in expr.children] entries.sort(reverse=self.reverse) @@ -902,31 +919,32 @@ def map_product( class SimplifyingSortingStringifyMapper(StringifyMapper[P]): - def __init__(self, reverse=True): + reverse: bool + + def __init__(self, reverse: bool = True) -> None: super().__init__() self.reverse = reverse + @override def map_sum( - self, expr: p.Sum, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Sum, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: - def get_neg_product(expr): - from pymbolic.primitives import Product, is_zero - + def get_neg_product(expr: ArithmeticExpression) -> ArithmeticExpression | None: if ( - isinstance(expr, Product) + isinstance(expr, p.Product) and len(expr.children) - and is_zero(expr.children[0] + 1) + and p.is_zero(expr.children[0] + 1) ): if len(expr.children) == 2: # only the minus sign and the other child return expr.children[1] else: - return Product(expr.children[1:]) + return p.Product(expr.children[1:]) else: return None - positives = [] - negatives = [] + positives: list[str] = [] + negatives: list[str] = [] for ch in expr.children: neg_prod = get_neg_product(ch) @@ -944,10 +962,11 @@ def get_neg_product(expr): return self.parenthesize_if_needed(result, enclosing_prec, PREC_SUM) + @override def map_product( - self, expr: p.Product, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Product, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: - entries = [] + entries: list[str] = [] i = 0 while i < len(expr.children): @@ -955,7 +974,7 @@ def map_product( if False: # NOTE: That space needs to be there. # Otherwise two unary minus signs merge into a pre-decrement. - entries.append( + entries.append( # pyright: ignore[reportUnreachable] self.format( "- %s", self.rec(expr.children[i + 1], PREC_UNARY, *args, **kwargs), @@ -988,8 +1007,10 @@ class LaTeXMapper(StringifyMapper[P]): ">": r">", } + @override def map_remainder( - self, expr: p.Remainder, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Remainder, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.format( r"(%s \bmod %s)", @@ -997,8 +1018,10 @@ def map_remainder( self.rec(expr.denominator, PREC_POWER, *args, **kwargs), ) + @override def map_left_shift( - self, expr: p.LeftShift, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.LeftShift, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -1010,9 +1033,10 @@ def map_left_shift( PREC_SHIFT, ) + @override def map_right_shift( self, - expr: p.RightShift, + expr: p.RightShift, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -1027,9 +1051,10 @@ def map_right_shift( PREC_SHIFT, ) + @override def map_bitwise_xor( self, - expr: p.BitwiseXor, + expr: p.BitwiseXor, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -1042,8 +1067,10 @@ def map_bitwise_xor( PREC_BITWISE_XOR, ) + @override def map_product( - self, expr: p.Product, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Product, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec(" ", expr.children, PREC_PRODUCT, *args, **kwargs), @@ -1051,8 +1078,10 @@ def map_product( PREC_PRODUCT, ) + @override def map_power( - self, expr: p.Power, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Power, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -1064,8 +1093,10 @@ def map_power( PREC_NONE, ) + @override def map_min( - self, expr: p.Min, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Min, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: from pytools import is_single_valued @@ -1079,8 +1110,10 @@ def map_min( self.join_rec(", ", expr.children, PREC_NONE, *args, **kwargs), ) + @override def map_max( - self, expr: p.Max, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Max, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: from pytools import is_single_valued @@ -1094,8 +1127,10 @@ def map_max( self.join_rec(", ", expr.children, PREC_NONE, *args, **kwargs), ) + @override def map_floor_div( - self, expr: p.FloorDiv, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.FloorDiv, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.format( r"\lfloor {%s} / {%s} \rfloor", @@ -1103,8 +1138,10 @@ def map_floor_div( self.rec(expr.denominator, PREC_NONE, *args, **kwargs), ) + @override def map_subscript( - self, expr: p.Subscript, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Subscript, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: if isinstance(expr.index, tuple): index_str = self.join_rec(", ", expr.index, PREC_NONE, *args, **kwargs) @@ -1115,9 +1152,10 @@ def map_subscript( "{%s}_{%s}", self.rec(expr.aggregate, PREC_CALL, *args, **kwargs), index_str ) + @override def map_logical_not( self, - expr: p.LogicalNot, + expr: p.LogicalNot, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -1128,8 +1166,10 @@ def map_logical_not( PREC_UNARY, ) + @override def map_logical_or( - self, expr: p.LogicalOr, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.LogicalOr, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.join_rec(r" \vee ", expr.children, PREC_LOGICAL_OR, *args, **kwargs), @@ -1137,9 +1177,10 @@ def map_logical_or( PREC_LOGICAL_OR, ) + @override def map_logical_and( self, - expr: p.LogicalAnd, + expr: p.LogicalAnd, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, @@ -1152,8 +1193,10 @@ def map_logical_and( PREC_LOGICAL_AND, ) + @override def map_comparison( - self, expr: p.Comparison, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Comparison, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: return self.parenthesize_if_needed( self.format( @@ -1166,15 +1209,16 @@ def map_comparison( PREC_COMPARISON, ) + @override def map_substitution( self, - expr: p.Substitution, + expr: p.Substitution, /, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs, ) -> str: substs = ", ".join( - "{}={}".format(name, self.rec(val, PREC_NONE, *args, **kwargs)) + f"{name}={self.rec(val, PREC_NONE, *args, **kwargs)}" for name, val in zip(expr.variables, expr.values, strict=True) ) @@ -1182,14 +1226,15 @@ def map_substitution( r"[%s]\{%s\}", self.rec(expr.child, PREC_NONE, *args, **kwargs), substs ) + @override def map_derivative( - self, expr: p.Derivative, enclosing_prec: int, *args: P.args, **kwargs: P.kwargs + self, expr: p.Derivative, /, + enclosing_prec: int, *args: P.args, **kwargs: P.kwargs ) -> str: - derivs = " ".join(r"\frac{\partial}{\partial %s}" % v for v in expr.variables) + ddv = " ".join(fr"\frac{{\partial}}{{\partial {v}}}" for v in expr.variables) + child = self.rec(expr.child, PREC_PRODUCT, *args, **kwargs) - return self.format( - "%s %s", derivs, self.rec(expr.child, PREC_PRODUCT, *args, **kwargs) - ) + return self.format("%s %s", ddv, child) # }}} diff --git a/pymbolic/mapper/unifier.py b/pymbolic/mapper/unifier.py index ce91e8ad..0395cfce 100644 --- a/pymbolic/mapper/unifier.py +++ b/pymbolic/mapper/unifier.py @@ -107,9 +107,8 @@ def unify(self, other: UnificationRecord | None) -> UnificationRecord | None: @override def __repr__(self) -> str: - return "UnificationRecord({})".format( - ", ".join(f"{lhs} = {rhs}" for lhs, rhs in self.equations) - ) + eqs = ", ".join(f"{lhs} = {rhs}" for lhs, rhs in self.equations) + return f"{type(self).__name__}({eqs})" def unify_many( @@ -163,7 +162,7 @@ def treat_mismatch( other: Expression, urecs: Sequence[UnificationRecord] ) -> Sequence[UnificationRecord]: - raise NotImplementedError + pass def unification_record_from_equation( self, lhs: Expression, rhs: Expression) -> UnificationRecord | None: diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index 4585637e..fcabf45f 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -1738,19 +1738,22 @@ def flattened_product(terms: Iterable[ArithmeticExpression]) -> ArithmeticExpres return Product(tuple(done)) -def quotient(numerator, denominator): +def quotient(numerator: ArithmeticExpression, + denominator: ArithmeticExpression) -> ArithmeticExpression: if not (denominator-1): return numerator - import pymbolic.rational as rat - if isinstance(numerator, rat.Rational) and \ - isinstance(denominator, rat.Rational): + from pymbolic.rational import Rational + + if ( + isinstance(numerator, Rational) + and isinstance(denominator, Rational)): return numerator * denominator.reciprocal() try: c_traits = traits.common_traits(numerator, denominator) if isinstance(c_traits, traits.EuclideanRingTraits): - return rat.Rational(numerator, denominator) + return Rational(numerator, denominator) except traits.NoCommonTraitsError: pass except traits.NoTraitsError: diff --git a/pymbolic/rational.py b/pymbolic/rational.py index 693d3301..b966af6a 100644 --- a/pymbolic/rational.py +++ b/pymbolic/rational.py @@ -122,7 +122,7 @@ def __pow__(self, other): def __getinitargs__(self): return (self.Numerator, self.Denominator) - def reciprocal(self): + def reciprocal(self) -> Rational: return Rational(self.Denominator, self.Numerator) mapper_method = intern("map_rational")