diff --git a/docs/conf.py b/docs/conf.py index 76edc5bc..4789d1ea 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # flake8: noqa diff --git a/pytorch3d/__init__.py b/pytorch3d/__init__.py index 6f096150..fb1f32e2 100644 --- a/pytorch3d/__init__.py +++ b/pytorch3d/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. __version__ = "0.1.1" diff --git a/pytorch3d/loss/mesh_laplacian_smoothing.py b/pytorch3d/loss/mesh_laplacian_smoothing.py index ee365c6f..bdffcd1f 100644 --- a/pytorch3d/loss/mesh_laplacian_smoothing.py +++ b/pytorch3d/loss/mesh_laplacian_smoothing.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import torch diff --git a/pytorch3d/loss/mesh_normal_consistency.py b/pytorch3d/loss/mesh_normal_consistency.py index 8ada7eab..071e2de4 100644 --- a/pytorch3d/loss/mesh_normal_consistency.py +++ b/pytorch3d/loss/mesh_normal_consistency.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from itertools import islice diff --git a/pytorch3d/utils/torus.py b/pytorch3d/utils/torus.py index 9280e640..1675a75f 100644 --- a/pytorch3d/utils/torus.py +++ b/pytorch3d/utils/torus.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from itertools import tee from math import cos, pi, sin diff --git a/scripts/build_website.sh b/scripts/build_website.sh index e14f2d83..c092a539 100644 --- a/scripts/build_website.sh +++ b/scripts/build_website.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # run this script from the project root using `./scripts/build_docs.sh` @@ -57,4 +57,4 @@ else echo "Starting local server" echo "-----------------------------------" yarn start -fi \ No newline at end of file +fi diff --git a/scripts/parse_tutorials.py b/scripts/parse_tutorials.py index 6bc61108..37f13c46 100755 --- a/scripts/parse_tutorials.py +++ b/scripts/parse_tutorials.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import argparse import json diff --git a/scripts/publish_website.sh b/scripts/publish_website.sh index e3002958..695cc95e 100644 --- a/scripts/publish_website.sh +++ b/scripts/publish_website.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) Facebook, Inc. and its affiliates. +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. usage() { echo "Usage: $0 [-b]" diff --git a/tests/bm_blending.py b/tests/bm_blending.py index 46d6a3fb..561de111 100644 --- a/tests/bm_blending.py +++ b/tests/bm_blending.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from itertools import product diff --git a/tests/bm_mesh_laplacian_smoothing.py b/tests/bm_mesh_laplacian_smoothing.py index 0973b8dd..4f332c75 100644 --- a/tests/bm_mesh_laplacian_smoothing.py +++ b/tests/bm_mesh_laplacian_smoothing.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from itertools import product diff --git a/tests/bm_mesh_normal_consistency.py b/tests/bm_mesh_normal_consistency.py index 5347ad1a..d77e1466 100644 --- a/tests/bm_mesh_normal_consistency.py +++ b/tests/bm_mesh_normal_consistency.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. from itertools import product diff --git a/tests/test_build.py b/tests/test_build.py new file mode 100644 index 00000000..53e98701 --- /dev/null +++ b/tests/test_build.py @@ -0,0 +1,45 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. +import unittest +from collections import Counter +from pathlib import Path + +# This file groups together tests which look at the code without running it. + + +class TestBuild(unittest.TestCase): + def test_name_clash(self): + # For setup.py, all translation units need distinct names, so we + # cannot have foo.cu and foo.cpp, even in different directories. + test_dir = Path(__file__).resolve().parent + source_dir = test_dir.parent / "pytorch3d" + + stems = [] + for extension in [".cu", ".cpp"]: + files = source_dir.glob(f"**/*{extension}") + stems.extend(f.stem for f in files) + + counter = Counter(stems) + for k, v in counter.items(): + self.assertEqual(v, 1, f"Too many files with stem {k}.") + + def test_copyright(self): + test_dir = Path(__file__).resolve().parent + root_dir = test_dir.parent + + extensions = ("py", "cu", "cuh", "cpp", "h", "hpp", "sh") + + expect = ( + "Copyright (c) Facebook, Inc. and its affiliates." + + " All rights reserved.\n" + ) + + for extension in extensions: + for i in root_dir.glob(f"**/*.{extension}"): + with open(i) as f: + firstline = f.readline() + if firstline.startswith(("# -*-", "#!")): + firstline = f.readline() + self.assertTrue( + firstline.endswith(expect), + f"{i} missing copyright header.", + ) diff --git a/tests/test_mesh_laplacian_smoothing.py b/tests/test_mesh_laplacian_smoothing.py index ef4cd4c6..ea6ce49b 100644 --- a/tests/test_mesh_laplacian_smoothing.py +++ b/tests/test_mesh_laplacian_smoothing.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import unittest diff --git a/tests/test_mesh_normal_consistency.py b/tests/test_mesh_normal_consistency.py index 44d1075a..63fff18e 100644 --- a/tests/test_mesh_normal_consistency.py +++ b/tests/test_mesh_normal_consistency.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import unittest diff --git a/tests/test_rotation_conversions.py b/tests/test_rotation_conversions.py index 99042f88..0e62b709 100644 --- a/tests/test_rotation_conversions.py +++ b/tests/test_rotation_conversions.py @@ -1,4 +1,4 @@ -# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools