Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
pull_request:
types: [opened, synchronize]
branches:
- master
- main

merge_group:
types:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/osv-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ on:
types: [opened, synchronize]
branches:
- main
- master

# Support merge queues.
merge_group:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scorecard-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ on:
types: [opened, synchronize]
branches:
- main
- master

# Support merge queues.
merge_group:
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. image:: https://raw.githubusercontent.com/quantumlib/OpenFermion/refs/heads/master/docs/images/logo_horizontal.svg
.. image:: https://raw.githubusercontent.com/quantumlib/OpenFermion/refs/heads/main/docs/images/logo_horizontal.svg
:alt: OpenFermion logo
:width: 75%
:align: center
Expand Down Expand Up @@ -42,7 +42,7 @@ You can run the interactive Jupyter Notebooks in |Colab|_ or |MyBinder|_.
.. _Colab: https://colab.research.google.com/github/quantumlib/OpenFermion

.. |MyBinder| replace:: MyBinder
.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/master?filepath=examples
.. _MyBinder: https://mybinder.org/v2/gh/quantumlib/OpenFermion/main?filepath=examples

Installation and Documentation
==============================
Expand All @@ -64,7 +64,7 @@ the electronic structure plugins are only compatible on these platforms. However
for those who would like to use Windows, or for anyone having other difficulties
with installing OpenFermion or its plugins, we provide a Docker image
and usage instructions in the
`docker folder <https://github.com/quantumlib/OpenFermion/tree/master/docker>`__.
`docker folder <https://github.com/quantumlib/OpenFermion/tree/main/docker>`__.
The Docker image provides a virtual environment with OpenFermion and select plugins pre-installed.
The Docker installation should run on any operating system where Docker can be used.

Expand Down
23 changes: 11 additions & 12 deletions check/format-incremental
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
#
# You can specify a base git revision to compare against (i.e. to use when
# determining whether or not a file is considered to have "changed"). For
# example, you can compare against 'origin/master' or 'HEAD~1'.
# example, you can compare against 'origin/main' or 'HEAD~1'.
#
# If you don't specify a base revision, the following defaults will be tried, in
# order, until one exists:
#
# 1. upstream/master
# 2. origin/master
# 3. master
# 1. upstream/main
# 2. origin/main
# 3. main
#
# If none exists, the script fails.
################################################################################
Expand All @@ -48,7 +48,6 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
topdir="$(git -C "${thisdir}" rev-parse --show-toplevel)" || exit $?
cd "${topdir}" || exit $?


# Parse arguments.
only_print=1
only_changed=1
Expand All @@ -74,14 +73,14 @@ typeset -a format_files
if (( only_changed == 1 )); then
# Figure out which branch to compare against.
if [ -z "${rev}" ]; then
if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
rev=upstream/master
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
rev=origin/master
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
rev=master
if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
rev=upstream/main
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
rev=origin/main
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
rev=main
else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
exit 1
fi
fi
Expand Down
21 changes: 9 additions & 12 deletions check/pylint-changed-files
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
# If you don't specify a base revision, the following defaults will be tried,
# in order, until one exists:
#
# 1. upstream/main or upstream/master
# 2. origin/main or origin/master
# 3. main or master
# 1. upstream/main
# 2. origin/main
# 3. main
#
# If none exists, the script will exit with an error.
#
Expand All @@ -43,22 +43,19 @@ thisdir=$(dirname "${BASH_SOURCE[0]:?}") || exit $?
repo_dir=$(git -C "${thisdir}" rev-parse --show-toplevel) || exit $?
cd "${repo_dir}" || exit $?

# Some old repos used "master" instead of main. Find out which one we have here.
default=$(git branch --format '%(refname:short)' --list master main)

# Figure out which revision to compare against.
if [ -n "$1" ] && [[ $1 != -* ]]; then
if ! git rev-parse --verify --quiet --no-revs "$1^{commit}"; then
echo -e "\033[31mNo revision '$1'.\033[0m" >&2
exit 1
fi
rev=$1
elif [ "$(git cat-file -t "upstream/${default}" 2> /dev/null)" == "commit" ]; then
rev=upstream/${default}
elif [ "$(git cat-file -t "origin/${default}" 2> /dev/null)" == "commit" ]; then
rev=origin/${default}
elif [ "$(git cat-file -t "${default}" 2> /dev/null)" == "commit" ]; then
rev=${default}
elif [ "$(git cat-file -t "upstream/main" 2> /dev/null)" == "commit" ]; then
rev=upstream/main
elif [ "$(git cat-file -t "origin/main" 2> /dev/null)" == "commit" ]; then
rev=origin/main
elif [ "$(git cat-file -t "main" 2> /dev/null)" == "commit" ]; then
rev=main
else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
exit 1
Expand Down
24 changes: 12 additions & 12 deletions check/pytest-and-incremental-coverage
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
# You can specify a base git revision to compare against (i.e. to use when
# determining whether or not a line is considered to have "changed"). To make
# the tool more consistent, it actually diffs against the most recent common
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
# actually diffing against the output of 'git merge-base origin/master HEAD'.
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
# actually diffing against the output of 'git merge-base origin/main HEAD'.
#
# If you don't specify a base revision, the following defaults will be tried,
# in order, until one exists:
#
# 1. upstream/master
# 2. origin/master
# 3. master
# 1. upstream/main
# 2. origin/main
# 3. main
#
# If none exists, the script fails.
################################################################################
Expand All @@ -46,14 +46,14 @@ if [[ -n "$1" && $1 != -* ]]; then
exit 1
fi
rev=$1
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
rev=upstream/master
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
rev=origin/master
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
rev=master
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
rev=upstream/main
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
rev=origin/main
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
rev=main
else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
exit 1
fi
# shellcheck disable=SC2086
Expand Down
2 changes: 1 addition & 1 deletion dev_tools/check_incremental_coverage_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def main():
if len(sys.argv) < 2:
print(
shell_tools.highlight(
'Must specify a comparison branch (e.g. "origin/master" or "HEAD~1").',
'Must specify a comparison branch (e.g. "origin/main" or "HEAD~1").',
shell_tools.RED,
)
)
Expand Down
22 changes: 12 additions & 10 deletions dev_tools/docs/build_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,19 @@

import openfermion

flags.DEFINE_string("output_dir", "/tmp/openfermion_api",
"Where to output the docs")
flags.DEFINE_string("output_dir", "/tmp/openfermion_api", "Where to output the docs")

flags.DEFINE_string("code_url_prefix",
("https://github.com/quantumlib/OpenFermion/tree/master/src"
"openfermion"), "The url prefix for links to code.")
flags.DEFINE_string(
"code_url_prefix",
("https://github.com/quantumlib/OpenFermion/tree/main/src" "openfermion"),
"The url prefix for links to code.",
)

flags.DEFINE_bool("search_hints", True,
"Include metadata search hints in the generated files")
flags.DEFINE_bool("search_hints", True, "Include metadata search hints in the generated files")

flags.DEFINE_string("site_path", "quark/openfermion/api_docs/python",
"Path prefix in the _toc.yaml")
flags.DEFINE_string(
"site_path", "quark/openfermion/api_docs/python", "Path prefix in the _toc.yaml"
)

FLAGS = flags.FLAGS

Expand All @@ -55,7 +56,8 @@ def main(unused_argv):
# Example:
# "cirq.google.engine.client.quantum.QuantumEngineServiceClient":
# ["enums"]
})
},
)

doc_generator.build(output_dir=FLAGS.output_dir)

Expand Down
Loading
Loading