From 0061b59b791e78fb5251407285bda628611906b6 Mon Sep 17 00:00:00 2001 From: Matt Tancik Date: Mon, 11 Apr 2022 16:44:24 -0700 Subject: [PATCH] Reformat missing files --- .../workflows/{pytest.yml => code_checks.yml} | 2 +- .github/workflows/lint.yml | 29 ------------------- mattport/nerf/dataset/dataset.py | 8 +---- tests/nerf/test_graph.py | 14 +++++---- 4 files changed, 11 insertions(+), 42 deletions(-) rename .github/workflows/{pytest.yml => code_checks.yml} (94%) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/code_checks.yml similarity index 94% rename from .github/workflows/pytest.yml rename to .github/workflows/code_checks.yml index 59c83faa8..1dce516f0 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/code_checks.yml @@ -1,4 +1,4 @@ -name: Format Lint and Test +name: Check code for formating and run tests. on: push: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 087929806..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Lint - -on: - push: - paths: - - '*.py' - pull_request: - paths: - - '*.py' - -jobs: - format_and_lint: - runs-on: ubuntu-latest - steps: - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8.12 - architecture: x64 - - name: Checkout PyTorch - uses: actions/checkout@master - - name: Run Black - uses: psf/black@stable - with: - options: "--check --verbose --line-length=120" - - name: Python Pylint GitHub Action - uses: vcoder4c/git_pylint@v3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/mattport/nerf/dataset/dataset.py b/mattport/nerf/dataset/dataset.py index 2c48232fa..99c8c546b 100644 --- a/mattport/nerf/dataset/dataset.py +++ b/mattport/nerf/dataset/dataset.py @@ -15,12 +15,7 @@ class Dataset(torch.utils.data.Dataset): torch (_type_): _description_ """ - def __init__( - self, - data_directory: str, - dataset_type: str, - scene: str - ): + def __init__(self, data_directory: str, dataset_type: str, scene: str): """_summary_ Args: @@ -33,7 +28,6 @@ class Dataset(torch.utils.data.Dataset): self.dataset_type = dataset_type self.scene = scene - def __len__(self): pass diff --git a/tests/nerf/test_graph.py b/tests/nerf/test_graph.py index bdeefde58..e73de2873 100644 --- a/tests/nerf/test_graph.py +++ b/tests/nerf/test_graph.py @@ -173,13 +173,17 @@ def test_ordering(): assert np.array_equal(target, order) test_repeated_graph.modules_config["mlp_0"]["inputs"][1] = "encoder_1" - test_repeated_graph.modules_config["encoder_1"] = {"class_name": "Encoding", "inputs": ["x"], "meta_data": {"out_dim": 8}} + test_repeated_graph.modules_config["encoder_1"] = { + "class_name": "Encoding", + "inputs": ["x"], + "meta_data": {"out_dim": 8}, + } order = test_repeated_graph.get_module_order() - assert order.index('mlp_0') > order.index('encoder_0') and order.index('mlp_0') > order.index('encoder_1') + assert order.index("mlp_0") > order.index("encoder_0") and order.index("mlp_0") > order.index("encoder_1") test_complex_graph = Graph(create_complex_graph()) _ = test_complex_graph.construct_graph() order = test_complex_graph.get_module_order() - assert order.index('mlp_2') > order.index('mlp_0') - assert order.index('mlp_2') > order.index('encoder_0') - assert order.index('mlp_3') > order.index('encoder_0') + assert order.index("mlp_2") > order.index("mlp_0") + assert order.index("mlp_2") > order.index("encoder_0") + assert order.index("mlp_3") > order.index("encoder_0")