Skip to content

Commit 5210201

Browse files
A new start
0 parents  commit 5210201

74 files changed

Lines changed: 4179 additions & 0 deletions

Some content is hidden

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

.flake8

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[flake8]
2+
select = B,C,E,F,P,T4,W,B9
3+
max-line-length = 120
4+
# Consistent with pytorch
5+
# C408 ignored because we like the dict keyword argument syntax
6+
# E501 is not flexible enough, we're using B950 instead
7+
ignore =
8+
E203,E305,E402,E501,E721,E741,F405,F821,F841,F999,W503,W504,C408,E302,W291,E303,
9+
# shebang has extra meaning in fbcode lints, so I think it's not worth trying
10+
# to line this up with executable bit
11+
EXE001,
12+
optional-ascii-coding = True
13+
exclude =
14+
./.git,
15+
./third_party,
16+
*.pyi

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Run DataPipes Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Setup Python environment
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.6
18+
- name: Check out source repository
19+
uses: actions/checkout@v2
20+
- name: Install dependencies
21+
run: |
22+
set -eux
23+
pip3 install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --user
24+
pip3 install expecttest requests --user # TODO: Install from requirements except torch
25+
pip3 install pytest --user
26+
- name: Build TorchData
27+
run: |
28+
set -eux
29+
python setup.py develop --user
30+
- name: Run DataPipes tests with pytest
31+
run: pytest test

.github/workflows/lint.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
8+
jobs:
9+
flake8-py3:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Setup Python environment
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.8"
16+
- name: Check out source repository
17+
uses: actions/checkout@v2
18+
- name: Run flake8
19+
uses: py-actions/flake8@v1
20+
21+
mypy:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Setup Python environment
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.8
28+
- name: Check out source repository
29+
uses: actions/checkout@v2
30+
- name: Install PyTorch
31+
run: |
32+
set -eux
33+
python -m pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html --user
34+
- name: Install dependencies
35+
run: |
36+
set -eux
37+
python -m pip install requests --user
38+
python -m pip install mypy==0.812 --user
39+
- name: Build TorchData
40+
run: |
41+
set -eux
42+
python setup.py develop --user
43+
- name: Run mypy
44+
env:
45+
MYPY_FORCE_COLOR: 1
46+
TERM: xterm-color
47+
run: |
48+
set -eux
49+
STATUS=
50+
if ! mypy --config=mypy.ini; then
51+
STATUS=fail
52+
fi
53+
if [ -n "$STATUS" ]; then
54+
echo 'Please fix the above mypy warnings.'
55+
false
56+
fi

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
build/*
2+
dist/*
3+
torchdata.egg-info/*
4+
5+
torchdata/version.py
6+
7+
# Editor temporaries
8+
*.swn
9+
*.swo
10+
*.swp
11+
*.swm
12+
*~
13+
.vscode
14+
.idea
15+
16+
# macOS dir files
17+
.DS_Store
18+
19+
# Compiled python
20+
*.pyc
21+
*.pyd
22+
23+
# setup script artifacts for Velox
24+
f4d-deps

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at <conduct@pytorch.org>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing to TorchData
2+
We want to make contributing to this project as easy and transparent as
3+
possible.
4+
5+
## Our Development Process
6+
... (in particular how this is synced with internal changes to the project)
7+
8+
## Pull Requests
9+
We actively welcome your pull requests.
10+
11+
1. Fork the repo and create your branch from `main`.
12+
2. If you've added code that should be tested, add tests.
13+
3. If you've changed APIs, update the documentation and examples.
14+
4. Ensure the test suite passes.
15+
5. If you haven't already, complete the Contributor License Agreement ("CLA").
16+
17+
## Contributor License Agreement ("CLA")
18+
In order to accept your pull request, we need you to submit a CLA. You only need
19+
to do this once to work on any of Facebook's open source projects.
20+
21+
Complete your CLA here: <https://code.facebook.com/cla>
22+
23+
## Issues
24+
We use GitHub issues to track public bugs. Please ensure your description is
25+
clear and has sufficient instructions to be able to reproduce the issue.
26+
27+
## License
28+
By contributing to TorchData, you agree that your contributions will be licensed
29+
under the LICENSE file in the root directory of this source tree.

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2021-present, Facebook, Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)