Skip to content

Commit 0dbe030

Browse files
committed
[tf2_kdl] pep8 formatting
1 parent 9189789 commit 0dbe030

File tree

4 files changed

+95
-66
lines changed

4 files changed

+95
-66
lines changed

tf2_kdl/docs/source/conf.py

Lines changed: 48 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,27 @@
33
# tf2 documentation build configuration file, created by
44
# sphinx-quickstart on Mon Jun 1 14:21:53 2009.
55
#
6-
# This file is execfile()d with the current directory set to its containing dir.
6+
# This file is execfile()d with the current directory set to its
7+
# containing dir.
78
#
89
# Note that not all possible configuration values are present in this
910
# autogenerated file.
1011
#
1112
# All configuration values have a default; values that are commented out
1213
# serve to show the default.
1314

14-
import sys, os
15-
1615
# If extensions (or modules to document with autodoc) are in another directory,
1716
# add these directories to sys.path here. If the directory is relative to the
1817
# documentation root, use os.path.abspath to make it absolute, like shown here.
1918
# sys.path.append(os.path.abspath('./src/tf2_kdl'))
2019

21-
# -- General configuration -----------------------------------------------------
20+
# -- General configuration ----------------------------------------------------
2221

23-
# Add any Sphinx extension module names here, as strings. They can be extensions
22+
# Add any Sphinx extension module names here, as strings.
23+
# They can be extensions
2424
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
25-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.imgmath']
25+
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
26+
'sphinx.ext.intersphinx', 'sphinx.ext.imgmath']
2627

2728
# Add any paths that contain templates here, relative to this directory.
2829
templates_path = ['_templates']
@@ -31,7 +32,7 @@
3132
source_suffix = '.rst'
3233

3334
# The encoding of source files.
34-
#source_encoding = 'utf-8'
35+
# source_encoding = 'utf-8'
3536

3637
# The master toctree document.
3738
master_doc = 'index'
@@ -51,45 +52,46 @@
5152

5253
# The language for content autogenerated by Sphinx. Refer to documentation
5354
# for a list of supported languages.
54-
#language = None
55+
# language = None
5556

5657
# There are two options for replacing |today|: either, you set today to some
5758
# non-false value, then it is used:
58-
#today = ''
59+
# today = ''
5960
# Else, today_fmt is used as the format for a strftime call.
60-
#today_fmt = '%B %d, %Y'
61+
# today_fmt = '%B %d, %Y'
6162

6263
# List of documents that shouldn't be included in the build.
63-
#unused_docs = []
64+
# unused_docs = []
6465

6566
# List of directories, relative to source directory, that shouldn't be searched
6667
# for source files.
6768
exclude_trees = ['_build']
6869

6970
exclude_patterns = ['_CHANGELOG.rst']
7071

71-
# The reST default role (used for this markup: `text`) to use for all documents.
72-
#default_role = None
72+
# The reST default role (used for this markup: `text`) to use
73+
# for all documents.
74+
# default_role = None
7375

7476
# If true, '()' will be appended to :func: etc. cross-reference text.
75-
#add_function_parentheses = True
77+
# add_function_parentheses = True
7678

7779
# If true, the current module name will be prepended to all description
7880
# unit titles (such as .. function::).
79-
#add_module_names = True
81+
# add_module_names = True
8082

8183
# If true, sectionauthor and moduleauthor directives will be shown in the
8284
# output. They are ignored by default.
83-
#show_authors = False
85+
# show_authors = False
8486

8587
# The name of the Pygments (syntax highlighting) style to use.
8688
pygments_style = 'sphinx'
8789

8890
# A list of ignored prefixes for module index sorting.
89-
#modindex_common_prefix = []
91+
# modindex_common_prefix = []
9092

9193

92-
# -- Options for HTML output ---------------------------------------------------
94+
# -- Options for HTML output ------------------------------------------------
9395

9496
# The theme to use for HTML and HTML Help pages. Major themes that come with
9597
# Sphinx are currently 'default' and 'sphinxdoc'.
@@ -98,107 +100,108 @@
98100
# Theme options are theme-specific and customize the look and feel of a theme
99101
# further. For a list of options available for each theme, see the
100102
# documentation.
101-
#html_theme_options = {}
103+
# html_theme_options = {}
102104

103105
# Add any paths that contain custom themes here, relative to this directory.
104-
#html_theme_path = []
106+
# html_theme_path = []
105107

106108
# The name for this set of Sphinx documents. If None, it defaults to
107109
# "<project> v<release> documentation".
108-
#html_title = None
110+
# html_title = None
109111

110112
# A shorter title for the navigation bar. Default is the same as html_title.
111-
#html_short_title = None
113+
# html_short_title = None
112114

113115
# The name of an image file (relative to this directory) to place at the top
114116
# of the sidebar.
115-
#html_logo = None
117+
# html_logo = None
116118

117119
# The name of an image file (within the static path) to use as favicon of the
118120
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
119121
# pixels large.
120-
#html_favicon = None
122+
# html_favicon = None
121123

122124
# Add any paths that contain custom static files (such as style sheets) here,
123125
# relative to this directory. They are copied after the builtin static files,
124126
# so a file named "default.css" will overwrite the builtin "default.css".
125-
#html_static_path = ['_static']
127+
# html_static_path = ['_static']
126128

127129
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
128130
# using the given strftime format.
129-
#html_last_updated_fmt = '%b %d, %Y'
131+
# html_last_updated_fmt = '%b %d, %Y'
130132

131133
# If true, SmartyPants will be used to convert quotes and dashes to
132134
# typographically correct entities.
133-
#html_use_smartypants = True
135+
# html_use_smartypants = True
134136

135137
# Custom sidebar templates, maps document names to template names.
136-
#html_sidebars = {}
138+
# html_sidebars = {}
137139

138140
# Additional templates that should be rendered to pages, maps page names to
139141
# template names.
140-
#html_additional_pages = {}
142+
# html_additional_pages = {}
141143

142144
# If false, no module index is generated.
143-
#html_use_modindex = True
145+
# html_use_modindex = True
144146

145147
# If false, no index is generated.
146-
#html_use_index = True
148+
# html_use_index = True
147149

148150
# If true, the index is split into individual pages for each letter.
149-
#html_split_index = False
151+
# html_split_index = False
150152

151153
# If true, links to the reST sources are added to the pages.
152-
#html_show_sourcelink = True
154+
# html_show_sourcelink = True
153155

154156
# If true, an OpenSearch description file will be output, and all pages will
155157
# contain a <link> tag referring to it. The value of this option must be the
156158
# base URL from which the finished HTML is served.
157-
#html_use_opensearch = ''
159+
# html_use_opensearch = ''
158160

159161
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
160-
#html_file_suffix = ''
162+
# html_file_suffix = ''
161163

162164
# Output file base name for HTML help builder.
163165
htmlhelp_basename = 'tfdoc'
164166

165167

166-
# -- Options for LaTeX output --------------------------------------------------
168+
# -- Options for LaTeX output -------------------------------------------------
167169

168170
# The paper size ('letter' or 'a4').
169-
#latex_paper_size = 'letter'
171+
# latex_paper_size = 'letter'
170172

171173
# The font size ('10pt', '11pt' or '12pt').
172-
#latex_font_size = '10pt'
174+
# latex_font_size = '10pt'
173175

174176
# Grouping the document tree into LaTeX files. List of tuples
175-
# (source start file, target name, title, author, documentclass [howto/manual]).
177+
# (source start file, target name, title, author,
178+
# documentclass [howto/manual]).
176179
latex_documents = [
177180
('index', 'tf.tex', u'stereo\\_utils Documentation',
178181
u'Tully Foote and Eitan Marder-Eppstein', 'manual'),
179182
]
180183

181184
# The name of an image file (relative to this directory) to place at the top of
182185
# the title page.
183-
#latex_logo = None
186+
# latex_logo = None
184187

185188
# For "manual" documents, if this is true, then toplevel headings are parts,
186189
# not chapters.
187-
#latex_use_parts = False
190+
# latex_use_parts = False
188191

189192
# Additional stuff for the LaTeX preamble.
190-
#latex_preamble = ''
193+
# latex_preamble = ''
191194

192195
# Documents to append as an appendix to all manuals.
193-
#latex_appendices = []
196+
# latex_appendices = []
194197

195198
# If false, no module index is generated.
196-
#latex_use_modindex = True
199+
# latex_use_modindex = True
197200

198201

199202
# Example configuration for intersphinx: refer to the Python standard library.
200203
intersphinx_mapping = {
201204
'http://docs.python.org/': None,
202205
'http://docs.opencv.org/3.0-last-rst/': None,
203-
'http://docs.scipy.org/doc/numpy' : None
206+
'http://docs.scipy.org/doc/numpy': None
204207
}

tf2_kdl/scripts/test.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import rclpy
55
import PyKDL
66
import tf2_ros
7-
import tf2_kdl
7+
import tf2_kdl # noqa(F401)
88
from geometry_msgs.msg import TransformStamped, Quaternion
9-
from copy import deepcopy
109
import builtin_interfaces
1110

11+
1212
class KDLConversions(unittest.TestCase):
1313
def test_transform(self):
1414
b = tf2_ros.Buffer()
@@ -19,36 +19,42 @@ def test_transform(self):
1919
t.header.frame_id = 'a'
2020
t.child_frame_id = 'b'
2121
b.set_transform(t, 'eitan_rocks')
22-
out = b.lookup_transform('a','b', rclpy.time.Time(seconds=2), rclpy.time.Duration(seconds=2))
22+
out = b.lookup_transform('a', 'b',
23+
rclpy.time.Time(seconds=2),
24+
rclpy.time.Duration(seconds=2))
2325
self.assertEqual(out.transform.translation.x, 1)
2426
self.assertEqual(out.transform.rotation.x, 1)
2527
self.assertEqual(out.header.frame_id, 'a')
2628
self.assertEqual(out.child_frame_id, 'b')
2729

28-
v = PyKDL.Vector(1,2,3)
29-
out = b.transform(tf2_ros.Stamped(v, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
30+
v = PyKDL.Vector(1, 2, 3)
31+
out = b.transform(
32+
tf2_ros.Stamped(v, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
3033
self.assertEqual(out.x(), 0)
3134
self.assertEqual(out.y(), -2)
3235
self.assertEqual(out.z(), -3)
3336

34-
f = PyKDL.Frame(PyKDL.Rotation.RPY(1,2,3), PyKDL.Vector(1,2,3))
35-
out = b.transform(tf2_ros.Stamped(f, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
37+
f = PyKDL.Frame(PyKDL.Rotation.RPY(1, 2, 3), PyKDL.Vector(1, 2, 3))
38+
out = b.transform(
39+
tf2_ros.Stamped(f, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
3640
self.assertEqual(out.p.x(), 0)
3741
self.assertEqual(out.p.y(), -2)
3842
self.assertEqual(out.p.z(), -3)
3943
# TODO(tfoote) check values of rotation
4044

41-
t = PyKDL.Twist(PyKDL.Vector(1,2,3), PyKDL.Vector(4,5,6))
42-
out = b.transform(tf2_ros.Stamped(t, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
45+
t = PyKDL.Twist(PyKDL.Vector(1, 2, 3), PyKDL.Vector(4, 5, 6))
46+
out = b.transform(
47+
tf2_ros.Stamped(t, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
4348
self.assertEqual(out.vel.x(), 1)
4449
self.assertEqual(out.vel.y(), -8)
4550
self.assertEqual(out.vel.z(), 2)
4651
self.assertEqual(out.rot.x(), 4)
4752
self.assertEqual(out.rot.y(), -5)
4853
self.assertEqual(out.rot.z(), -6)
4954

50-
w = PyKDL.Wrench(PyKDL.Vector(1,2,3), PyKDL.Vector(4,5,6))
51-
out = b.transform(tf2_ros.Stamped(w, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
55+
w = PyKDL.Wrench(PyKDL.Vector(1, 2, 3), PyKDL.Vector(4, 5, 6))
56+
out = b.transform(
57+
tf2_ros.Stamped(w, builtin_interfaces.msg.Time(sec=2), 'a'), 'b')
5258
self.assertEqual(out.force.x(), 1)
5359
self.assertEqual(out.force.y(), -2)
5460
self.assertEqual(out.force.z(), -3)
@@ -57,7 +63,7 @@ def test_transform(self):
5763
self.assertEqual(out.torque.z(), -4)
5864

5965
def test_convert(self):
60-
v = PyKDL.Vector(1,2,3)
66+
v = PyKDL.Vector(1, 2, 3)
6167
vs = tf2_ros.Stamped(v, builtin_interfaces.msg.Time(sec=2), 'a')
6268
vs2 = tf2_ros.convert(vs, PyKDL.Vector)
6369
self.assertEqual(vs.x(), 1)

tf2_kdl/src/tf2_kdl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from .tf2_kdl import *
1+
from .tf2_kdl import * # noqa

0 commit comments

Comments
 (0)