Skip to content

Commit 7a39441

Browse files
authored
fix black at prefix string (#6122)
* fix black at prefix string * Type -> type * Type unused
1 parent e1ec661 commit 7a39441

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

conversions/prefix_conversions_string.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from __future__ import annotations
1212

1313
from enum import Enum, unique
14-
from typing import Type, TypeVar
14+
from typing import TypeVar
1515

1616
# Create a generic variable that can be 'Enum', or any subclass.
1717
T = TypeVar("T", bound="Enum")
@@ -53,7 +53,7 @@ class SIUnit(Enum):
5353
yocto = -24
5454

5555
@classmethod
56-
def get_positive(cls: Type[T]) -> dict:
56+
def get_positive(cls: type[T]) -> dict:
5757
"""
5858
Returns a dictionary with only the elements of this enum
5959
that has a positive value
@@ -68,7 +68,7 @@ def get_positive(cls: Type[T]) -> dict:
6868
return {unit.name: unit.value for unit in cls if unit.value > 0}
6969

7070
@classmethod
71-
def get_negative(cls: Type[T]) -> dict:
71+
def get_negative(cls: type[T]) -> dict:
7272
"""
7373
Returns a dictionary with only the elements of this enum
7474
that has a negative value
@@ -94,7 +94,7 @@ def add_si_prefix(value: float) -> str:
9494
"""
9595
prefixes = SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
9696
for name_prefix, value_prefix in prefixes.items():
97-
numerical_part = value / (10 ** value_prefix)
97+
numerical_part = value / (10**value_prefix)
9898
if numerical_part > 1:
9999
return f"{str(numerical_part)} {name_prefix}"
100100
return str(value)
@@ -109,7 +109,7 @@ def add_binary_prefix(value: float) -> str:
109109
'64.0 kilo'
110110
"""
111111
for prefix in BinaryUnit:
112-
numerical_part = value / (2 ** prefix.value)
112+
numerical_part = value / (2**prefix.value)
113113
if numerical_part > 1:
114114
return f"{str(numerical_part)} {prefix.name}"
115115
return str(value)

0 commit comments

Comments
 (0)