Skip to content

Commit

Permalink
Removing some pylint disables as we move to keyword only args
Browse files Browse the repository at this point in the history
  • Loading branch information
julianstirling committed Sep 29, 2024
1 parent e43401e commit e864d5b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
33 changes: 29 additions & 4 deletions nimble_build_system/cad/fasteners.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,16 @@ class Fastener:
_fastener_type = "iso7380_1"
_direction_axis = "-Z"

def __init__(self, name, position, explode_translation, size, fastener_type, direction_axis):
def __init__(
self,
name:str,
*,
position:tuple[float, float, float]=(0.0, 0.0, 0.0),
explode_translation:tuple[float, float, float]=(0.0, 0.0, 0.0),
size:str="M3-0.5",
fastener_type:str="iso7380_1",
direction_axis:str="-Z"
):
"""
Generic fastener constructor that sets common attributes for all faster types.
"""
Expand Down Expand Up @@ -80,15 +89,31 @@ class Screw(Fastener):
"""
_length = 6 # mm

def __init__(self, name, position, explode_translation, size, fastener_type, axis, length):
def __init__(
self,
name:str,
*,
position:tuple[float, float, float]=(0.0, 0.0, 0.0),
explode_translation:tuple[float, float, float]=(0.0, 0.0, 0.0),
size:str="M3-0.5",
fastener_type:str="iso7380_1",
axis:str="-Z",
length:float=6.0
):
"""
Screw constructor that additionally sets the length of the screw.
"""
# pylint: disable=too-many-arguments

self._length = length

super().__init__(name, position, explode_translation, size, fastener_type, axis)
super().__init__(
name,
position=position,
explode_translation=explode_translation,
size=size,
fastener_type=fastener_type,
direction_axis=axis
)

@property
def length(self):
Expand Down
10 changes: 4 additions & 6 deletions nimble_build_system/cad/shelf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"""

# pylint: disable=unused-import
# pylint: disable=too-many-positional-arguments

import os
import posixpath
Expand Down Expand Up @@ -135,7 +134,6 @@ def __init__(self,
rack_params: RackParameters
):

# pylint: disable=too-many-arguments

self._rack_params = rack_params

Expand Down Expand Up @@ -821,10 +819,10 @@ def __init__(self,
}

super().__init__(device,
assembly_key,
position,
color,
rack_params)
assembly_key=assembly_key,
position=position,
color=color,
rack_params=rack_params)


def generate_shelf_model(self):
Expand Down

0 comments on commit e864d5b

Please sign in to comment.