Skip to content

Commit f201f34

Browse files
committed
Initial commit (version 0.1).
0 parents  commit f201f34

File tree

179 files changed

+10190
-0
lines changed

Some content is hidden

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

179 files changed

+10190
-0
lines changed

.clang-format

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# from https://github.com/facebookresearch/pytorch3d/blob/master/.clang-format
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
41+
ConstructorInitializerIndentWidth: 4
42+
ContinuationIndentWidth: 4
43+
Cpp11BracedListStyle: true
44+
DerivePointerAlignment: false
45+
DisableFormat: false
46+
ForEachMacros: [ FOR_EACH, FOR_EACH_R, FOR_EACH_RANGE, ]
47+
IncludeCategories:
48+
- Regex: '^<.*\.h(pp)?>'
49+
Priority: 1
50+
- Regex: '^<.*'
51+
Priority: 2
52+
- Regex: '.*'
53+
Priority: 3
54+
IndentCaseLabels: true
55+
IndentWidth: 2
56+
IndentWrappedFunctionNames: false
57+
KeepEmptyLinesAtTheStartOfBlocks: false
58+
MacroBlockBegin: ''
59+
MacroBlockEnd: ''
60+
MaxEmptyLinesToKeep: 1
61+
NamespaceIndentation: None
62+
ObjCBlockIndentWidth: 2
63+
ObjCSpaceAfterProperty: false
64+
ObjCSpaceBeforeProtocolList: false
65+
PenaltyBreakBeforeFirstCallParameter: 1
66+
PenaltyBreakComment: 300
67+
PenaltyBreakFirstLessLess: 120
68+
PenaltyBreakString: 1000
69+
PenaltyExcessCharacter: 1000000
70+
PenaltyReturnTypeOnItsOwnLine: 200
71+
PointerAlignment: Left
72+
ReflowComments: true
73+
SortIncludes: true
74+
SpaceAfterCStyleCast: false
75+
SpaceBeforeAssignmentOperators: true
76+
SpaceBeforeParens: ControlStatements
77+
SpaceInEmptyParentheses: false
78+
SpacesBeforeTrailingComments: 1
79+
SpacesInAngles: false
80+
SpacesInContainerLiterals: true
81+
SpacesInCStyleCastParentheses: false
82+
SpacesInParentheses: false
83+
SpacesInSquareBrackets: false
84+
Standard: Cpp11
85+
TabWidth: 8
86+
UseTab: Never

.flake8

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# from https://github.com/facebookresearch/pytorch3d/blob/master/.flake8
2+
3+
[flake8]
4+
ignore = E203, E266, E501, W503, E221
5+
max-line-length = 88
6+
max-complexity = 18
7+
select = B,C,E,F,W,T4,B9
8+
exclude = build,__init__.py

.github/ISSUE_TEMPLATE/bug-report.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[bug] "
5+
labels: bug, normal priority, size-XS
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment information**
27+
Add information about the environment that can be used to reproduce this bug (i.e., Docker image, commit number etc.).
28+
29+
**Additional context**
30+
Add any other context about the problem here.
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[feature] "
5+
labels: enhancement, normal priority, size-XS
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the requested feature**
11+
A clear and concise description of the requested feature.
12+
13+
**Tasks to be completed**
14+
- [ ] TODO
15+
16+
**Definition of Done**
17+
A clear and concise description of the conditions for marking the issue as completed.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.gitignore

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
# Usually these files are written by a python script from a template
32+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33+
*.manifest
34+
*.spec
35+
36+
# Installer logs
37+
pip-log.txt
38+
pip-delete-this-directory.txt
39+
40+
# Unit test / coverage reports
41+
htmlcov/
42+
.tox/
43+
.nox/
44+
.coverage
45+
.coverage.*
46+
.cache
47+
nosetests.xml
48+
coverage.xml
49+
*.cover
50+
*.py,cover
51+
.hypothesis/
52+
.pytest_cache/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
target/
76+
77+
# Jupyter Notebook
78+
.ipynb_checkpoints
79+
80+
# IPython
81+
profile_default/
82+
ipython_config.py
83+
84+
# pyenv
85+
.python-version
86+
87+
# pipenv
88+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91+
# install all needed dependencies.
92+
#Pipfile.lock
93+
94+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
__pypackages__/
96+
97+
# Celery stuff
98+
celerybeat-schedule
99+
celerybeat.pid
100+
101+
# SageMath parsed files
102+
*.sage.py
103+
104+
# Environments
105+
.env
106+
.venv
107+
env/
108+
venv/
109+
ENV/
110+
env.bak/
111+
venv.bak/
112+
113+
# Spyder project settings
114+
.spyderproject
115+
.spyproject
116+
117+
# Rope project settings
118+
.ropeproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
.idea/

.isort.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[isort]
2+
multi_line_output = 3
3+
include_trailing_comma = True
4+
force_grid_wrap = 0
5+
use_parentheses = True
6+
ensure_newline_before_comments = True
7+
line_length = 88

.pfnci/checks.bash

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash -e
2+
3+
function run_unit_tests() {
4+
export PYTHONPATH=$(pwd):$PYTHONPATH
5+
python3 tests/run_tests.py
6+
}
7+
8+
function run_lint_check() {
9+
bash .pfnci/linter.bash
10+
}
11+
12+
function run_install_check() {
13+
python3 setup.py install --user
14+
}
15+
16+
function run_all_checks() {
17+
run_unit_tests
18+
run_lint_check
19+
run_install_check
20+
}
21+
22+
run_all_checks

.pfnci/config.pbtxt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
configs {
2+
key: "pynif3d"
3+
value {
4+
requirement {
5+
cpu: 8
6+
memory: 32
7+
disk: 16
8+
gpu: 1
9+
image: "imosci"
10+
}
11+
time_limit {
12+
seconds: 1800
13+
}
14+
command: "bash .pfnci/run_all.bash"
15+
}
16+
}

.pfnci/linter.bash

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Make a copy of the current directory.
4+
root_dir="$(pwd .)"
5+
lint_dir="${root_dir}.lint"
6+
cp -r "$root_dir" "$lint_dir"
7+
8+
# Run the lint checks. On error, terminate the script.
9+
cd "$lint_dir" || exit 1
10+
bash ./dev/linter.sh
11+
exit_code=$?
12+
echo "exit_code of linter is $exit_code"
13+
[ $exit_code -eq 0 ] || exit 1
14+
cd "$root_dir" || (echo "root_dir $root_dir cannot be accessed" && exit 1)
15+
16+
# Compare the files recursively and capture the exit code.
17+
diff -qr "$root_dir" "$lint_dir"
18+
exit_code=$?
19+
echo "exit_code for diff command is $exit_code"
20+
21+
# Clean-up.
22+
rm -rf "$lint_dir"
23+
exit "$exit_code"

.pfnci/run_all.bash

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Set up some useful variables.
4+
docker_url="asia.gcr.io/pfn-public-ci/pynif3d"
5+
container_name="flexci"
6+
7+
# Grant access to the Docker registry.
8+
service docker stop
9+
mount -t tmpfs tmpfs /var/lib/docker -o size=100%
10+
service docker start
11+
gcloud auth configure-docker
12+
13+
# Create container and copy the current source code.
14+
docker pull "$docker_url"
15+
docker create --name="$container_name" -it "$docker_url"
16+
docker start "$container_name"
17+
docker cp . "$container_name":/tmp/"$container_name"
18+
19+
# Run the tests and capture the exit code.
20+
docker exec -e PYTHONPATH=/tmp/"$container_name"/.pfnci \
21+
-e CI_JOB_URL="$CI_JOB_URL" \
22+
-e CI_JOB_ID="$CI_JOB_ID" \
23+
-e CI_PROJECT_NAME="$CI_PROJECT_NAME" \
24+
-w /tmp/"$container_name" \
25+
"$container_name" \
26+
bash -c "bash .pfnci/checks.bash"
27+
exit_code=$?
28+
29+
echo "docker exit_code is $exit_code"
30+
31+
# Clean-up.
32+
docker stop "$container_name"
33+
docker rm "$container_name"
34+
35+
# Return the exit code, so that the job is marked as "Failed" on the CI's page, in case of failure.
36+
exit "$exit_code"

0 commit comments

Comments
 (0)