From 679739d09d1b0071e35cb89e15a7fd8d95c984a3 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 27 Apr 2020 20:09:00 +0200 Subject: [PATCH] Applied requested changes proposed by @ninovanhooff Fixed a couple of missed double quotes, trailing and leading spaces, to long comment lines --- cura/API/Account.py | 2 +- cura/API/Backups.py | 2 +- cura/API/Interface/Settings.py | 2 +- cura/Arranging/Arrange.py | 12 ++++++------ cura/BuildVolume.py | 6 +++--- cura/CuraApplication.py | 7 +++---- cura/LayerDataBuilder.py | 4 ++-- cura/LayerPolygon.py | 18 +++++++++--------- cura/MachineAction.py | 2 +- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index a049b2924f..fb38c04300 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -27,7 +27,7 @@ class Account(QObject): api = CuraAPI() api.account.login() api.account.logout() - api.account.userProfile Who is logged in`` + api.account.userProfile # Who is logged in """ loginStateChanged = pyqtSignal(bool) diff --git a/cura/API/Backups.py b/cura/API/Backups.py index 621dec01f2..cb5f2aa487 100644 --- a/cura/API/Backups.py +++ b/cura/API/Backups.py @@ -20,7 +20,7 @@ class Backups: from cura.API import CuraAPI api = CuraAPI() api.backups.createBackup() - api.backups.restoreBackup(my_zip_file, {"cura_release": "3.1"})`` + api.backups.restoreBackup(my_zip_file, {"cura_release": "3.1"}) """ def __init__(self, application: "CuraApplication") -> None: diff --git a/cura/API/Interface/Settings.py b/cura/API/Interface/Settings.py index 947b37fc88..18653bc88e 100644 --- a/cura/API/Interface/Settings.py +++ b/cura/API/Interface/Settings.py @@ -26,7 +26,7 @@ class Settings: "actions": my_menu_actions, "menu_item": MyPluginAction(self) } - api.interface.settings.addContextMenuItem(data)`` + api.interface.settings.addContextMenuItem(data) """ def __init__(self, application: "CuraApplication") -> None: diff --git a/cura/Arranging/Arrange.py b/cura/Arranging/Arrange.py index e83bf8e372..75f7a58c5e 100644 --- a/cura/Arranging/Arrange.py +++ b/cura/Arranging/Arrange.py @@ -99,7 +99,7 @@ class Arrange: self._last_priority = 0 def findNodePlacement(self, node: SceneNode, offset_shape_arr: ShapeArray, hull_shape_arr: ShapeArray, step = 1) -> bool: - """ Find placement for a node (using offset shape) and place it (using hull shape) + """Find placement for a node (using offset shape) and place it (using hull shape) :param node: The node to be placed :param offset_shape_arr: shape array with offset, for placing the shape @@ -134,7 +134,7 @@ class Arrange: return found_spot def centerFirst(self): - """ Fill priority, center is best. Lower value is better. """ + """Fill priority, center is best. Lower value is better. """ # Square distance: creates a more round shape self._priority = numpy.fromfunction( @@ -143,7 +143,7 @@ class Arrange: self._priority_unique_values.sort() def backFirst(self): - """ Fill priority, back is best. Lower value is better """ + """Fill priority, back is best. Lower value is better """ self._priority = numpy.fromfunction( lambda j, i: 10 * j + abs(self._offset_x - i), self._shape, dtype=numpy.int32) @@ -151,7 +151,7 @@ class Arrange: self._priority_unique_values.sort() def checkShape(self, x, y, shape_arr) -> Optional[numpy.ndarray]: - """ Return the amount of "penalty points" for polygon, which is the sum of priority + """Return the amount of "penalty points" for polygon, which is the sum of priority :param x: x-coordinate to check shape :param y: y-coordinate to check shape @@ -183,7 +183,7 @@ class Arrange: return numpy.sum(prio_slice[numpy.where(shape_arr.arr == 1)]) def bestSpot(self, shape_arr, start_prio = 0, step = 1) -> LocationSuggestion: - """ Find "best" spot for ShapeArray + """Find "best" spot for ShapeArray :param shape_arr: shape array :param start_prio: Start with this priority value (and skip the ones before) @@ -213,7 +213,7 @@ class Arrange: return LocationSuggestion(x = None, y = None, penalty_points = None, priority = priority) # No suitable location found :-( def place(self, x, y, shape_arr, update_empty = True): - """ Place the object. + """Place the object. Marks the locations in self._occupied and self._priority diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 76316f5e43..cf0e18ad6a 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -885,7 +885,7 @@ class BuildVolume(SceneNode): It computes different disallowed areas depending on the offset of the extruder. The resulting dictionary will therefore have an entry for each extruder that is used. - + :param border_size: The size with which to offset the disallowed areas due to skirt, brim, travel avoid distance , etc. :param used_extruders: The extruder stacks to generate disallowed areas for. @@ -1117,8 +1117,8 @@ class BuildVolume(SceneNode): def getEdgeDisallowedSize(self): """Calculate the disallowed radius around the edge. - This disallowed radius is to allow for space around the models that is not part of the collision radius, such as - bed adhesion (skirt/brim/raft) and travel avoid distance. + This disallowed radius is to allow for space around the models that is not part of the collision radius, + such as bed adhesion (skirt/brim/raft) and travel avoid distance. """ if not self._global_container_stack or not self._global_container_stack.extruderList: diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index a588be3d5c..ee445cf0e3 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -440,8 +440,7 @@ class CuraApplication(QtApplication): def __setLatestResouceVersionsForVersionUpgrade(self): """Initializes the version upgrade manager with by providing the paths for each resource type and the latest - versions. - """ + versions. """ self._version_upgrade_manager.setCurrentVersions( { @@ -645,7 +644,7 @@ class CuraApplication(QtApplication): showMessageBox = pyqtSignal(str,str, str, str, int, int, arguments = ["title", "text", "informativeText", "detailedText","buttons", "icon"]) - """ A reusable dialogbox""" + """A reusable dialogbox""" def messageBox(self, title, text, informativeText = "", @@ -1873,7 +1872,7 @@ class CuraApplication(QtApplication): @pyqtSlot(str, result=bool) def checkIsValidProjectFile(self, file_url): - """ Checks if the given file URL is a valid project file. """ + """Checks if the given file URL is a valid project file. """ file_path = QUrl(file_url).toLocalFile() workspace_reader = self.getWorkspaceFileHandler().getReaderForFile(file_path) diff --git a/cura/LayerDataBuilder.py b/cura/LayerDataBuilder.py index 4650248780..e104273e37 100755 --- a/cura/LayerDataBuilder.py +++ b/cura/LayerDataBuilder.py @@ -46,8 +46,8 @@ class LayerDataBuilder(MeshBuilder): def build(self, material_color_map, line_type_brightness = 1.0): """Return the layer data as :py:class:`cura.LayerData.LayerData`. - :param material_color_map:: [r, g, b, a] for each extruder row. - :param line_type_brightness:: compatibility layer view uses line type brightness of 0.5 + :param material_color_map: [r, g, b, a] for each extruder row. + :param line_type_brightness: compatibility layer view uses line type brightness of 0.5 """ vertex_count = 0 diff --git a/cura/LayerPolygon.py b/cura/LayerPolygon.py index 38d4f756a4..2cfff612b9 100644 --- a/cura/LayerPolygon.py +++ b/cura/LayerPolygon.py @@ -91,15 +91,15 @@ class LayerPolygon: The arrays are either by vertex or by indices. - :param vertex_offset: : determines where to start and end filling the arrays - :param index_offset: : determines where to start and end filling the arrays - :param vertices: : vertex numpy array to be filled - :param colors: : vertex numpy array to be filled - :param line_dimensions: : vertex numpy array to be filled - :param feedrates: : vertex numpy array to be filled - :param extruders: : vertex numpy array to be filled - :param line_types: : vertex numpy array to be filled - :param indices: : index numpy array to be filled + :param vertex_offset: determines where to start and end filling the arrays + :param index_offset: determines where to start and end filling the arrays + :param vertices: vertex numpy array to be filled + :param colors: vertex numpy array to be filled + :param line_dimensions: vertex numpy array to be filled + :param feedrates: vertex numpy array to be filled + :param extruders: vertex numpy array to be filled + :param line_types: vertex numpy array to be filled + :param indices: index numpy array to be filled """ if self._build_cache_line_mesh_mask is None or self._build_cache_needed_points is None: diff --git a/cura/MachineAction.py b/cura/MachineAction.py index 4c2b4e7aea..e18c37ccb4 100644 --- a/cura/MachineAction.py +++ b/cura/MachineAction.py @@ -74,7 +74,7 @@ class MachineAction(QObject, PluginObject): def _reset(self) -> None: """Protected implementation of reset. - :py:meth:`cura.MachineAction.MachineAction.reset` + See also :py:meth:`cura.MachineAction.MachineAction.reset` """ pass