Skip to content

Commit 610c811

Browse files
committed
chore(ci): small fixes on data_extractor filename generation
This is done to ease automated SVG tables for tfhe-rs public documentation.
1 parent fbe5eb0 commit 610c811

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

ci/data_extractor/src/benchmark_specs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ def to_str(self):
238238
f"error failure probability str conversion '{self}' not supported yet"
239239
)
240240

241+
def __str__(self):
242+
return self.to_str()
243+
241244

242245
class BenchType(enum.Enum):
243246
Latency = 0

ci/data_extractor/src/data_extractor.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,10 @@ def perform_data_extraction(
313313
conversion_func,
314314
)
315315

316-
file_suffix = f"_{operand_type.lower()}"
316+
if layer != Layer.CoreCrypto:
317+
file_suffix = f"-{operand_type.lower()}"
318+
else:
319+
file_suffix = ""
317320
filename = utils.append_suffix_to_filename(output_filename, file_suffix, ".csv")
318321

319322
utils.write_to_csv(
@@ -332,8 +335,10 @@ def perform_data_extraction(
332335
for array in generic_arrays:
333336
metadata_suffix = ""
334337
if array.metadata:
335-
for key, value in array.metadata.items():
336-
metadata_suffix += f"_{key}_{value}"
338+
for value in array.metadata.values():
339+
# In recent Python, dict keep insert order.
340+
# This call won't change metadata order in the suffix between runs.
341+
metadata_suffix += f"-{value}".lower()
337342

338343
current_suffix = file_suffix + metadata_suffix
339344

ci/data_extractor/src/formatter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,10 @@ def _generate_core_crypto_showcase_arrays(
508508
BenchArray(
509509
array,
510510
self.layer,
511-
metadata={"pfail": key.pfail, "noise": key.noise_distribution},
511+
metadata={
512+
"noise": key.noise_distribution,
513+
"pfail": key.pfail,
514+
},
512515
)
513516
)
514517

0 commit comments

Comments
 (0)