From 97531182986ff01128042515d2a6f17e50f49a73 Mon Sep 17 00:00:00 2001 From: Jack Betteridge Date: Fri, 20 Dec 2024 16:04:54 +0000 Subject: [PATCH] sympy: Remove namespacing and tidy --- devito/symbolics/printer.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/devito/symbolics/printer.py b/devito/symbolics/printer.py index 102922aea6..2b4dbd6113 100644 --- a/devito/symbolics/printer.py +++ b/devito/symbolics/printer.py @@ -132,15 +132,14 @@ def _print_Pow(self, expr): PREC = precedence(expr) suffix = 'f' if self.single_prec(expr) else '' if equal_valued(expr.exp, -1): - return f'{self._print_Float(Float(1.0))}/' + \ - f'{self.parenthesize(expr.base, PREC)}' + return self._print_Float(Float(1.0)) + '/' + \ + self.parenthesize(expr.base, PREC) elif equal_valued(expr.exp, 0.5): - return f'{self._ns}sqrt{suffix}({self._print(expr.base)})' + return f'sqrt{suffix}({self._print(expr.base)})' elif expr.exp == S.One/3 and self.standard != 'C89': - return f'{self._ns}cbrt{suffix}({self._print(expr.base)})' + return f'cbrt{suffix}({self._print(expr.base)})' else: - return f'{self._ns}pow{suffix}({self._print(expr.base)}, ' + \ - f'{self._print(expr.exp)})' + return f'pow{suffix}({self._print(expr.base)}, {self._print(expr.exp)})' def _print_Mod(self, expr): """Print a Mod as a C-like %-based operation."""