Skip to content

Commit 1b4ead6

Browse files
committed
fix
1 parent 93a077f commit 1b4ead6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

CHANGELOGS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Logs
44
0.7.0
55
+++++
66

7+
* :pr:`147`: simplified log processing
78
* :pr:`146`: patch for IdeficsAttention, IdeficsEmbedding
89
* :pr:`145`: patch for _compute_dynamic_ntk_parameters (Phi3RotaryEmbedding)
910
* :pr:`144`: support for second inputs with different dimension,

onnx_diagnostic/helpers/log_helper.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ def load(self, verbose: int = 0):
3434
self.data = self._data
3535
elif isinstance(self._data, list) and all(isinstance(r, dict) for r in self._data):
3636
if verbose:
37-
print(f"[CubeLogs.load] load from list of dicts, shape={self._data.shape}")
37+
print(f"[CubeLogs.load] load from list of dicts, n={len(self._data)}")
3838
self.data = pandas.DataFrame(self._data)
3939
else:
4040
raise NotImplementedError(
4141
f"Not implemented with the provided data (type={type(self._data)})"
4242
)
4343

44-
assert all(isinstance(c, str) for c in self._data.columns), (
44+
assert all(isinstance(c, str) for c in self.data.columns), (
4545
f"The class only supports string as column names "
46-
f"but found {[c for c in self._data.columns if not isinstance(c, str)]}"
46+
f"but found {[c for c in self.data.columns if not isinstance(c, str)]}"
4747
)
4848
if verbose:
4949
print(f"[CubeLogs.load] loaded with shape={self.data.shape}")
@@ -183,14 +183,16 @@ def view(
183183
assert set(values) <= set(
184184
self.values
185185
), f"Non existing columns in values {set(values) - set(self.values)}"
186-
key_columns = {c for c in self.keys if c not in key_index}
186+
set_key_columns = {c for c in self.keys if c not in key_index}
187187
if ignore_unique:
188188
key_index = [k for k in key_index if len(self.values_for_key[k]) > 1]
189-
key_columns = [k for k in key_columns if len(self.values_for_key[k]) > 1]
189+
key_columns = [k for k in set_key_columns if len(self.values_for_key[k]) > 1]
190+
else:
191+
key_columns = sorted(set_key_columns)
190192
if order:
191-
assert set(order) <= set(key_columns), (
193+
assert set(order) <= set_key_columns, (
192194
f"Non existing columns from order in key_columns "
193-
f"{set(order) - set(key_columns)}"
195+
f"{set(order) - set_key_columns}"
194196
)
195197
key_columns = [*order, *[c for c in key_columns if c not in order]]
196198
return self.data.pivot(index=key_index[::-1], columns=key_columns, values=values)

0 commit comments

Comments
 (0)