Skip to content

Commit

Permalink
linters fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matveyvarg committed Apr 16, 2024
1 parent 3f15040 commit 3c1fcc1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
3 changes: 2 additions & 1 deletion deker/ABC/base_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ def _create_from_meta(

try:
# To ensure the order of attributes
primary_attributes, custom_attributes = OrderedDict(), OrderedDict()
primary_attributes: OrderedDict = OrderedDict()
custom_attributes: OrderedDict = OrderedDict()

# Iterate over every attribute in schema:
for attr_schema in attrs_schema:
Expand Down
29 changes: 7 additions & 22 deletions deker/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
Any,
Callable,
Dict,
Generic,
List,
Optional,
Sequence,
Union,
Tuple,
TypeVar,
Generic,
Union,
)
from uuid import uuid4

Expand Down Expand Up @@ -99,7 +99,7 @@ def array_id(self) -> str:
path = self.array
id_ = path.name.split(".")[0]
else:
id_ = self.array.id
id_ = self.array.id # type: ignore[attr-defined]
return id_

@property
Expand All @@ -117,7 +117,7 @@ def dir_path(self) -> Path:
def wait_for_unlock(
check_func: Callable, check_func_args: tuple, timeout: int, interval: float
) -> bool:
"""Waiting while there is no locks
"""Waiting while there is no locks.
:param check_func: Func that check if lock has been releases
:param check_func_args: Args for func
Expand Down Expand Up @@ -286,11 +286,7 @@ def check_type(self) -> None:
self.skip_lock = True

def get_path(self) -> Optional[Path]: # noqa[ARG002]
"""Path of json Varray file.
:param func_args: arguments of the function that has been called.
:param func_kwargs: keyword arguments of the function that has been called.
"""
"""Path of json Varray file."""
array = self.instance._VSubset__array
adapter = self.instance._VSubset__adapter
path = get_main_path(
Expand All @@ -303,7 +299,6 @@ def check_locks_for_array_and_set_flock(self, filename: Path) -> Flock:
"""Check if there is no read lock.
:param filename: Path to file that should be flocked
:return:
"""
# Check read lock first
array_id = filename.name.split(".")[0]
Expand All @@ -326,7 +321,6 @@ def check_arrays_locks(
) -> List[Path]:
"""Check all Arrays that are in current VArray.
:param arrays_positions: Arrays' positions in VArray
:param adapter: Array Adapter instance
:param varray: VArray
"""
Expand Down Expand Up @@ -503,12 +497,7 @@ class UpdateMetaAttributeLock(LockWithArrayMixin[Union["Array", "VArray"]], Base
ALLOWED_TYPES = ["LocalArrayAdapter", "LocalVArrayAdapter"]

def get_path(self) -> Path:
"""Return path to the file that should be locked.
:param func_args: arguments for called method
:param func_kwargs: keyword arguments for called method
:return:
"""
"""Return path to the file that should be locked."""
# Get directory where file locates
dir_path = get_main_path(
self.array.id, self.instance.collection_path / self.instance.data_dir
Expand All @@ -524,11 +513,7 @@ class CollectionLock(BaseLock):
ALLOWED_TYPES = ["LocalCollectionAdapter"]

def get_path(self) -> Path: # noqa[ARG002]
"""Return path to collection lock file.
:param func_args: arguments for called method
:param func_kwargs: keyword arguments for called method
"""
"""Return path to collection lock file."""
collection = self.args[1]
path = self.instance.collections_resource / (collection.name + ".lock")
self.logger.debug(f"Got path for collection {collection.name} lock file: {path}")
Expand Down

0 comments on commit 3c1fcc1

Please sign in to comment.