diff --git a/.codecov.yml b/.codecov.yml index 0f1430acfa..d74c7ec781 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + ignore: - "pyro/docutil.py" - "pyro/logger.py" diff --git a/.coveragerc b/.coveragerc index 45b8e8e715..30f3c0dd8f 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + [report] omit = pyro/docutil.py diff --git a/.gitattributes b/.gitattributes index 2f77e919cd..38a7c00c06 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,5 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + *.ipynb linguist-documentation diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 325287e1a3..a84d4dfdc0 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + # These are supported funding model platforms github: [fritzo] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] diff --git a/.github/issue_template.md b/.github/issue_template.md index 4549578b82..e3eb03eb16 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,3 +1,9 @@ + + ### Guidelines **NOTE:** Issues are for bugs and feature requests only. If you have a question about using Pyro or general modeling questions, please post it on the [forum](https://forum.pyro.ai/). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04ec6f2a8b..84ad85bc3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + name: CI on: @@ -22,9 +26,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -41,9 +45,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -69,9 +73,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -103,9 +107,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -135,13 +139,13 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Setup Graphviz - uses: ts-graphviz/setup-graphviz@v1 + uses: ts-graphviz/setup-graphviz@v2 - name: Install dependencies run: | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test @@ -171,9 +175,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -203,9 +207,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -235,9 +239,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -269,9 +273,9 @@ jobs: matrix: python-version: [3.8] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Coveralls Finished diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c2e8117c33..7f8de80350 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support @@ -19,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml new file mode 100644 index 0000000000..d3cb4df968 --- /dev/null +++ b/.github/workflows/reuse.yml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. +# +# SPDX-License-Identifier: CC0-1.0 + +name: REUSE Compliance Check + +on: [push, pull_request] + +permissions: # set top-level default permissions as security best practice + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: REUSE Compliance Check + uses: fsfe/reuse-action@3ae3c6bdf1257ab19397fab11fd3312144692083 + diff --git a/.gitignore b/.gitignore index b35b756605..4e682ce1f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + run_outputs* .DS_Store .benchmarks diff --git a/.readthedocs.yml b/.readthedocs.yml index ca4e808c59..d27cb95338 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + # Required version: 2 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 8ef523520a..2cc63025aa 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,10 @@ + + + # Contributor Covenant Code of Conduct ## Our Pledge diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 981a2b715c..d4ffc33d26 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,9 @@ + + # Development Please follow our established coding style including variable names, module imports, and function definitions. diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000000..137069b823 --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,73 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt new file mode 100644 index 0000000000..ea890afbc7 --- /dev/null +++ b/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,11 @@ +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt new file mode 100644 index 0000000000..0e259d42c9 --- /dev/null +++ b/LICENSES/CC0-1.0.txt @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000000..2071b23b0e --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Makefile b/Makefile index 04c6112d47..bb38de5a54 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + .PHONY: all install docs lint format test integration-test clean FORCE all: docs test @@ -20,13 +24,9 @@ tutorial: FORCE lint: FORCE ruff check . black --check *.py pyro examples tests scripts profiler - python scripts/update_headers.py --check mypy --install-types --non-interactive pyro scripts tests -license: FORCE - python scripts/update_headers.py - -format: license FORCE +format: FORCE ruff check --fix . black *.py pyro examples tests scripts profiler diff --git a/README.md b/README.md index 027a1b4e21..66b7407e42 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ + + diff --git a/RELEASE-MANAGEMENT.md b/RELEASE-MANAGEMENT.md index 87944fb532..762d85e7cc 100644 --- a/RELEASE-MANAGEMENT.md +++ b/RELEASE-MANAGEMENT.md @@ -1,3 +1,9 @@ + + # Pyro release management This describes the process by which versions of Pyro are officially released to the public. diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000000..e722173689 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,107 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + +version = 1 +SPDX-PackageName = "pyro" +SPDX-PackageSupplier = "TODO add" +SPDX-PackageDownloadLocation = "pyro.ai" + +[[annotations]] +path = "tutorial/source/**ipynb" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "tutorial/source/**rst" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "tutorial/source/**jpg" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + + +[[annotations]] +path = "tutorial/source/**png" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**png" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**rst" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**gif" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**ico" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**csv" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/**txt" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "tutorial/source/**gif" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "tutorial/source/**ico" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "examples/capture_recapture/**csv" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright (c) 2017-2019 Uber Technologies, Inc." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "MANIFEST.in" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "docs/source/_static/img/favicon/manifest.json" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + +[[annotations]] +path = "tests/infer/enum_growth.ipynb" +precedence = "aggregate" +SPDX-FileCopyrightText = "Copyright Contributors to the Pyro project." +SPDX-License-Identifier = "Apache-2.0" + + diff --git a/docker/Dockerfile b/docker/Dockerfile index f8c67fb178..730256fccb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + ARG base_img=ubuntu:18.04 FROM ${base_img} diff --git a/docker/Makefile b/docker/Makefile index d13ff2f351..0f9abdc53b 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + .PHONY: help create-host-workspace build build-gpu run run-gpu notebook notebook-gpu DOCKER_FILE=Dockerfile diff --git a/docker/README.md b/docker/README.md index fd80be555a..92e5d1e627 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,3 +1,9 @@ + + ## Using Pyro Docker Some utilities for building docker images and running Pyro inside a Docker container are diff --git a/docker/install.sh b/docker/install.sh index 705533bbaa..1f1f53323f 100755 --- a/docker/install.sh +++ b/docker/install.sh @@ -1,4 +1,9 @@ #!/usr/bin/env bash + +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + set -xe pip install --upgrade pip diff --git a/docs/Makefile b/docs/Makefile index 06bbf77d2f..3dca05ce3a 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + # Minimal makefile for Sphinx documentation # diff --git a/docs/README.md b/docs/README.md index 38e2a34673..c724cb1246 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,9 @@ + + # Documentation # Pyro Documentation is supported by [Sphinx](http://www.sphinx-doc.org/en/stable/). To build the docs, run from the toplevel directory: diff --git a/docs/requirements.txt b/docs/requirements.txt index b14a67b6c4..3bae619297 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + sphinx==4.2.0 sphinx-rtd-theme==1.0.0 graphviz>=0.8 diff --git a/docs/source/_static/css/pyro.css b/docs/source/_static/css/pyro.css index 335d437a81..0561ba35e6 100644 --- a/docs/source/_static/css/pyro.css +++ b/docs/source/_static/css/pyro.css @@ -1,3 +1,9 @@ +/* + * Copyright Contributors to the Pyro project. + * + * SPDX-License-Identifier: Apache-2.0 + */ + @import url("theme.css"); .wy-side-nav-search { diff --git a/docs/source/_static/img/favicon/browserconfig.xml b/docs/source/_static/img/favicon/browserconfig.xml index c554148223..6430a6715b 100644 --- a/docs/source/_static/img/favicon/browserconfig.xml +++ b/docs/source/_static/img/favicon/browserconfig.xml @@ -1,2 +1,9 @@ + + + #ffffff \ No newline at end of file diff --git a/examples/eight_schools/README.md b/examples/eight_schools/README.md index 2b934eb145..c7066b90c1 100644 --- a/examples/eight_schools/README.md +++ b/examples/eight_schools/README.md @@ -1,3 +1,9 @@ + + Analysis of the eight schools data (chapter 5 of [Gelman et al 2013]) using MCMC (NUTS) and SVI. The starting model is the Stan model: diff --git a/examples/mixed_hmm/README.md b/examples/mixed_hmm/README.md index 649c8253ab..380d9d641b 100644 --- a/examples/mixed_hmm/README.md +++ b/examples/mixed_hmm/README.md @@ -1,3 +1,9 @@ + + # Hierarchical mixed-effect hidden Markov models Note: This is a cleaned-up version of the seal experiments in [Bingham et al 2019] that is a simplified variant of some of the analysis in the [momentuHMM harbour seal example](https://github.com/bmcclintock/momentuHMM/blob/master/vignettes/harbourSealExample.R) [McClintock et al 2018]. diff --git a/examples/rsa/README.md b/examples/rsa/README.md index 270dce7aae..2ca69a16f4 100644 --- a/examples/rsa/README.md +++ b/examples/rsa/README.md @@ -1,3 +1,9 @@ + + ## Rational Speech Acts (RSA) examples This folder contains examples of reasoning about reasoning with nested inference diff --git a/pyproject.toml b/pyproject.toml index fac4c43928..4ae021c471 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + [tool.ruff] line-length = 120 diff --git a/pyro/contrib/README.md b/pyro/contrib/README.md index b6195f026f..bbb71554ad 100644 --- a/pyro/contrib/README.md +++ b/pyro/contrib/README.md @@ -1,3 +1,9 @@ + + # Contributed Code Code in `pyro.contrib` is under various stages of development. diff --git a/scripts/install_pytorch.sh b/scripts/install_pytorch.sh index 73447e5cfa..c7d5910f4d 100644 --- a/scripts/install_pytorch.sh +++ b/scripts/install_pytorch.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + set -xe diff --git a/scripts/perf_test.sh b/scripts/perf_test.sh index ed911d8cff..86186ad218 100644 --- a/scripts/perf_test.sh +++ b/scripts/perf_test.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + set -xe function _cleanup() { diff --git a/scripts/profile_model.sh b/scripts/profile_model.sh index 5304196be5..b2a1005e4d 100644 --- a/scripts/profile_model.sh +++ b/scripts/profile_model.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + set -xe function _cleanup() { diff --git a/scripts/update_headers.py b/scripts/update_headers.py deleted file mode 100644 index 48ccf2dfb8..0000000000 --- a/scripts/update_headers.py +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright Contributors to the Pyro project. -# SPDX-License-Identifier: Apache-2.0 - -import argparse -import glob -import os -import sys - -root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -blacklist = ["/build/", "/dist/", "/pyro/_version.py"] -file_types = [ - ("*.py", "# {}"), - ("*.cpp", "// {}"), -] - -parser = argparse.ArgumentParser() -parser.add_argument("--check", action="store_true") -args = parser.parse_args() -dirty = [] - -for basename, comment in file_types: - copyright_line = comment.format("Copyright Contributors to the Pyro project.\n") - # See https://spdx.org/ids-how - spdx_line = comment.format("SPDX-License-Identifier: Apache-2.0\n") - - filenames = glob.glob(os.path.join(root, "**", basename), recursive=True) - filenames.sort() - filenames = [ - filename - for filename in filenames - if not any(word in filename for word in blacklist) - ] - for filename in filenames: - with open(filename) as f: - lines = f.readlines() - - # Ignore empty files like __init__.py - if all(line.isspace() for line in lines): - continue - - # Ensure first few line are copyright notices. - changed = False - lineno = 0 - if not lines[lineno].startswith(comment.format("Copyright")): - lines.insert(lineno, copyright_line) - changed = True - lineno += 1 - while lines[lineno].startswith(comment.format("Copyright")): - lineno += 1 - - # Ensure next line is an SPDX short identifier. - if not lines[lineno].startswith(comment.format("SPDX-License-Identifier")): - lines.insert(lineno, spdx_line) - changed = True - lineno += 1 - - # Ensure next line is blank. - if not lines[lineno].isspace(): - lines.insert(lineno, "\n") - changed = True - - if not changed: - continue - - if args.check: - dirty.append(filename) - continue - - with open(filename, "w") as f: - f.write("".join(lines)) - - print("updated {}".format(filename[len(root) + 1 :])) - -if dirty: - print("The following files need license headers:\n{}".format("\n".join(dirty))) - print("Please run 'make license'") - sys.exit(1) diff --git a/setup.cfg b/setup.cfg index 1da059e331..a92c6f00d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + [tool:pytest] filterwarnings = error ignore:numpy.ufunc size changed:RuntimeWarning diff --git a/tests/README.md b/tests/README.md index 54111e3266..a6fc03918e 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,3 +1,9 @@ + + # Testing ### Building PyTorch binaries for Travis CI diff --git a/tutorial/Makefile b/tutorial/Makefile index ee10d1f4ed..a1410d5f0e 100644 --- a/tutorial/Makefile +++ b/tutorial/Makefile @@ -1,3 +1,7 @@ +# Copyright Contributors to the Pyro project. +# +# SPDX-License-Identifier: Apache-2.0 + # Minimal makefile for Sphinx documentation # diff --git a/tutorial/README.md b/tutorial/README.md index 9e498f8a04..190fbe2beb 100644 --- a/tutorial/README.md +++ b/tutorial/README.md @@ -1 +1,7 @@ + + [http://pyro.ai/examples](http://pyro.ai/examples) diff --git a/tutorial/source/_static/css/pyro.css b/tutorial/source/_static/css/pyro.css index 335d437a81..0561ba35e6 100644 --- a/tutorial/source/_static/css/pyro.css +++ b/tutorial/source/_static/css/pyro.css @@ -1,3 +1,9 @@ +/* + * Copyright Contributors to the Pyro project. + * + * SPDX-License-Identifier: Apache-2.0 + */ + @import url("theme.css"); .wy-side-nav-search { diff --git a/tutorial/source/_static/img/dmm.tex b/tutorial/source/_static/img/dmm.tex index 4b8b4e6ac0..1d2053b2b2 100644 --- a/tutorial/source/_static/img/dmm.tex +++ b/tutorial/source/_static/img/dmm.tex @@ -1,3 +1,7 @@ +% Copyright Contributors to the Pyro project. +% +% SPDX-License-Identifier: Apache-2.0 + \documentclass[12pt]{article} \usepackage{amsmath,amscd,amssymb} \usepackage[pdftex]{graphicx} diff --git a/tutorial/source/sir_hmc.rst b/tutorial/source/sir_hmc.rst index ccc26a33e3..8a196d90f1 100644 --- a/tutorial/source/sir_hmc.rst +++ b/tutorial/source/sir_hmc.rst @@ -1,3 +1,7 @@ +.. Copyright Contributors to the Pyro project. +.. +.. SPDX-License-Identifier: Apache-2.0 + Example: Epidemiological inference via HMC ==========================================