Skip to content

Commit

Permalink
Variable.__repr__: handle missing value (for conserved quantities)
Browse files Browse the repository at this point in the history
  • Loading branch information
jornbr committed Oct 16, 2024
1 parent 0265bde commit f2fe0a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pyfabm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ def options(self) -> Optional[Sequence]:
pass

def __repr__(self) -> str:
return f"<{self.name}={self.value}>"
postfix = f"={self.value}" if hasattr(self, "value") else ""
return f"<{self.name}{postfix}>"


class VariableFromPointer(Variable):
Expand Down

0 comments on commit f2fe0a2

Please sign in to comment.