Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use syntax updated with Python 3.8 #343

Merged
merged 4 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/dali_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.8, 3.9]
python: [3.8, 3.9, 3.10, 3.11]
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- name: Cache Python dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python }}-pip-${{ hashFiles('**/setup.py') }}
Expand All @@ -38,7 +38,7 @@ jobs:
pip install mypy pytest-cov black

- name: Cache datasets
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/datasets
key: ${{ runner.os }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8

- name: set PY
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
sphinx-build -b html docs/source docs/build

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v3
with:
name: DocumentationHTML
path: docs/build/html/
10 changes: 5 additions & 5 deletions .github/workflows/sphinx-linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
name: linkcheck
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python 3.9
uses: actions/setup-python@v1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.8

- name: python dependencies
run: |
Expand All @@ -29,7 +29,7 @@ jobs:
run: |
cd docs && make linkcheck

- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v3
with:
name: linkcheck-output.txt
path: docs/build/linkcheck/output.txt
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python: [3.8, 3.9]
python: [3.8, 3.9, 3.10, 3.11]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand All @@ -30,7 +30,7 @@ jobs:
pip install -e .[umap,h5] codecov mypy pytest-cov black

- name: Cache datasets
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/datasets
key: ${{ runner.os }}
Expand All @@ -45,7 +45,7 @@ jobs:
coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
if: always()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
Expand Down
4 changes: 2 additions & 2 deletions downstream/object_detection/convert_model_to_detectron2.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
if "layer" not in k:
k = "stem." + k
for t in [1, 2, 3, 4]:
k = k.replace("layer{}".format(t), "res{}".format(t + 1))
k = k.replace(f"layer{t}", f"res{t + 1}")
for t in [1, 2, 3]:
k = k.replace("bn{}".format(t), "conv{}.norm".format(t))
k = k.replace(f"bn{t}", f"conv{t}.norm")
k = k.replace("downsample.0", "shortcut")
k = k.replace("downsample.1", "shortcut.norm")
print(old_k, "->", k)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ def parse_requirements(path):
extras_require=EXTRA_REQUIREMENTS,
dependency_links=["https://developer.download.nvidia.com/compute/redist"],
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
Expand Down
4 changes: 2 additions & 2 deletions solo/data/dali_dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,11 @@ def __next__(self):
# to be made before returning.

if self.conversion_map is not None:
*all_X, indexes = [batch[v] for v in self.output_map]
*all_X, indexes = (batch[v] for v in self.output_map)
targets = self.conversion_map(indexes).flatten().long().detach().clone()
indexes = indexes.flatten().long().detach().clone()
else:
*all_X, targets = [batch[v] for v in self.output_map]
*all_X, targets = (batch[v] for v in self.output_map)
targets = targets.squeeze(-1).long().detach().clone()
# creates dummy indexes
indexes = (
Expand Down