algbench.db package
Submodules
algbench.db.json_serializer module
A reasonably robust JSON-serializer. The purpose is only to save data for a later analysis, not to recreate it exactly. If something cannot be converted to JSON, it is converted to str.
algbench.db.nfs_json_dict module
algbench.db.nfs_json_list module
- class algbench.db.nfs_json_list.NfsJsonList(path: str | Path, file_split_mb: float = 30)[source]
Bases:
objectA simple database to dump data (dictionaries) into. Should be reasonably threadsafe even for slurm pools with NFS.
- compress(compression=14, compresslevel=None)[source]
Warning: This may not be threadsafe! If you want to extract all data to a single file, just use ‘read’ and dump the output into a single json.
- iter_compressed()[source]
Iterate over all entries in the compressed database. This may not represent the whole database if the database is not completely compressed. Use the
__iter__method to iterate over the whole database.
algbench.db.nfs_json_set module
Module contents
This module provides some datastructures to save JSON-data in an NFS.
- class algbench.db.NfsJsonList(path: str | Path, file_split_mb: float = 30)[source]
Bases:
objectA simple database to dump data (dictionaries) into. Should be reasonably threadsafe even for slurm pools with NFS.
- compress(compression=14, compresslevel=None)[source]
Warning: This may not be threadsafe! If you want to extract all data to a single file, just use ‘read’ and dump the output into a single json.
- iter_compressed()[source]
Iterate over all entries in the compressed database. This may not represent the whole database if the database is not completely compressed. Use the
__iter__method to iterate over the whole database.