Skip to content

Commit

Permalink
Remove examples/ directory (#13218)
Browse files Browse the repository at this point in the history
* Remove examples/ directory

This commit removes the examples/ directory from Qiskit. At one time in
the past these scripts and qasm files served as a useful example for how
to get started with Qiskit. However the patterns shown in these examples
aren't very relevant anymore and have been superseded by the official
documentation and the numerous tutorials out there now. While these
examples still work as we've been running tests to validate they're
still functional on every commit, there is little value in keeping them
around. This commit removes the examples directory and all the files
contained within. The test_examples unittest module is also removed
since there is nothing left to test anymore.

* Remove other examples usage in Makefile and CONTRIBUTING.md
  • Loading branch information
mtreinish authored Sep 25, 2024
1 parent 6a041ee commit 173a644
Show file tree
Hide file tree
Showing 17 changed files with 16 additions and 748 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,21 +440,21 @@ you can do this faster with the `-n`/`--no-discover` option. For example:

to run a module:
```
tox -epy310 -- -n test.python.test_examples
tox -epy310 -- -n test.python.compiler.test_transpiler
```
or to run the same module by path:

```
tox -epy310 -- -n test/python/test_examples.py
tox -epy310 -- -n test/python/compiler/test_transpiler.py
```
to run a class:

```
tox -epy310 -- -n test.python.test_examples.TestPythonExamples
tox -epy310 -- -n test.python.compiler.test_transpiler.TestTranspile
```
to run a method:
```
tox -epy310 -- -n test.python.test_examples.TestPythonExamples.test_all_examples
tox -epy310 -- -n test.python.compiler.test_transpiler.TestTranspile.test_transpile_non_adjacent_layout
```

Alternatively there is a makefile provided to run tests, however this
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,25 @@ env:
# Ignoring generated ones with .py extension.
lint:
pylint -rn qiskit test tools
tools/verify_headers.py qiskit test tools examples
pylint -rn --disable='invalid-name, missing-module-docstring, redefined-outer-name' examples/python/*.py
tools/verify_headers.py qiskit test tools
tools/find_optional_imports.py
tools/find_stray_release_notes.py

# Only pylint on files that have changed from origin/main. Also parallelize (disables cyclic-import check)
lint-incr:
-git fetch -q https://github.com/Qiskit/qiskit-terra.git :lint_incr_latest
tools/pylint_incr.py -j4 -rn -sn --paths :/qiskit/*.py :/test/*.py :/tools/*.py
tools/pylint_incr.py -j4 -rn -sn --disable='invalid-name, missing-module-docstring, redefined-outer-name' --paths ':(glob,top)examples/python/*.py'
tools/verify_headers.py qiskit test tools examples
tools/verify_headers.py qiskit test tools
tools/find_optional_imports.py

ruff:
ruff qiskit test tools examples setup.py
ruff qiskit test tools setup.py

style:
black --check qiskit test tools examples setup.py
black --check qiskit test tools setup.py

black:
black qiskit test tools examples setup.py
black qiskit test tools setup.py

# Use the -s (starting directory) flag for "unittest discover" is necessary,
# otherwise the QuantumCircuit header will be modified during the discovery.
Expand Down
33 changes: 0 additions & 33 deletions examples/python/circuit_draw.py

This file was deleted.

37 changes: 0 additions & 37 deletions examples/python/commutation_relation.py

This file was deleted.

41 changes: 0 additions & 41 deletions examples/python/ghz.py

This file was deleted.

70 changes: 0 additions & 70 deletions examples/python/initialize.py

This file was deleted.

30 changes: 0 additions & 30 deletions examples/python/load_qasm.py

This file was deleted.

76 changes: 0 additions & 76 deletions examples/python/qft.py

This file was deleted.

Loading

0 comments on commit 173a644

Please sign in to comment.