Skip to content

Commit

Permalink
Fix doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianliebig committed Nov 26, 2024
1 parent ce9d12f commit 5a471c3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions benchmarks/persistence/persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 5a471c3

Please sign in to comment.