Skip to content

Commit d3e4666

Browse files
authored
Merge pull request #378 from compas-dev/blacken
blacken
2 parents 549e806 + 9f1ec9f commit d3e4666

File tree

144 files changed

+2568
-2167
lines changed

Some content is hidden

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

144 files changed

+2568
-2167
lines changed

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
[tool.black]
2-
line-length = 180
2+
line-length = 120
3+
extend-exclude = """
4+
(
5+
^/src/compas_fab/backends/vrep/remote_api/*
6+
)
7+
"""
38

49
[tool.pytest.ini_options]
510
minversion = "6.0"

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ exclude =
1212
dist,
1313
src/compas_fab/backends/vrep/remote_api/*,
1414
src/compas_fab/ghpython/path_planning.py
15+
extend-ignore =
16+
# See https://github.com/PyCQA/pycodestyle/issues/373
17+
E203,

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.27.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.27.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: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
SphericalWristKinematics,
154154
CartesianMotionError,
155155
)
156+
156157
# Robot-specific analytic IK
157158
from .kinematics import (
158159
UR3Kinematics,
@@ -176,43 +177,43 @@
176177

177178
__all__ = [
178179
# Base
179-
'BackendError',
180-
'KinematicsError',
181-
'InverseKinematicsError',
182-
'FutureResult',
183-
'CancellableFutureResult',
180+
"BackendError",
181+
"KinematicsError",
182+
"InverseKinematicsError",
183+
"FutureResult",
184+
"CancellableFutureResult",
184185
# ROS
185-
'RosClient',
186-
'RosError',
187-
'RosValidationError',
188-
'RosFileServerLoader',
189-
'MoveItPlanner',
186+
"RosClient",
187+
"RosError",
188+
"RosValidationError",
189+
"RosFileServerLoader",
190+
"MoveItPlanner",
190191
# VREP
191-
'VrepClient',
192-
'VrepError',
193-
'VrepPlanner',
192+
"VrepClient",
193+
"VrepError",
194+
"VrepPlanner",
194195
# Analytic IK
195-
'AnalyticalInverseKinematics',
196-
'AnalyticalPlanCartesianMotion',
197-
'OffsetWristKinematics',
198-
'SphericalWristKinematics',
199-
'CartesianMotionError',
196+
"AnalyticalInverseKinematics",
197+
"AnalyticalPlanCartesianMotion",
198+
"OffsetWristKinematics",
199+
"SphericalWristKinematics",
200+
"CartesianMotionError",
200201
# Robot-specific analytic IK
201-
'UR3Kinematics',
202-
'UR3eKinematics',
203-
'UR5Kinematics',
204-
'UR5eKinematics',
205-
'UR10Kinematics',
206-
'UR10eKinematics',
207-
'Staubli_TX260LKinematics',
208-
'ABB_IRB4600_40_255Kinematics',
202+
"UR3Kinematics",
203+
"UR3eKinematics",
204+
"UR5Kinematics",
205+
"UR5eKinematics",
206+
"UR10Kinematics",
207+
"UR10eKinematics",
208+
"Staubli_TX260LKinematics",
209+
"ABB_IRB4600_40_255Kinematics",
209210
]
210211

211212
if not compas.IPY:
212213
__all__ += [
213-
'PyBulletClient',
214-
'CollisionError',
215-
'PyBulletError',
216-
'PyBulletPlanner',
217-
'AnalyticalPyBulletClient',
214+
"PyBulletClient",
215+
"CollisionError",
216+
"PyBulletError",
217+
"PyBulletPlanner",
218+
"AnalyticalPyBulletClient",
218219
]

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: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ def forward_docstring(backend_feature):
77
def dec(obj):
88
obj.__doc__ = backend_feature.__dict__[obj.__name__].__doc__
99
return obj
10+
1011
return dec
1112

1213

1314
class ClientInterface(object):
1415
"""Interface for all backend clients. Forwards all planning services and
1516
planning scene management to the planner.
1617
"""
18+
1719
def __init__(self):
1820
self.planner = PlannerInterface(self)
1921
# self.control = ControlInterface()
@@ -70,6 +72,7 @@ def remove_attached_collision_mesh(self, *args, **kwargs):
7072
"""Forwards call to appropriate method in the planner."""
7173
return self.planner.remove_attached_collision_mesh(*args, **kwargs)
7274

75+
7376
# # ==========================================================================
7477
# # executing
7578
# # ==========================================================================
@@ -100,6 +103,7 @@ class PlannerInterface(object):
100103
behavior for all planning services and planning scene management methods. To be
101104
use in conjunction with backend feature interfaces.
102105
"""
106+
103107
def __init__(self, client):
104108
super(PlannerInterface, self).__init__()
105109
self.client = client
@@ -116,7 +120,7 @@ def inverse_kinematics(self, *args, **kwargs):
116120
Exception
117121
Planner does not have this feature.
118122
"""
119-
raise Exception('Assigned planner does not have this feature.')
123+
raise Exception("Assigned planner does not have this feature.")
120124

121125
def forward_kinematics(self, *args, **kwargs):
122126
"""Default method for planner.
@@ -126,7 +130,7 @@ def forward_kinematics(self, *args, **kwargs):
126130
Exception
127131
Planner does not have this feature.
128132
"""
129-
raise Exception('Assigned planner does not have this feature.')
133+
raise Exception("Assigned planner does not have this feature.")
130134

131135
def plan_motion(self, *args, **kwargs):
132136
"""Default method for planner.
@@ -136,7 +140,7 @@ def plan_motion(self, *args, **kwargs):
136140
Exception
137141
Planner does not have this feature.
138142
"""
139-
raise Exception('Assigned planner does not have this feature.')
143+
raise Exception("Assigned planner does not have this feature.")
140144

141145
def plan_cartesian_motion(self, *args, **kwargs):
142146
"""Default method for planner.
@@ -146,7 +150,7 @@ def plan_cartesian_motion(self, *args, **kwargs):
146150
Exception
147151
Planner does not have this feature.
148152
"""
149-
raise Exception('Assigned planner does not have this feature.')
153+
raise Exception("Assigned planner does not have this feature.")
150154

151155
# ==========================================================================
152156
# collision objects and planning scene
@@ -160,7 +164,7 @@ def get_planning_scene(self, *args, **kwargs):
160164
Exception
161165
Planner does not have this feature.
162166
"""
163-
raise Exception('Assigned planner does not have this feature.')
167+
raise Exception("Assigned planner does not have this feature.")
164168

165169
def reset_planning_scene(self, *args, **kwargs):
166170
"""Default method for planner.
@@ -170,7 +174,7 @@ def reset_planning_scene(self, *args, **kwargs):
170174
Exception
171175
Planner does not have this feature.
172176
"""
173-
raise Exception('Assigned planner does not have this feature.')
177+
raise Exception("Assigned planner does not have this feature.")
174178

175179
def add_collision_mesh(self, *args, **kwargs):
176180
"""Default method for planner.
@@ -180,7 +184,7 @@ def add_collision_mesh(self, *args, **kwargs):
180184
Exception
181185
Planner does not have this feature.
182186
"""
183-
raise Exception('Assigned planner does not have this feature.')
187+
raise Exception("Assigned planner does not have this feature.")
184188

185189
def remove_collision_mesh(self, *args, **kwargs):
186190
"""Default method for planner.
@@ -190,7 +194,7 @@ def remove_collision_mesh(self, *args, **kwargs):
190194
Exception
191195
Planner does not have this feature.
192196
"""
193-
raise Exception('Assigned planner does not have this feature.')
197+
raise Exception("Assigned planner does not have this feature.")
194198

195199
def append_collision_mesh(self, *args, **kwargs):
196200
"""Default method for planner.
@@ -200,7 +204,7 @@ def append_collision_mesh(self, *args, **kwargs):
200204
Exception
201205
Planner does not have this feature.
202206
"""
203-
raise Exception('Assigned planner does not have this feature.')
207+
raise Exception("Assigned planner does not have this feature.")
204208

205209
def add_attached_collision_mesh(self, *args, **kwargs):
206210
"""Default method for planner.
@@ -210,7 +214,7 @@ def add_attached_collision_mesh(self, *args, **kwargs):
210214
Exception
211215
Planner does not have this feature.
212216
"""
213-
raise Exception('Assigned planner does not have this feature.')
217+
raise Exception("Assigned planner does not have this feature.")
214218

215219
def remove_attached_collision_mesh(self, *args, **kwargs):
216220
"""Default method for planner.
@@ -220,4 +224,4 @@ def remove_attached_collision_mesh(self, *args, **kwargs):
220224
Exception
221225
Planner does not have this feature.
222226
"""
223-
raise Exception('Assigned planner does not have this feature.')
227+
raise Exception("Assigned planner does not have this feature.")

0 commit comments

Comments
 (0)