Skip to content

Commit

Permalink
more linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalocasas committed Jun 23, 2024
1 parent 74806b1 commit 206cb9e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def RunScript(self, options, reset, on):
return None

self.worker = BackgroundWorker.instance_by_component(
ghenv, start_server, dispose_function=stop_server, force_new=reset, auto_set_done=False, args=(options,)
) # noqa: F821
ghenv, start_server, dispose_function=stop_server, force_new=reset, auto_set_done=False, args=(options,) # noqa: F821
)

if not self.worker.is_working() and not self.worker.is_done() and reset:
self.worker.start_work()
Expand Down
11 changes: 5 additions & 6 deletions src/compas_xr/ghpython/components/Cx_GetTrajectoryResult/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
COMPAS XR v0.1.0
"""


from compas_eve import Publisher
from compas_eve import Topic
from compas_eve.mqtt import MqttTransport
Expand All @@ -16,25 +15,25 @@


class PlanningServiceResponseComponent(component):

def RunScript(self, options, result, publish):
if not result:
self.Message = "Null Result, unable to publish"
return

if publish:
topic_name_result = 'compas_xr/get_trajectory_result/' + options.project_name
topic_name_result = "compas_xr/get_trajectory_result/" + options.project_name
topic = Topic(topic_name_result, GetTrajectoryResult)
tx = MqttTransport(options.host)
publisher = Publisher(topic, transport=tx)
message = GetTrajectoryResult(
element_id=result.requested_element_id,
robot_name=options.robot_name,
robot_base_frame=result.robot_base_frame,
robot_base_frame=result.robot_base_frame,
trajectory=result.trajectory,
pick_and_place=result.pick_and_place,
pick_index=result.pick_index,
end_effector_link_name = result.end_effector_link_name
)
end_effector_link_name=result.end_effector_link_name,
)
publisher.publish(message)
self.Message = "Send trajectory for #{}".format(result.requested_element_id)
6 changes: 4 additions & 2 deletions src/compas_xr/ghpython/components/Cx_SendTrajectory/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
COMPAS XR v0.1.0
"""

import threading

import scriptcontext as sc
from compas_eve import Subscriber
from compas_eve import Topic
Expand Down Expand Up @@ -46,8 +48,8 @@ def RunScript(self, options, reset, on):
return None

self.worker = BackgroundWorker.instance_by_component(
ghenv, start_server, dispose_function=stop_server, force_new=reset, auto_set_done=False, args=(options,)
) # noqa: F821
ghenv, start_server, dispose_function=stop_server, force_new=reset, auto_set_done=False, args=(options,) # noqa: F821
)

if not self.worker.is_working() and not self.worker.is_done() and reset:
self.worker.start_work()
Expand Down
6 changes: 3 additions & 3 deletions src/compas_xr/project/buildingplan_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def create_buildingplan_from_assembly_sequence(self, assembly, data_type, robot_
break

return building_plan

def create_buildingplan_from_with_custom_sequence(self, assembly, sequenced_keys, data_type, robot_keys, priority_keys_lists):
"""
Create a compas_timber.planning.BuildingPlan based on the sequence of the assembly parts.
Expand All @@ -83,13 +83,13 @@ def create_buildingplan_from_with_custom_sequence(self, assembly, sequenced_keys
"""
data_type_list = ["0.Cylinder", "1.Box", "2.ObjFile"]
graph_data = assembly.graph.__data__
node_data = graph_data['node']
node_data = graph_data["node"]
building_plan = BuildingPlan()

for key in sequenced_keys:
step = Step(key)
# TODO: This is dumb, but the element_ids are generated incorrectly so they are overwritten here
step.element_ids = [key]
step.element_ids = [key]
step.geometry = data_type_list[data_type]
# TODO: These are unused for now, but are expeted on the application side
step.instructions = ["none"]
Expand Down
2 changes: 0 additions & 2 deletions src/compas_xr/project/project_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ def visualize_project_state_timbers(self, timber_assembly, project_name):
if "PriorityTreeDictionary" in current_state_data:
current_state_data.pop("PriorityTreeDictionary")


if "PriorityTreeDictionary" in current_state_data:
current_state_data.pop("PriorityTreeDictionary")

Expand Down Expand Up @@ -401,7 +400,6 @@ def visualize_project_state(self, assembly, project_name):
if "PriorityTreeDictionary" in current_state_data:
current_state_data.pop("PriorityTreeDictionary")


if "PriorityTreeDictionary" in current_state_data:
current_state_data.pop("PriorityTreeDictionary")

Expand Down

0 comments on commit 206cb9e

Please sign in to comment.