Skip to content

Commit

Permalink
use str repr for param table html repr when __name__ does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
nvaytet committed Aug 31, 2023
1 parent 623ab45 commit b1690d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/sciline/param_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ def __repr__(self) -> str:
def _repr_html_(self) -> str:
return (
f"<table><tr><th>{self.row_dim.__name__}</th>"
+ "".join(f"<th>{k.__name__}</th>" for k in self._columns.keys())
+ "".join(
f"<th>{getattr(k, '__name__', str(k).split('.')[-1])}</th>"
for k in self._columns.keys()
)
+ "</tr>"
+ "".join(
f"<tr><td>{idx}</td>" + "".join(f"<td>{v}</td>" for v in row) + "</tr>"
Expand Down

0 comments on commit b1690d6

Please sign in to comment.