diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ab4d71bc6c..83f48a9bda 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main workflow_dispatch: diff --git a/.github/workflows/test-conda-cpu.yml b/.github/workflows/test-conda-cpu.yml index 3295edcca8..c593e95a12 100644 --- a/.github/workflows/test-conda-cpu.yml +++ b/.github/workflows/test-conda-cpu.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main workflow_dispatch: diff --git a/.github/workflows/test-pip-cpu-with-mypy.yml b/.github/workflows/test-pip-cpu-with-mypy.yml index 7e166261e4..0d8a88456a 100644 --- a/.github/workflows/test-pip-cpu-with-mypy.yml +++ b/.github/workflows/test-pip-cpu-with-mypy.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main workflow_dispatch: diff --git a/.github/workflows/test-pip-cpu.yml b/.github/workflows/test-pip-cpu.yml index a83f18e05d..d6ffb7c046 100644 --- a/.github/workflows/test-pip-cpu.yml +++ b/.github/workflows/test-pip-cpu.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main workflow_dispatch: diff --git a/.github/workflows/test-pip-gpu.yml b/.github/workflows/test-pip-gpu.yml index 117f515f48..0b2990f600 100644 --- a/.github/workflows/test-pip-gpu.yml +++ b/.github/workflows/test-pip-gpu.yml @@ -4,7 +4,7 @@ on: pull_request: push: branches: - - master + - main workflow_dispatch: diff --git a/.github/workflows/test-website-depoy.yml b/.github/workflows/test-website-deploy.yml similarity index 100% rename from .github/workflows/test-website-depoy.yml rename to .github/workflows/test-website-deploy.yml diff --git a/.github/workflows/website-depoy.yml b/.github/workflows/website-deploy.yml similarity index 98% rename from .github/workflows/website-depoy.yml rename to .github/workflows/website-deploy.yml index 8c28e1abe4..498a00bc22 100644 --- a/.github/workflows/website-depoy.yml +++ b/.github/workflows/website-deploy.yml @@ -3,7 +3,7 @@ name: Deploy to GitHub Pages on: push: branches: - - master + - main # Review gh actions docs if you want to further define triggers, paths, etc # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4342e18ec4..4b4a4f0f1e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -109,7 +109,7 @@ The following command will both build the docs and serve the site locally: ## Pull Requests We actively welcome your pull requests. -1. Fork the repo and create your branch from `master`. +1. Fork the repo and create your branch from `main`. 2. If you have added code that should be tested, add unit tests. In other words, add unit tests. 3. If you have changed APIs, update the documentation. Make sure the diff --git a/README.md b/README.md index a78f996561..48d27a7aa6 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ [![Conda Recipe](https://img.shields.io/static/v1?logo=conda-forge&style=flat&color=green&label=recipe&message=captum)][#conda-forge-feedstock] [![Docs - GitHub.io](https://img.shields.io/static/v1?logo=captum&style=flat&color=pink&label=docs&message=captum)][#docs-package] -[#github-license]: https://github.com/pytorch/captum/blob/master/LICENSE +[#github-license]: https://github.com/pytorch/captum/blob/main/LICENSE [#pypi-package]: https://pypi.org/project/captum/ [#conda-forge-package]: https://anaconda.org/conda-forge/captum [#conda-forge-feedstock]: https://github.com/conda-forge/captum-feedstock @@ -82,7 +82,7 @@ pip install captum If you'd like to try our bleeding edge features (and don't mind potentially running into the occasional bug here or there), you can install the latest -master directly from GitHub. For a basic install, run: +main directly from GitHub. For a basic install, run: ```bash git clone https://github.com/pytorch/captum.git cd captum diff --git a/docs/contribution_guide.md b/docs/contribution_guide.md index 82e4f158a2..c4f88c4bc2 100644 --- a/docs/contribution_guide.md +++ b/docs/contribution_guide.md @@ -45,7 +45,7 @@ Before contributing an algorithm to Captum, please review these guidelines and p If you think that proposed algorithm/feature satisfies many of the above criteria, please open an issue on GitHub (https://github.com/pytorch/captum/issues) to discuss the method with the core Captum team members before submitting a pull request. If the method seems suitable for inclusion in Captum, we will generally request a design document or proposal, explaining the proposed API and structure for the new algorithm. An example of a design proposal for LIME and Kernel SHAP can be found here (https://github.com/pytorch/captum/issues/467). -If an algorithm or feature adds only marginal improvements or does not meet most the criteria described above, then we would suggest including it into our AWESOME_LIST.MD (https://github.com/pytorch/captum/blob/master/AWESOME_LIST.md) instead of adding it to the core Captum library. In the future, if the algorithm gains more popularity and acceptance in the model interpretability community, we would be happy to accept a PR to add it to the Captum core library. +If an algorithm or feature adds only marginal improvements or does not meet most the criteria described above, then we would suggest including it into our AWESOME_LIST.MD (https://github.com/pytorch/captum/blob/main/AWESOME_LIST.md) instead of adding it to the core Captum library. In the future, if the algorithm gains more popularity and acceptance in the model interpretability community, we would be happy to accept a PR to add it to the Captum core library. *Note that we reserve the right to decide not to include any algorithms that meet the above criteria, but we are unable to support in the long run.* diff --git a/docs/getting_started.md b/docs/getting_started.md index f1d57c8481..0a06aaebc9 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -30,7 +30,7 @@ pip install captum For more detailed installation instructions, please see the -[Project Readme](https://github.com/pytorch/captum/blob/master/README.md) +[Project Readme](https://github.com/pytorch/captum/blob/main/README.md) on GitHub. @@ -50,5 +50,5 @@ For an in-depth reference of the various Captum internals, see our ## Contributing You'd like to contribute to Captum? Great! Please see -[here](https://github.com/pytorch/captum/blob/master/CONTRIBUTING.md) +[here](https://github.com/pytorch/captum/blob/main/CONTRIBUTING.md) for how to help out. diff --git a/scripts/publish_site.sh b/scripts/publish_site.sh index 0180ae5e37..28aea0a3fc 100755 --- a/scripts/publish_site.sh +++ b/scripts/publish_site.sh @@ -42,8 +42,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" WORK_DIR=$(mktemp -d) cd "${WORK_DIR}" || exit -# Clone both master & gh-pages branches -git clone git@github.com:pytorch/captum.git captum-master +# Clone both main & gh-pages branches +git clone git@github.com:pytorch/captum.git captum-main git clone --branch gh-pages git@github.com:pytorch/captum.git captum-gh-pages # A few notes about the script below: @@ -75,11 +75,11 @@ git clone --branch gh-pages git@github.com:pytorch/captum.git captum-gh-pages # the site or the latest version. Instead, we determine this at runtime. # We use what's on gh-pages in the versions subdirectory as the # source of truth for available versions and use the latest tag on -# the master branch as the source of truth for the latest version. +# the main branch as the source of truth for the latest version. if [[ $VERSION == false ]]; then echo "-----------------------------------------" - echo "Updating latest (master) version of site " + echo "Updating latest (main) version of site " echo "-----------------------------------------" # Populate _versions.json from existing versions; this is used @@ -89,12 +89,12 @@ if [[ $VERSION == false ]]; then CMD="import os, json; " CMD+="vs = [v for v in os.listdir('captum-gh-pages/versions') if v != 'latest' and not v.startswith('.')]; " CMD+="print(json.dumps(vs))" - python3 -c "$CMD" > captum-master/website/_versions.json + python3 -c "$CMD" > captum-main/website/_versions.json # Move versions.js to website subdirectory. # This is the page you see when click on version in navbar. - cp captum-master/scripts/versions.js captum-master/website/pages/en/versions.js - cd captum-master/website || exit + cp captum-main/scripts/versions.js captum-main/website/pages/en/versions.js + cd captum-main/website || exit # Build site, tagged with "latest" version; baseUrl set to /versions/latest/ yarn @@ -112,7 +112,7 @@ if [[ $VERSION == false ]]; then cd "${WORK_DIR}" || exit cp captum-gh-pages/versions/latest/versions.html versions.html rm -rf captum-gh-pages/versions/latest - mv captum-master/website/build/captum captum-gh-pages/versions/latest + mv captum-main/website/build/captum captum-gh-pages/versions/latest # versions.html goes both in top-level and under en/ (default language) cp versions.html captum-gh-pages/versions/latest/versions.html cp versions.html captum-gh-pages/versions/latest/en/versions.html @@ -128,8 +128,8 @@ else echo "Building new version ($VERSION) of site " echo "-----------------------------------------" - # Checkout master branch with specified tag - cd captum-master || exit + # Checkout main branch with specified tag + cd captum-main || exit git fetch --tags git checkout "${VERSION}" @@ -160,15 +160,15 @@ else # Move built site to new folder (new-site) & carry over old versions # from existing gh-pages cd "${WORK_DIR}" || exit - rm -rf captum-master/website/build/captum/docs/next # don't need this - mv captum-master/website/build/captum new-site + rm -rf captum-main/website/build/captum/docs/next # don't need this + mv captum-main/website/build/captum new-site mv captum-gh-pages/versions new-site/versions # Build new version of site (to be placed in versions/$VERSION/) # the only thing that changes here is the baseUrl (for nav purposes) # we build this now so that in the future, we can just bump version and not move # previous stable to versions - cd captum-master/website || exit + cd captum-main/website || exit sed -i '' "s/baseUrl = '\/'/baseUrl = '\/versions\/${VERSION}\/'/g" siteConfig.js # disable search for non-stable version (can't use sed b/c of newline) @@ -188,14 +188,14 @@ else # newer versions. This is the only part of the old versions that # needs to be updated when a new version is built. cd "${WORK_DIR}" || exit - python3 captum-master/scripts/update_versions_html.py -p "${WORK_DIR}" + python3 captum-main/scripts/update_versions_html.py -p "${WORK_DIR}" # Init as Git repo and push to gh-pages cd new-site || exit git init git add --all git commit -m "Publish version ${VERSION} of site" - git push --force "https://github.com/pytorch/captum" master:gh-pages + git push --force "https://github.com/pytorch/captum" main:gh-pages fi diff --git a/scripts/update_versions_html.py b/scripts/update_versions_html.py index 6299972e7b..471f9d9a45 100644 --- a/scripts/update_versions_html.py +++ b/scripts/update_versions_html.py @@ -9,7 +9,7 @@ def updateVersionHTML(base_path, base_url=BASE_URL): - with open(base_path + "/captum-master/website/_versions.json", "rb") as infile: + with open(base_path + "/captum-main/website/_versions.json", "rb") as infile: versions = json.loads(infile.read()) with open(base_path + "/new-site/versions.html", "rb") as infile: diff --git a/scripts/versions.js b/scripts/versions.js index f04a33824d..3edce43c59 100644 --- a/scripts/versions.js +++ b/scripts/versions.js @@ -49,7 +49,7 @@ function Versions(props) { {'latest'} - {' (master)'} + {' (main)'} diff --git a/website/siteConfig.js b/website/siteConfig.js index 41fac3bd3e..885224be61 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -85,7 +85,7 @@ const siteConfig = { docsSideNavCollapsible: false, // URL for editing docs - editUrl: "https://github.com/pytorch/captum/edit/master/docs/", + editUrl: "https://github.com/pytorch/captum/edit/main/docs/", // Disable logo text so we can just show the logo disableHeaderTitle: true,