From e5c3dbd13b90832fa93dc80b1dc027c526cb0a7b Mon Sep 17 00:00:00 2001 From: Olivier Desenfans Date: Wed, 6 Sep 2023 15:27:45 +0200 Subject: [PATCH] black --- src/aleph/services/cost.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/aleph/services/cost.py b/src/aleph/services/cost.py index 9cd29a776..1bd880233 100644 --- a/src/aleph/services/cost.py +++ b/src/aleph/services/cost.py @@ -13,7 +13,7 @@ def _get_file_from_ref( - session: DbSession, ref: str, use_latest: bool + session: DbSession, ref: str, use_latest: bool ) -> Optional[StoredFileDb]: tag_or_pin: Optional[Union[MessageFilePinDb, FileTagDb]] @@ -62,7 +62,7 @@ def get_volume_size(session: DbSession, content: ExecutableContent) -> int: def get_additional_storage_price( - content: ExecutableContent, session: DbSession + content: ExecutableContent, session: DbSession ) -> Decimal: is_microvm = isinstance(content, ProgramContent) and not content.on.persistent nb_compute_units = content.resources.vcpus @@ -98,6 +98,8 @@ def compute_cost(session: DbSession, content: ExecutableContent) -> Decimal: compute_units_required = _get_compute_unit(content) compute_unit_multiplier = _get_compute_unit_multiplier(content) - compute_unit_price = Decimal(compute_units_required) * compute_unit_multiplier * compute_unit_cost + compute_unit_price = ( + Decimal(compute_units_required) * compute_unit_multiplier * compute_unit_cost + ) price = compute_unit_price + get_additional_storage_price(content, session) return Decimal(price)