From e3cc2873a46e111bf912353ed28567bd630a2bc8 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Fri, 9 Jan 2026 20:34:57 +0100 Subject: [PATCH] ruff fix --- README.md | 3 +- more_math/Parser/MathExprParser.py | 50 +++++++++++++++--------------- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index a4f86af..07064f9 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,9 @@ You can also get the node from comfy manager under the name of More math. - `print(x)`: Prints the value of x to the console and returns x. - `print_shape(x)` or `pshp`: Prints the shape of x to the console and returns x. -- `pinv(x)`: Computes the permutation inverse of list. If `permute(i,x) = j`, then `permute(j,pinv(x)) = i`. +- `pinv(x)`: Computes the permutation inverse of list. If `permute(i,x) = j`, then `permute(j,pinv(x)) = i`. - `range(start, end, step)`: Generates a list of values from start (inclusive) to end (exclusive) with given step. - ## Variables - **Common variables (except FLOAT, MODEL, VAE and CLIP)**: diff --git a/more_math/Parser/MathExprParser.py b/more_math/Parser/MathExprParser.py index b856a83..296b556 100644 --- a/more_math/Parser/MathExprParser.py +++ b/more_math/Parser/MathExprParser.py @@ -396,7 +396,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_compExpr - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -712,7 +712,7 @@ class MathExprParser ( Parser ): self.addExpr(0) pass - + self.state = 53 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,2,self._ctx) @@ -737,7 +737,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_addExpr - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -881,7 +881,7 @@ class MathExprParser ( Parser ): self.mulExpr(0) pass - + self.state = 67 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,4,self._ctx) @@ -906,7 +906,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_mulExpr - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -1093,7 +1093,7 @@ class MathExprParser ( Parser ): self.powExpr() pass - + self.state = 84 self._errHandler.sync(self) _alt = self._interp.adaptivePredict(self._input,6,self._ctx) @@ -1118,7 +1118,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_powExpr - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -1227,7 +1227,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_unaryExpr - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -1366,7 +1366,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_atom - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -1775,7 +1775,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_func1 - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -3192,7 +3192,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_func2 - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -3552,7 +3552,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_func3 - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -3790,7 +3790,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_func4 - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -3874,7 +3874,7 @@ class MathExprParser ( Parser ): def getRuleIndex(self): return MathExprParser.RULE_funcN - + def copyFrom(self, ctx:ParserRuleContext): super().copyFrom(ctx) @@ -4230,49 +4230,49 @@ class MathExprParser ( Parser ): def compExpr_sempred(self, localctx:CompExprContext, predIndex:int): if predIndex == 0: return self.precpred(self._ctx, 7) - + if predIndex == 1: return self.precpred(self._ctx, 6) - + if predIndex == 2: return self.precpred(self._ctx, 5) - + if predIndex == 3: return self.precpred(self._ctx, 4) - + if predIndex == 4: return self.precpred(self._ctx, 3) - + if predIndex == 5: return self.precpred(self._ctx, 2) - + def addExpr_sempred(self, localctx:AddExprContext, predIndex:int): if predIndex == 6: return self.precpred(self._ctx, 3) - + if predIndex == 7: return self.precpred(self._ctx, 2) - + def mulExpr_sempred(self, localctx:MulExprContext, predIndex:int): if predIndex == 8: return self.precpred(self._ctx, 4) - + if predIndex == 9: return self.precpred(self._ctx, 3) - + if predIndex == 10: return self.precpred(self._ctx, 2) - +