|
2 | 2 | This module contains checks to be perform by n3fit on the input |
3 | 3 | """ |
4 | 4 |
|
5 | | -import hashlib |
6 | 5 | import logging |
7 | 6 | import numbers |
8 | 7 | import os |
|
28 | 27 | "layer_type", |
29 | 28 | "dropout", |
30 | 29 | ] |
31 | | -MD5FK_FILENAME = "md5fk" |
32 | 30 |
|
33 | 31 |
|
34 | 32 | def _is_floatable(num): |
@@ -566,25 +564,3 @@ def check_eko_exists(theoryid): |
566 | 564 | _ = FallbackLoader().check_eko(theoryid.id) |
567 | 565 | except FileNotFoundError: |
568 | 566 | log.error(f"No eko found for {theoryid}") |
569 | | - |
570 | | - |
571 | | -def fktable_hasher(data, output_path): |
572 | | - """Writes a hash of the fk-tables to a log file. |
573 | | - This hash can be used to ensure whether two |
574 | | - (supposedly identical) fk-tables of the same |
575 | | - theory and dataset are numerically identical. |
576 | | - """ |
577 | | - md5fk_path = output_path / MD5FK_FILENAME |
578 | | - # Open a file to write in |
579 | | - with open(md5fk_path, "w") as f: |
580 | | - # Loop through the dataspecs object |
581 | | - for dataset in data.datasets: |
582 | | - fkspecs = dataset.fkspecs |
583 | | - for fk in fkspecs: |
584 | | - # Make a list of the FK tables |
585 | | - table_names = [name for group in fk.metadata.FK_tables for name in group] |
586 | | - for fkpath, table_name in zip(fk.fkpath, table_names): |
587 | | - for fkpath, table_name in zip(fk.fkpath, table_names): |
588 | | - fkhash = hashlib.md5(fkpath.read_bytes()).hexdigest() |
589 | | - f.write(f"{table_name} {fkhash}\n") |
590 | | - log.info(f"FK-table hash written to {md5fk_path}") |
0 commit comments