Skip to content

Commit

Permalink
Add bold_name parameter for _print_Symbol #123
Browse files Browse the repository at this point in the history
  • Loading branch information
mph- committed Jan 21, 2024
1 parent 97f4d17 commit f591197
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lcapy/printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def _print_Sequence(self, seq):
s = prettyForm(*s.parens('{', '}', ifascii_nougly=True))
return s

def _print_Symbol(self, expr):
def _print_Symbol(self, expr, bold_name=False):

expr = sym.Symbol(canonical_name(expr.name))
parts = expr.name.split('_')
Expand All @@ -355,7 +355,7 @@ def _print_Symbol(self, expr):
# the subscripts. Note, Sympy converts 'v_C1' into
# 'v_C_1' so we need to clean up.
expr.name = parts[0] + '_' + ''.join(parts[1:])
s = super(LcapyPrettyPrinter, self)._print_Symbol(expr)
s = super(LcapyPrettyPrinter, self)._print_Symbol(expr, bold_name)
return s

def _print_Piecewise(self, expr):
Expand Down

2 comments on commit f591197

@torhans
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to add *args and/or **kwargs ?

@mph-
Copy link
Owner Author

@mph- mph- commented on f591197 Jan 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's a good idea since SymPy printing code often takes new arguments.

Please sign in to comment.