From 5a471c35a28fe37f99478ef15f73e5d75a9b45a6 Mon Sep 17 00:00:00 2001 From: Fabian Liebig Date: Tue, 26 Nov 2024 16:37:01 +0100 Subject: [PATCH] Fix doc strings --- benchmarks/persistence/persistence.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/benchmarks/persistence/persistence.py b/benchmarks/persistence/persistence.py index 201a16f7e..67549e612 100644 --- a/benchmarks/persistence/persistence.py +++ b/benchmarks/persistence/persistence.py @@ -33,17 +33,16 @@ class PathStrategy(Enum): @define class PathConstructor: - """A class to construct the file path of a result object. + """A class to construct the file Path of a result object. - The class encapsulates the construction of a file path depending + The class encapsulates the construction of a file Path depending on where the object should be stored. Since different storage backends have - different requirements for the path, and some like the used S3 bucket + different requirements for the Path, and some like the used S3 bucket do not support folders, the path constructing object uses its variables - to construct a reasonable Path object depending on the strategy. + to construct a reasonable Path object depending on the strategy. - For compatibility reasons, the path is sanitized to contain only the following - allowed characters: - "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-." + For compatibility reasons, the path is sanitized to contain only + lower and upper case letters, digits as well as the symbols '.' and '-'" """ benchmark_name: str = field(validator=instance_of(str)) @@ -129,7 +128,7 @@ class ObjectStorage(Protocol): """Interface for interacting with storage.""" def write_json(self, object: dict, path_constructor: PathConstructor) -> None: - """Store a JSON serializable dictionary according to the path. + """Store a JSON serializable dictionary according to the path_constructor. If the respective object exists, it will be overwritten. @@ -165,13 +164,12 @@ def _default_bucket_name(self) -> str: def write_json(self, object: dict, path_constructor: PathConstructor) -> None: """Store a JSON serializable dictionary in an S3 bucket. - The S3-key of the Java Script Notation Object is created from - the path object. If the key already exists, it will be overwritten. + The S3-key of the JSON is created from + the path_constructor. If the key already exists, it will be overwritten. Args: object: The object to be persisted. path_constructor: The path constructor creating the path for the object. - """ client = self._object_session.client("s3")