Skip to content

Commit 2d90883

Browse files
committed
string normalize everything now
1 parent dc5e02d commit 2d90883

File tree

123 files changed

+1366
-1366
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+1366
-1366
lines changed

src/compas_fab/__init__.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@
5757
from .__version__ import __version__
5858

5959
HERE = compas._os.realpath(os.path.dirname(__file__))
60-
HOME = os.path.abspath(os.path.join(HERE, '../..'))
61-
DATA = os.path.abspath(os.path.join(HERE, 'data'))
60+
HOME = os.path.abspath(os.path.join(HERE, "../.."))
61+
DATA = os.path.abspath(os.path.join(HERE, "data"))
6262

6363

6464
def _find_resource(filename):
65-
filename = filename.strip('/')
65+
filename = filename.strip("/")
6666
return os.path.abspath(os.path.join(DATA, filename))
6767

6868

@@ -73,40 +73,40 @@ def get(filename):
7373
# Check if COMPAS is installed from git
7474
# If that's the case, try to append the current head's hash to __version__
7575
try:
76-
git_head_file = os.path.abspath(os.path.join(HOME, '.git', 'HEAD'))
76+
git_head_file = os.path.abspath(os.path.join(HOME, ".git", "HEAD"))
7777

7878
if os.path.exists(git_head_file):
7979
# git head file contains one line that looks like this:
8080
# ref: refs/heads/main
81-
with open(git_head_file, 'r') as git_head:
82-
_, ref_path = git_head.read().strip().split(' ')
83-
ref_path = ref_path.split('/')
81+
with open(git_head_file, "r") as git_head:
82+
_, ref_path = git_head.read().strip().split(" ")
83+
ref_path = ref_path.split("/")
8484

85-
git_head_refs_file = os.path.abspath(os.path.join(HOME, '.git', *ref_path))
85+
git_head_refs_file = os.path.abspath(os.path.join(HOME, ".git", *ref_path))
8686

8787
if os.path.exists(git_head_refs_file):
88-
with open(git_head_refs_file, 'r') as git_head_ref:
88+
with open(git_head_refs_file, "r") as git_head_ref:
8989
git_commit = git_head_ref.read().strip()
90-
__version__ += '-' + git_commit[:8]
90+
__version__ += "-" + git_commit[:8]
9191
except Exception:
9292
pass
9393

9494

9595
__all_plugins__ = [
96-
'compas_fab.rhino.install',
97-
'compas_fab.rhino.artists',
98-
'compas_fab.ghpython.artists',
99-
'compas_fab.blender.artists',
96+
"compas_fab.rhino.install",
97+
"compas_fab.rhino.artists",
98+
"compas_fab.ghpython.artists",
99+
"compas_fab.blender.artists",
100100
]
101101

102102
__all__ = [
103-
'__author__',
104-
'__author_email__',
105-
'__copyright__',
106-
'__description__',
107-
'__license__',
108-
'__title__',
109-
'__url__',
110-
'__version__',
111-
'get',
103+
"__author__",
104+
"__author_email__",
105+
"__copyright__",
106+
"__description__",
107+
"__license__",
108+
"__title__",
109+
"__url__",
110+
"__version__",
111+
"get",
112112
]

src/compas_fab/__main__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
import compas_fab
88

9-
if __name__ == '__main__':
9+
if __name__ == "__main__":
1010
print()
11-
print('Yay! COMPAS FAB is installed correctly!')
11+
print("Yay! COMPAS FAB is installed correctly!")
1212
print()
13-
print('COMPAS FAB: {}'.format(compas_fab.__version__))
14-
print('COMPAS: {}'.format(compas.__version__))
15-
print('Python: {} ({})'.format(platform.python_version(), platform.python_implementation()))
13+
print("COMPAS FAB: {}".format(compas_fab.__version__))
14+
print("COMPAS: {}".format(compas.__version__))
15+
print("Python: {} ({})".format(platform.python_version(), platform.python_implementation()))

src/compas_fab/__version__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
__title__ = 'compas_fab'
2-
__description__ = 'Robotic fabrication package for the COMPAS Framework'
3-
__url__ = 'https://github.com/compas-dev/compas_fab'
4-
__version__ = '0.26.0'
5-
__author__ = 'Gramazio Kohler Research'
6-
__author_email__ = '[email protected]'
7-
__license__ = 'MIT license'
8-
__copyright__ = 'Copyright 2018 Gramazio Kohler Research'
1+
__title__ = "compas_fab"
2+
__description__ = "Robotic fabrication package for the COMPAS Framework"
3+
__url__ = "https://github.com/compas-dev/compas_fab"
4+
__version__ = "0.26.0"
5+
__author__ = "Gramazio Kohler Research"
6+
__author_email__ = "[email protected]"
7+
__license__ = "MIT license"
8+
__copyright__ = "Copyright 2018 Gramazio Kohler Research"

src/compas_fab/backends/__init__.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -177,43 +177,43 @@
177177

178178
__all__ = [
179179
# Base
180-
'BackendError',
181-
'KinematicsError',
182-
'InverseKinematicsError',
183-
'FutureResult',
184-
'CancellableFutureResult',
180+
"BackendError",
181+
"KinematicsError",
182+
"InverseKinematicsError",
183+
"FutureResult",
184+
"CancellableFutureResult",
185185
# ROS
186-
'RosClient',
187-
'RosError',
188-
'RosValidationError',
189-
'RosFileServerLoader',
190-
'MoveItPlanner',
186+
"RosClient",
187+
"RosError",
188+
"RosValidationError",
189+
"RosFileServerLoader",
190+
"MoveItPlanner",
191191
# VREP
192-
'VrepClient',
193-
'VrepError',
194-
'VrepPlanner',
192+
"VrepClient",
193+
"VrepError",
194+
"VrepPlanner",
195195
# Analytic IK
196-
'AnalyticalInverseKinematics',
197-
'AnalyticalPlanCartesianMotion',
198-
'OffsetWristKinematics',
199-
'SphericalWristKinematics',
200-
'CartesianMotionError',
196+
"AnalyticalInverseKinematics",
197+
"AnalyticalPlanCartesianMotion",
198+
"OffsetWristKinematics",
199+
"SphericalWristKinematics",
200+
"CartesianMotionError",
201201
# Robot-specific analytic IK
202-
'UR3Kinematics',
203-
'UR3eKinematics',
204-
'UR5Kinematics',
205-
'UR5eKinematics',
206-
'UR10Kinematics',
207-
'UR10eKinematics',
208-
'Staubli_TX260LKinematics',
209-
'ABB_IRB4600_40_255Kinematics',
202+
"UR3Kinematics",
203+
"UR3eKinematics",
204+
"UR5Kinematics",
205+
"UR5eKinematics",
206+
"UR10Kinematics",
207+
"UR10eKinematics",
208+
"Staubli_TX260LKinematics",
209+
"ABB_IRB4600_40_255Kinematics",
210210
]
211211

212212
if not compas.IPY:
213213
__all__ += [
214-
'PyBulletClient',
215-
'CollisionError',
216-
'PyBulletError',
217-
'PyBulletPlanner',
218-
'AnalyticalPyBulletClient',
214+
"PyBulletClient",
215+
"CollisionError",
216+
"PyBulletError",
217+
"PyBulletPlanner",
218+
"AnalyticalPyBulletClient",
219219
]

src/compas_fab/backends/exceptions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from __future__ import print_function
44

55
__all__ = [
6-
'BackendError',
7-
'KinematicsError',
8-
'InverseKinematicsError',
6+
"BackendError",
7+
"KinematicsError",
8+
"InverseKinematicsError",
99
]
1010

1111

src/compas_fab/backends/interfaces/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@
5858
from .client import PlannerInterface
5959

6060
__all__ = [
61-
'ForwardKinematics',
62-
'InverseKinematics',
63-
'PlanMotion',
64-
'PlanCartesianMotion',
65-
'GetPlanningScene',
66-
'AddCollisionMesh',
67-
'AppendCollisionMesh',
68-
'RemoveCollisionMesh',
69-
'AddAttachedCollisionMesh',
70-
'RemoveAttachedCollisionMesh',
71-
'ResetPlanningScene',
72-
'ClientInterface',
73-
'PlannerInterface',
61+
"ForwardKinematics",
62+
"InverseKinematics",
63+
"PlanMotion",
64+
"PlanCartesianMotion",
65+
"GetPlanningScene",
66+
"AddCollisionMesh",
67+
"AppendCollisionMesh",
68+
"RemoveCollisionMesh",
69+
"AddAttachedCollisionMesh",
70+
"RemoveAttachedCollisionMesh",
71+
"ResetPlanningScene",
72+
"ClientInterface",
73+
"PlannerInterface",
7474
]

src/compas_fab/backends/interfaces/client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def inverse_kinematics(self, *args, **kwargs):
120120
Exception
121121
Planner does not have this feature.
122122
"""
123-
raise Exception('Assigned planner does not have this feature.')
123+
raise Exception("Assigned planner does not have this feature.")
124124

125125
def forward_kinematics(self, *args, **kwargs):
126126
"""Default method for planner.
@@ -130,7 +130,7 @@ def forward_kinematics(self, *args, **kwargs):
130130
Exception
131131
Planner does not have this feature.
132132
"""
133-
raise Exception('Assigned planner does not have this feature.')
133+
raise Exception("Assigned planner does not have this feature.")
134134

135135
def plan_motion(self, *args, **kwargs):
136136
"""Default method for planner.
@@ -140,7 +140,7 @@ def plan_motion(self, *args, **kwargs):
140140
Exception
141141
Planner does not have this feature.
142142
"""
143-
raise Exception('Assigned planner does not have this feature.')
143+
raise Exception("Assigned planner does not have this feature.")
144144

145145
def plan_cartesian_motion(self, *args, **kwargs):
146146
"""Default method for planner.
@@ -150,7 +150,7 @@ def plan_cartesian_motion(self, *args, **kwargs):
150150
Exception
151151
Planner does not have this feature.
152152
"""
153-
raise Exception('Assigned planner does not have this feature.')
153+
raise Exception("Assigned planner does not have this feature.")
154154

155155
# ==========================================================================
156156
# collision objects and planning scene
@@ -164,7 +164,7 @@ def get_planning_scene(self, *args, **kwargs):
164164
Exception
165165
Planner does not have this feature.
166166
"""
167-
raise Exception('Assigned planner does not have this feature.')
167+
raise Exception("Assigned planner does not have this feature.")
168168

169169
def reset_planning_scene(self, *args, **kwargs):
170170
"""Default method for planner.
@@ -174,7 +174,7 @@ def reset_planning_scene(self, *args, **kwargs):
174174
Exception
175175
Planner does not have this feature.
176176
"""
177-
raise Exception('Assigned planner does not have this feature.')
177+
raise Exception("Assigned planner does not have this feature.")
178178

179179
def add_collision_mesh(self, *args, **kwargs):
180180
"""Default method for planner.
@@ -184,7 +184,7 @@ def add_collision_mesh(self, *args, **kwargs):
184184
Exception
185185
Planner does not have this feature.
186186
"""
187-
raise Exception('Assigned planner does not have this feature.')
187+
raise Exception("Assigned planner does not have this feature.")
188188

189189
def remove_collision_mesh(self, *args, **kwargs):
190190
"""Default method for planner.
@@ -194,7 +194,7 @@ def remove_collision_mesh(self, *args, **kwargs):
194194
Exception
195195
Planner does not have this feature.
196196
"""
197-
raise Exception('Assigned planner does not have this feature.')
197+
raise Exception("Assigned planner does not have this feature.")
198198

199199
def append_collision_mesh(self, *args, **kwargs):
200200
"""Default method for planner.
@@ -204,7 +204,7 @@ def append_collision_mesh(self, *args, **kwargs):
204204
Exception
205205
Planner does not have this feature.
206206
"""
207-
raise Exception('Assigned planner does not have this feature.')
207+
raise Exception("Assigned planner does not have this feature.")
208208

209209
def add_attached_collision_mesh(self, *args, **kwargs):
210210
"""Default method for planner.
@@ -214,7 +214,7 @@ def add_attached_collision_mesh(self, *args, **kwargs):
214214
Exception
215215
Planner does not have this feature.
216216
"""
217-
raise Exception('Assigned planner does not have this feature.')
217+
raise Exception("Assigned planner does not have this feature.")
218218

219219
def remove_attached_collision_mesh(self, *args, **kwargs):
220220
"""Default method for planner.
@@ -224,4 +224,4 @@ def remove_attached_collision_mesh(self, *args, **kwargs):
224224
Exception
225225
Planner does not have this feature.
226226
"""
227-
raise Exception('Assigned planner does not have this feature.')
227+
raise Exception("Assigned planner does not have this feature.")

src/compas_fab/backends/kinematics/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@
2020

2121
__all__ = [
2222
# exceptions
23-
'CartesianMotionError',
23+
"CartesianMotionError",
2424
# clients / backend features
25-
'AnalyticalInverseKinematics',
26-
'AnalyticalPlanCartesianMotion',
25+
"AnalyticalInverseKinematics",
26+
"AnalyticalPlanCartesianMotion",
2727
# solvers
28-
'OffsetWristKinematics',
29-
'SphericalWristKinematics',
30-
'UR3Kinematics',
31-
'UR3eKinematics',
32-
'UR5Kinematics',
33-
'UR5eKinematics',
34-
'UR10Kinematics',
35-
'UR10eKinematics',
36-
'Staubli_TX260LKinematics',
37-
'ABB_IRB4600_40_255Kinematics',
28+
"OffsetWristKinematics",
29+
"SphericalWristKinematics",
30+
"UR3Kinematics",
31+
"UR3eKinematics",
32+
"UR5Kinematics",
33+
"UR5eKinematics",
34+
"UR10Kinematics",
35+
"UR10eKinematics",
36+
"Staubli_TX260LKinematics",
37+
"ABB_IRB4600_40_255Kinematics",
3838
]

src/compas_fab/backends/kinematics/analytical_inverse_kinematics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def inverse_kinematics(self, robot, frame_WCF, start_configuration=None, group=N
7878
"""
7979

8080
options = options or {}
81-
solver = options.get('solver')
81+
solver = options.get("solver")
8282
if solver:
8383
self.planner = PLANNER_BACKENDS[solver]()
8484
elif not self.planner: # no solver, no planner
@@ -99,11 +99,11 @@ def inverse_kinematics(self, robot, frame_WCF, start_configuration=None, group=N
9999

100100
# check collisions for all configurations (>> sets those to `None` that are not working)
101101
if options.get("check_collision", False) is True:
102-
acms = options.get('attached_collision_meshes', [])
102+
acms = options.get("attached_collision_meshes", [])
103103
for acm in acms:
104104
cached_robot_model = self.client.get_cached_robot(robot)
105105
if not cached_robot_model.get_link_by_name(acm.collision_mesh.id):
106-
self.client.add_attached_collision_mesh(acm, options={'robot': robot})
106+
self.client.add_attached_collision_mesh(acm, options={"robot": robot})
107107
for touch_link in acm.touch_links:
108108
self.client.disabled_collisions.add((touch_link, acm.collision_mesh.id))
109109
for i, config in enumerate(configurations):

0 commit comments

Comments
 (0)