Skip to content

Commit 9daf85c

Browse files
Starting from scratch (diff table layout)
1 parent 9242104 commit 9daf85c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/prog_models/utils/parameters.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,20 @@ def register_derived_callback(self, key : str, callback : Callable) -> None:
122122
updates = callback(self[key])
123123
self.update(updates)
124124

125-
def compare(self, *args):
125+
def compare(self, print_bool : bool = True, *args):
126126
"""Generate a table to compare the configuration of multiple models of the same type. Table is defined by each parameter per row, and each model per column.
127127
128128
Args:
129129
*args (PrognosticsModelParameters):
130130
Additional model parameters to compare this PrognosticsModelParameters against.
131131
"""
132-
from .table import print_table_recursive
133-
print_table_recursive(self.items())
132+
# from .table import print_table_recursive
133+
# print_table_recursive(self, 'TEST')
134+
table = []
135+
for k,v in self.items():
136+
row = f'| {k} | {v} |'
137+
for other in args:
138+
row += f' {other[k]} |'
139+
table.append(row)
140+
if print_bool:
141+
print(*table, sep='\n')

0 commit comments

Comments
 (0)