Skip to content

Commit b8b07db

Browse files
authored
Merge pull request #26 from UM-ARM-Lab/faster2
Trying to speed up FK
2 parents 4d06979 + f98e6fc commit b8b07db

30 files changed

+1509
-238
lines changed

.clang-format

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
7+
AlignConsecutiveAssignments: false
8+
AlignConsecutiveDeclarations: false
9+
AlignEscapedNewlines: Left
10+
AlignOperands: true
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: Never
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: All
18+
AllowShortLambdasOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: WithoutElse
20+
AllowShortLoopsOnASingleLine: true
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: true
24+
AlwaysBreakTemplateDeclarations: Yes
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterCaseLabel: false
29+
AfterClass: false
30+
AfterControlStatement: false
31+
AfterEnum: false
32+
AfterFunction: false
33+
AfterNamespace: false
34+
AfterObjCDeclaration: false
35+
AfterStruct: false
36+
AfterUnion: false
37+
AfterExternBlock: false
38+
BeforeCatch: false
39+
BeforeElse: false
40+
IndentBraces: false
41+
SplitEmptyFunction: true
42+
SplitEmptyRecord: true
43+
SplitEmptyNamespace: true
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeBraces: Attach
46+
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
48+
BreakBeforeTernaryOperators: true
49+
BreakConstructorInitializersBeforeComma: false
50+
BreakConstructorInitializers: BeforeColon
51+
BreakAfterJavaFieldAnnotations: false
52+
BreakStringLiterals: true
53+
ColumnLimit: 120
54+
CommentPragmas: '^ IWYU pragma:'
55+
CompactNamespaces: false
56+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
57+
ConstructorInitializerIndentWidth: 4
58+
ContinuationIndentWidth: 4
59+
Cpp11BracedListStyle: true
60+
DeriveLineEnding: true
61+
DerivePointerAlignment: true
62+
DisableFormat: false
63+
ExperimentalAutoDetectBinPacking: false
64+
FixNamespaceComments: true
65+
ForEachMacros:
66+
- foreach
67+
- Q_FOREACH
68+
- BOOST_FOREACH
69+
IncludeBlocks: Regroup
70+
IncludeCategories:
71+
- Regex: '^<ext/.*\.h>'
72+
Priority: 2
73+
SortPriority: 0
74+
- Regex: '^<.*\.h>'
75+
Priority: 1
76+
SortPriority: 0
77+
- Regex: '^<.*'
78+
Priority: 2
79+
SortPriority: 0
80+
- Regex: '.*'
81+
Priority: 3
82+
SortPriority: 0
83+
IncludeIsMainRegex: '([-_](test|unittest))?$'
84+
IncludeIsMainSourceRegex: ''
85+
IndentCaseLabels: true
86+
IndentGotoLabels: true
87+
IndentPPDirectives: None
88+
IndentWidth: 2
89+
IndentWrappedFunctionNames: false
90+
JavaScriptQuotes: Leave
91+
JavaScriptWrapImports: true
92+
KeepEmptyLinesAtTheStartOfBlocks: false
93+
MacroBlockBegin: ''
94+
MacroBlockEnd: ''
95+
MaxEmptyLinesToKeep: 1
96+
NamespaceIndentation: None
97+
ObjCBinPackProtocolList: Never
98+
ObjCBlockIndentWidth: 2
99+
ObjCSpaceAfterProperty: false
100+
ObjCSpaceBeforeProtocolList: true
101+
PenaltyBreakAssignment: 2
102+
PenaltyBreakBeforeFirstCallParameter: 1
103+
PenaltyBreakComment: 300
104+
PenaltyBreakFirstLessLess: 120
105+
PenaltyBreakString: 1000
106+
PenaltyBreakTemplateDeclaration: 10
107+
PenaltyExcessCharacter: 1000000
108+
PenaltyReturnTypeOnItsOwnLine: 200
109+
PointerAlignment: Left
110+
RawStringFormats:
111+
- Language: Cpp
112+
Delimiters:
113+
- cc
114+
- CC
115+
- cpp
116+
- Cpp
117+
- CPP
118+
- 'c++'
119+
- 'C++'
120+
CanonicalDelimiter: ''
121+
BasedOnStyle: google
122+
- Language: TextProto
123+
Delimiters:
124+
- pb
125+
- PB
126+
- proto
127+
- PROTO
128+
EnclosingFunctions:
129+
- EqualsProto
130+
- EquivToProto
131+
- PARSE_PARTIAL_TEXT_PROTO
132+
- PARSE_TEST_PROTO
133+
- PARSE_TEXT_PROTO
134+
- ParseTextOrDie
135+
- ParseTextProtoOrDie
136+
CanonicalDelimiter: ''
137+
BasedOnStyle: google
138+
ReflowComments: true
139+
SortIncludes: true
140+
SortUsingDeclarations: true
141+
SpaceAfterCStyleCast: false
142+
SpaceAfterLogicalNot: false
143+
SpaceAfterTemplateKeyword: true
144+
SpaceBeforeAssignmentOperators: true
145+
SpaceBeforeCpp11BracedList: false
146+
SpaceBeforeCtorInitializerColon: true
147+
SpaceBeforeInheritanceColon: true
148+
SpaceBeforeParens: ControlStatements
149+
SpaceBeforeRangeBasedForLoopColon: true
150+
SpaceInEmptyBlock: false
151+
SpaceInEmptyParentheses: false
152+
SpacesBeforeTrailingComments: 2
153+
SpacesInAngles: false
154+
SpacesInConditionalStatement: false
155+
SpacesInContainerLiterals: true
156+
SpacesInCStyleCastParentheses: false
157+
SpacesInParentheses: false
158+
SpacesInSquareBrackets: false
159+
SpaceBeforeSquareBrackets: false
160+
Standard: Auto
161+
StatementMacros:
162+
- Q_UNUSED
163+
- QT_REQUIRE_VERSION
164+
TabWidth: 8
165+
UseCRLF: false
166+
UseTab: Never
167+
...
168+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.idea
2+
*.so
3+
*.pkl
24
*.egg-info
35
__pycache__
46
temp*
@@ -7,4 +9,4 @@ dist
79
# These are cloned/generated when testing with mujoco
810
tests/MUJOCO_LOG.TXT
911
tests/mujoco_menagerie/
10-
12+
.ipynb_checkpoints

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
# Installation
77
```shell
88
pip install pytorch-kinematics
9-
# Alternatively, if you want to load from mujoco's XML format, use:
10-
pip install pytorch-kinematics[mujoco]
119
```
1210

1311
For development, clone repository somewhere, then `pip3 install -e .` to install in editable mode.
@@ -22,7 +20,7 @@ See `tests` for code samples; some are also shown here.
2220
If you use this package in your research, consider citing
2321
```
2422
@software{Zhong_PyTorch_Kinematics_2023,
25-
author = {Zhong, Sheng and Power, Thomas and Gupta, Ashwin},
23+
author = {Zhong, Sheng and Power, Thomas and Gupta, Ashwin and Peter, Mitrano},
2624
doi = {10.5281/zenodo.7700588},
2725
month = {3},
2826
title = {{PyTorch Kinematics}},

pyproject.toml

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,59 +30,28 @@ maintainers = [
3030
]
3131

3232
# Classifiers help users find your project by categorizing it.
33-
#
3433
# For a list of valid classifiers, see https://pypi.org/classifiers/
3534
classifiers = [# Optional
3635
"Development Status :: 4 - Beta",
37-
# Indicate who your project is intended for
3836
"Intended Audience :: Developers",
39-
# Pick your license as you wish
4037
"License :: OSI Approved :: MIT License",
41-
# Specify the Python versions you support here. In particular, ensure
42-
# that you indicate you support Python 3. These classifiers are *not*
43-
# checked by "pip install". See instead "python_requires" below.
4438
"Programming Language :: Python :: 3",
4539
"Programming Language :: Python :: 3 :: Only",
4640
]
4741

48-
# This field lists other packages that your project depends on to run.
49-
# Any package you put here will be installed by pip when your project is
50-
# installed, so they must be valid existing projects.
51-
#
52-
# For an analysis of this field vs pip's requirements files see:
53-
# https://packaging.python.org/discussions/install-requires-vs-requirements/
54-
dependencies = [# Optional
55-
'torch',
56-
'numpy',
57-
'transformations',
42+
dependencies = [
5843
'absl-py',
5944
'lxml',
60-
'pyyaml'
45+
"mujoco",
46+
'numpy',
47+
'pyyaml',
48+
'torch',
6149
]
6250

63-
# List additional groups of dependencies here (e.g. development
64-
# dependencies). Users will be able to install these using the "extras"
65-
# syntax, for example:
66-
#
67-
# $ pip install sampleproject[dev]
68-
#
69-
# Similar to `dependencies` above, these must be valid existing
70-
# projects.
71-
[project.optional-dependencies] # Optional
72-
test = ["pytest", "mujoco"]
73-
mujoco = ["mujoco"]
51+
[project.optional-dependencies]
52+
test = ["pytest"]
7453

75-
# List URLs that are relevant to your project
76-
#
77-
# This field corresponds to the "Project-URL" and "Home-Page" metadata fields:
78-
# https://packaging.python.org/specifications/core-metadata/#project-url-multiple-use
79-
# https://packaging.python.org/specifications/core-metadata/#home-page-optional
80-
#
81-
# Examples listed include a pattern for specifying where the package tracks
82-
# issues, where the source is hosted, where to say thanks to the package
83-
# maintainers, and where to support the project financially. The key is
84-
# what's used to render the link text on PyPI.
85-
[project.urls] # Optional
54+
[project.urls]
8655
"Homepage" = "https://github.com/UM-ARM-Lab/pytorch_kinematics"
8756
"Bug Reports" = "https://github.com/UM-ARM-Lab/pytorch_kinematics/issues"
8857
"Source" = "https://github.com/UM-ARM-Lab/pytorch_kinematics"
@@ -99,7 +68,7 @@ mujoco = ["mujoco"]
9968
# installed, specify them here.
10069

10170
[build-system]
102-
# These are the assumed default build requirements from pip:
103-
# https://pip.pypa.io/en/stable/reference/pip/#pep-517-and-518-support
104-
requires = ["setuptools>=43.0.0", "wheel"]
105-
build-backend = "setuptools.build_meta"
71+
# Including torch and ninja here are needed to build the native code.
72+
# They will be installed as dependencies during the build, which can take a while the first time.
73+
requires = ["setuptools>=60.0.0", "wheel"]
74+
build-backend= "setuptools.build_meta"

0 commit comments

Comments
 (0)