Skip to content

Commit

Permalink
Apply doc-string suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremy Wright <wrightjmf@gmail.com>
  • Loading branch information
julianstirling and jmwright committed May 19, 2024
1 parent fd16bee commit 45a250f
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion mechanical/components/cadquery/base_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

"""
cq-cli script using cadscript to generate the baseplate of a nimble rack
cq-cli script using cadscript to generate the baseplate of a nimble rack.
"""
import cadscript as cad
from nimble_builder.nimble_end_plate import create_end_plate
Expand Down
4 changes: 2 additions & 2 deletions mechanical/components/cadquery/rack_leg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
cq-cli script using cadscript to generate the rack legs of a nimble rack
cq-cli script using cadscript to generate the rack legs of a nimble rack.
"""

from math import floor
Expand All @@ -21,7 +21,7 @@ def make_rack_leg(
rack_params=None
) -> cad.Body:
"""
Create the rack legs of given length
Create the rack legs of given length.
"""

if not rack_params:
Expand Down
32 changes: 16 additions & 16 deletions nimble_builder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""
On loading nimble_builder the RackParameters dataclass will be available
On loading nimble_builder the RackParameters dataclass will be available.
"""
from dataclasses import dataclass
from typing import Literal

@dataclass
class RackParameters:
"""
A class to hold the RackParameters, both fixed and derived
A class to hold the RackParameters, both fixed and derived.
"""

beam_width: float = 20.0
Expand Down Expand Up @@ -40,7 +40,7 @@ def mounting_hole_clearance_diameter(self):
Return the diameter for a clearance hole for the front mounting screws.
This is determined by the `mounting_screws` parameter.
Clearance holes should be used in tray fronts.
See also: mounting_hole_tap_diameter
See also: `mounting_hole_tap_diameter`
"""
if self.mounting_screws == "M4":
return 4.3
Expand All @@ -54,10 +54,10 @@ def mounting_hole_tap_diameter(self):
Return the diameter for a tapped hole for the front mounting screws.
This is determined by the `mounting_screws` parameter.
Tap holes should be in the legs where the screw will tap.
As 3D printers tend to over extrude ad the fact that the machine screws
are tapping directly into plastic the holes are larger than standard
As 3D printers tend to over extrude and the fact that the machine screws
are tapping directly into plastic, the holes are larger than standard
metric tap holes.
See also: mounting_hole_tap_diameter
See also: `mounting_hole_tap_diameter`
"""
if self.mounting_screws == "M4":
return 3.6
Expand All @@ -71,8 +71,8 @@ def end_plate_hole_clearance_diameter(self):
Return the diameter for a clearance hole for the countersunk screws
that attach the top and bottom plates.
This is determined by the `end_plate_screws` parameter.
Clearance holes should be used in end_plates.
See also: mounting_hole_tap_diameter
Clearance holes should be used in `end_plates`.
See also: `mounting_hole_tap_diameter`
"""
if self.end_plate_screws == "M5":
return 5.4
Expand All @@ -86,7 +86,7 @@ def end_plate_hole_countersink_dia(self):
Return the countersink diameter for a clearance hole for the countersunk screws
that attach the top and bottom plates.
This is determined by the `end_plate_screws` parameter.
See also: mounting_hole_tap_diameter
See also: `mounting_hole_tap_diameter`
"""
if self.end_plate_screws == "M5":
return 11.5
Expand All @@ -101,10 +101,10 @@ def end_plate_hole_tap_diameter(self):
that attach the top and bottom plates.
This is determined by the `end_plate_screws` parameter.
Tap holes should be in the top and bottom of the legs where the screw will tap.
As 3D printers tend to over extrude ad the fact that the machine screws
As 3D printers tend to over extrude and the fact that the machine screws
are tapping directly into plastic the holes are larger than standard
metric tap holes.
See also: mounting_hole_tap_diameter
See also: `mounting_hole_tap_diameter`
"""
if self.end_plate_screws == "M5":
return 4.5
Expand All @@ -118,11 +118,11 @@ def end_plate_hole_tap_diameter(self):
@property
def rack_width(self):
"""
Return the rack width in mm as determined by the nominal_rack_width.
Return the rack width in mm as determined by the `nominal_rack_width`.
Options are:
"6inch" - 155mm - full width (front panel) of the 6 inch nimble rack
"10inch" - 254mm - full width (front panel) of the 10 inch rack
"10inch_reduced - 250mm - as above bu reduced to fit into a 250mm wide printer
`6inch` - 155mm - full width (front panel) of the 6 inch nimble rack
`10inch` - 254mm - full width (front panel) of the 10 inch rack
`10inch_reduced` - 250mm - as above but reduced to fit into a 250mm wide printer
"""
if self.nominal_rack_width == "6inch":
return 155
Expand All @@ -135,7 +135,7 @@ def rack_width(self):
@property
def tray_width(self):
"""
Return derived parameter for the width of a standard tray
Return derived parameter for the width of a standard tray.
"""
return self.rack_width - 2 * self.beam_width

Expand Down
2 changes: 1 addition & 1 deletion nimble_builder/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
A number of helper functions for CadQuery used to simplify the creation of nimble
rack components
rack components.
"""
from typing import Literal
import cadscript as cad
Expand Down
2 changes: 1 addition & 1 deletion nimble_builder/nimble_end_plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def create_end_plate(width, depth, height, rack_params=None):
"""
Create the top and bottom of the rack
Create the top and bottom of the rack.
"""

if not rack_params:
Expand Down
2 changes: 1 addition & 1 deletion nimble_orchestration/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
that have no source code
`GeneratedMechanicalComponent` is a child class of `MechanicalComponent`, it contains
all the information for exsource to generate the CAD models for this component
`AssembledComponent` Is a class that holds very basic assmbly information for a given
`AssembledComponent` is a class that holds very basic assembly information for a given
`MechanicalComponent`
"""
from copy import copy, deepcopy
Expand Down
2 changes: 1 addition & 1 deletion nimble_orchestration/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ def __init__(self, json_node):
@property
def tray_id(self):
"""
Return and identification for the shelf.
Return an identification for the shelf.
"""
return f"tray_h{self.height_in_u}_t{self.shelf_type.lower().replace(' ', '_')}"
2 changes: 1 addition & 1 deletion nimble_orchestration/devices_json_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def usage():

def main():
"""
Main script to turn a CSV into a
Main script to turn a CSV file into a JSON file. It does not do pretty formatting, it is a JSON file with no newlines.
"""

# Check to make sure the user passed a CSV path
Expand Down
2 changes: 1 addition & 1 deletion nimble_orchestration/yaml_cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def clean(data: dict) -> dict:
Clean the input dictionary (recursively). Removing any keys where the value is
none, changing pathlib.Path to strings and converting tuples to strings.
The input is a single dictionary, the output is a cleaned dictionary
The input is a single dictionary, the output is a cleaned dictionary.
"""
# iterate over entries
keys_to_delete = []
Expand Down

0 comments on commit 45a250f

Please sign in to comment.