Skip to content
Snippets Groups Projects
Commit 630cc808 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Merge branch 'master' into backend-rework

parents 3f26a0f4 4e579214
No related branches found
No related tags found
No related merge requests found
Pipeline #59645 failed
......@@ -673,7 +673,7 @@ class SympyAssignment(Node):
return hash((self.lhs, self.rhs))
def __eq__(self, other):
return type(self) == type(other) and (self.lhs, self.rhs) == (other.lhs, other.rhs)
return type(self) is type(other) and (self.lhs, self.rhs) == (other.lhs, other.rhs)
class ResolvedFieldAccess(sp.Indexed):
......
......@@ -152,7 +152,7 @@ class CustomCodeNode(Node):
return self._symbols_read - self._symbols_defined
def __eq__(self, other):
return type(self) == type(other) and self._code == other._code
return type(self) is type(other) and self._code == other._code
def __hash__(self):
return hash(self._code)
......
......@@ -76,7 +76,7 @@ class Neumann(Boundary):
return hash("Neumann")
def __eq__(self, other):
return type(other) == Neumann
return type(other) is Neumann
class Dirichlet(Boundary):
......
......@@ -65,7 +65,7 @@ class RNGBase(CustomCodeNode):
return (self._name, *self.result_symbols, *self.args)
def __eq__(self, other):
return type(self) == type(other) and self._hashable_content() == other._hashable_content()
return type(self) is type(other) and self._hashable_content() == other._hashable_content()
def __hash__(self):
return hash(self._hashable_content())
......
......@@ -356,7 +356,7 @@ def remove_higher_order_terms(expr: sp.Expr, symbols: Sequence[sp.Symbol], order
factor_count = 0
if type(product) is Mul:
for factor in product.args:
if type(factor) == Pow:
if type(factor) is Pow:
if factor.args[0] in symbols:
factor_count += factor.args[1]
if factor in symbols:
......@@ -366,13 +366,13 @@ def remove_higher_order_terms(expr: sp.Expr, symbols: Sequence[sp.Symbol], order
factor_count += product.args[1]
return factor_count
if type(expr) == Mul or type(expr) == Pow:
if type(expr) is Mul or type(expr) is Pow:
if velocity_factors_in_product(expr) <= order:
return expr
else:
return Zero()
if type(expr) != Add:
if type(expr) is not Add:
return expr
for sum_term in expr.args:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment