Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "equals" instead of undefined "==" #908

Merged
merged 3 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pynestml/symbols/unit_type_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def print_nestml_type(self):
def equals(self, other=None):
basic_equals = super(UnitTypeSymbol, self).equals(other)
if basic_equals is True:
return self.unit == other.unit
return self.unit.equals(other.unit)

return False

Expand Down
7 changes: 2 additions & 5 deletions pynestml/utils/ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,14 +1304,11 @@ def is_delta_kernel(cls, kernel: ASTKernel) -> bool:

rhs_is_delta_kernel = type(expr) is ASTSimpleExpression \
and expr.is_function_call() \
and expr.get_function_call().get_scope().resolve_to_symbol(
expr.get_function_call().get_name(), SymbolKind.FUNCTION) == PredefinedFunctions.name2function["delta"]
and expr.get_function_call().get_scope().resolve_to_symbol(expr.get_function_call().get_name(), SymbolKind.FUNCTION).equals(PredefinedFunctions.name2function["delta"])
rhs_is_multiplied_delta_kernel = type(expr) is ASTExpression \
and type(expr.get_rhs()) is ASTSimpleExpression \
and expr.get_rhs().is_function_call() \
and expr.get_rhs().get_function_call().get_scope().resolve_to_symbol(
expr.get_rhs().get_function_call().get_name(), SymbolKind.FUNCTION) == PredefinedFunctions.name2function[
"delta"]
and expr.get_rhs().get_function_call().get_scope().resolve_to_symbol(expr.get_rhs().get_function_call().get_name(), SymbolKind.FUNCTION).equals(PredefinedFunctions.name2function["delta"])
return rhs_is_delta_kernel or rhs_is_multiplied_delta_kernel

@classmethod
Expand Down
Loading