Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow PEP 8 standard #142

Merged
merged 41 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f54cb6a
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Sep 30, 2024
c8bd76c
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 1, 2024
0013578
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 2, 2024
d721149
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 2, 2024
af1bbb6
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 2, 2024
71ae87e
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 8, 2024
55d877f
Refactor code for PEP8 compliance and improved readability
GreshmaShaji Oct 8, 2024
ef22df8
solved lint issue
GreshmaShaji Oct 8, 2024
f755a83
solved lint issue
GreshmaShaji Oct 8, 2024
f5ac683
solved lint issue
GreshmaShaji Oct 8, 2024
9283a98
More changes towards PEP8 standard
Oct 8, 2024
1d9d17a
modified readme file
GreshmaShaji Oct 9, 2024
24b824d
modified readme file
GreshmaShaji Oct 9, 2024
3c57d18
modified readme file
GreshmaShaji Oct 9, 2024
cac5f3c
modified readme file
GreshmaShaji Oct 9, 2024
aac9102
modified readme file
GreshmaShaji Oct 9, 2024
e341097
modified tutorial.rst file
GreshmaShaji Oct 9, 2024
c06f632
modified tutorial.rst file
GreshmaShaji Oct 9, 2024
44e6691
modified tutorial.rst file
GreshmaShaji Oct 10, 2024
32c5e08
modified readme file
GreshmaShaji Oct 10, 2024
bad62a5
Changes towards PEP8 standardization
Oct 11, 2024
81265cf
Changed QML to qml and some minor adjustments
Oct 14, 2024
9fdb7a0
Update moduledb
Oct 14, 2024
92040c1
Autopep8 lint action added
GreshmaShaji Oct 14, 2024
2c277ee
autopep8 lint action added
GreshmaShaji Oct 14, 2024
2773417
autopep8 lint action added
GreshmaShaji Oct 14, 2024
0ba39ec
autopep8 lint action added
GreshmaShaji Oct 14, 2024
012b581
autopep8 lint action added
GreshmaShaji Oct 14, 2024
7a4dfc3
autopep8 lint action added
GreshmaShaji Oct 14, 2024
19c7057
Apply autopep8 formatting
actions-user Oct 14, 2024
e334c51
removed lint issue
GreshmaShaji Oct 14, 2024
95ee518
Apply autopep8 formatting
actions-user Oct 14, 2024
89c6eb7
removed lint issue
GreshmaShaji Oct 14, 2024
e7acde5
removed lint issue
GreshmaShaji Oct 14, 2024
fe93088
removed lint issue
GreshmaShaji Oct 14, 2024
2220c0d
Make intentional PEP8-violating changes to test automatic corrections.
Oct 15, 2024
7d26d42
Apply autopep8 formatting
actions-user Oct 15, 2024
02b30b7
Delete intentional PEP8-violating changes that were not caught by aut…
Oct 15, 2024
8052ed1
modified developer guide code examples according with pep8 standard
GreshmaShaji Oct 15, 2024
bdb43b0
Merge branch 'pep8-standard' of https://atc-github.azure.cloud.bmw/em…
GreshmaShaji Oct 15, 2024
447eedf
modified developer guide code examples according with pep8 standard
GreshmaShaji Oct 15, 2024
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
22 changes: 20 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,26 @@ jobs:
python-version: '3.9.16'
token: ${{ secrets.QUARK_GH_GITHUB_COM_TOKEN }}

- name: Install pylint
run: pip install pylint
- name: Install pylint and autopep8
run: pip install pylint autopep8

- name: Disable Git LFS locking
run: git config lfs.https://github.com/QUARK-framework/QUARK.git/info/lfs.locksverify false

- name: Run autopep8 (fix PEP8 issues automatically)
run: autopep8 --in-place --recursive --aggressive --max-line-length 120 -v .

- name: Commit changes if any
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add .
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Apply autopep8 formatting"
git push origin HEAD:${{ github.ref }}
fi

- name: Run pylint
uses: wearerequired/lint-action@v2
Expand Down
52 changes: 28 additions & 24 deletions .settings/module_db.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"build_number": 13,
"build_date": "25-09-2024 22:08:09",
"git_revision_number": "150c71668c47ab9c98665d485437f6e9c7bb5e5f",
"build_number": 14,
"build_date": "14-10-2024 14:33:46",
"git_revision_number": "81265cfafef1726474dcfc1ed8c6ae04513236dc",
"modules": [
{
"name": "PVC",
Expand Down Expand Up @@ -1841,6 +1841,10 @@
{
"name": "numpy",
"version": "1.26.4"
},
{
"name": "qiskit-algorithms",
"version": "0.3.0"
}
],
"submodules": [
Expand Down Expand Up @@ -2169,13 +2173,13 @@
{
"name": "GenerativeModeling",
"class": "GenerativeModeling",
"module": "modules.applications.QML.generative_modeling.GenerativeModeling",
"module": "modules.applications.qml.generative_modeling.GenerativeModeling",
"submodules": [
{
"name": "Continuous Data",
"class": "ContinuousData",
"args": {},
"module": "modules.applications.QML.generative_modeling.data.data_handler.ContinuousData",
"module": "modules.applications.qml.generative_modeling.data.data_handler.ContinuousData",
"requirements": [
{
"name": "numpy",
Expand All @@ -2187,7 +2191,7 @@
"name": "PIT",
"class": "PIT",
"args": {},
"module": "modules.applications.QML.generative_modeling.transformations.PIT",
"module": "modules.applications.qml.generative_modeling.transformations.PIT",
"requirements": [
{
"name": "numpy",
Expand Down Expand Up @@ -2215,7 +2219,7 @@
"name": "LibraryQiskit",
"class": "LibraryQiskit",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryQiskit",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryQiskit",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2304,7 +2308,7 @@
"name": "LibraryPennylane",
"class": "LibraryPennylane",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryPennylane",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryPennylane",
"requirements": [
{
"name": "pennylane",
Expand Down Expand Up @@ -2405,7 +2409,7 @@
"name": "CustomQiskitNoisyBackend",
"class": "CustomQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.CustomQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.CustomQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2469,7 +2473,7 @@
"name": "PresetQiskitNoisyBackend",
"class": "PresetQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.PresetQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.PresetQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2541,7 +2545,7 @@
"name": "MinMax",
"class": "MinMax",
"args": {},
"module": "modules.applications.QML.generative_modeling.transformations.MinMax",
"module": "modules.applications.qml.generative_modeling.transformations.MinMax",
"requirements": [
{
"name": "numpy",
Expand All @@ -2560,7 +2564,7 @@
"name": "LibraryQiskit",
"class": "LibraryQiskit",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryQiskit",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryQiskit",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2649,7 +2653,7 @@
"name": "LibraryPennylane",
"class": "LibraryPennylane",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryPennylane",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryPennylane",
"requirements": [
{
"name": "pennylane",
Expand Down Expand Up @@ -2750,7 +2754,7 @@
"name": "CustomQiskitNoisyBackend",
"class": "CustomQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.CustomQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.CustomQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2814,7 +2818,7 @@
"name": "PresetQiskitNoisyBackend",
"class": "PresetQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.PresetQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.PresetQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2891,7 +2895,7 @@
"name": "LibraryQiskit",
"class": "LibraryQiskit",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryQiskit",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryQiskit",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -2980,7 +2984,7 @@
"name": "LibraryPennylane",
"class": "LibraryPennylane",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryPennylane",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryPennylane",
"requirements": [
{
"name": "pennylane",
Expand Down Expand Up @@ -3081,7 +3085,7 @@
"name": "CustomQiskitNoisyBackend",
"class": "CustomQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.CustomQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.CustomQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -3145,7 +3149,7 @@
"name": "PresetQiskitNoisyBackend",
"class": "PresetQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.PresetQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.PresetQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -3219,7 +3223,7 @@
"name": "Discrete Data",
"class": "DiscreteData",
"args": {},
"module": "modules.applications.QML.generative_modeling.data.data_handler.DiscreteData",
"module": "modules.applications.qml.generative_modeling.data.data_handler.DiscreteData",
"requirements": [
{
"name": "numpy",
Expand All @@ -3238,7 +3242,7 @@
"name": "LibraryQiskit",
"class": "LibraryQiskit",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryQiskit",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryQiskit",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -3327,7 +3331,7 @@
"name": "LibraryPennylane",
"class": "LibraryPennylane",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.LibraryPennylane",
"module": "modules.applications.qml.generative_modeling.mappings.LibraryPennylane",
"requirements": [
{
"name": "pennylane",
Expand Down Expand Up @@ -3428,7 +3432,7 @@
"name": "CustomQiskitNoisyBackend",
"class": "CustomQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.CustomQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.CustomQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down Expand Up @@ -3492,7 +3496,7 @@
"name": "PresetQiskitNoisyBackend",
"class": "PresetQiskitNoisyBackend",
"args": {},
"module": "modules.applications.QML.generative_modeling.mappings.PresetQiskitNoisyBackend",
"module": "modules.applications.qml.generative_modeling.mappings.PresetQiskitNoisyBackend",
"requirements": [
{
"name": "qiskit",
Expand Down
4 changes: 2 additions & 2 deletions .settings/requirements_full.txt
Git LFS file not shown
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Philipp Ross (BMW Group)
Marvin Erdmann (BMW Group)
Andre Luckow (BMW Group)
Greshma Shaji (BMW Group)
Florian Kiwit (BMW Group)
Jürgen Schwitalla (Eviden)
Chris van den Oetelaar (Capgemini)
Niklas Steinmann (Fraunhofer FOKUS)
66 changes: 48 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# QUARK: A Framework for Quantum Computing Application Benchmarking

Quantum Computing Application Benchmark (QUARK) is a framework for orchestrating benchmarks of different industry applications on quantum computers.
QUARK supports various applications, like the traveling salesperson problem (TSP), the maximum satisfiability (MaxSAT) problem, or the robot path optimization in the PVC sealing use case.
QUARK supports various applications such as the traveling salesperson problem (TSP), the maximum satisfiability (MaxSAT) problem, robot path optimization in the PVC sealing use case
as well as new additions like the Maximum Independent Set (MIS), Set Cover Problem (SCP) and Auto Carrier Loading (ACL).
It also features different solvers (e.g., simulated /quantum annealing and the quantum approximate optimization algorithm (QAOA)), quantum devices (e.g., IonQ and Rigetti), and simulators.
It is designed to be easily extendable in all of its components: applications, mappings, solvers, devices, and any other custom modules.

Expand Down Expand Up @@ -62,6 +63,17 @@ Content of the environment:
In case you want to use custom modules files (for example, to use external modules from other repositories), you can still use the ```--modules``` option.
You can find the documentation in the respective Read the Docs section.

## Git Large File Storage (LFS)
QUARK stores data and config files using **Git LFS**. If you are contributing to this project or cloning this repository, ensure that you have **Git LFS** installed and configured to manage large files effectively.

### Installing Git LFS
Install Git LFS by following the instructions on [Git LFS](https://git-lfs.com/):
- On Linux/macOS
```bash
git lfs install
```
- On Windows. Download and install Git LFS from the [Official page](https://git-lfs.com/)

## Running a Benchmark

```bash
Expand All @@ -84,8 +96,12 @@ Example run (You need to check at least one option with an ``X`` for the checkbo
PVC
SAT
> TSP
ACL
MIS
SCP
GenerativeModeling

2023-03-21 09:18:36,440 [INFO] Import module modules.applications.optimization.TSP.TSP
2024-10-09 15:05:52,610 [INFO] Import module modules.applications.optimization.TSP.TSP
[?] (Option for TSP) How many nodes does you graph need?:
> [X] 3
[ ] 4
Expand All @@ -94,6 +110,7 @@ Example run (You need to check at least one option with an ``X`` for the checkbo
[ ] 10
[ ] 14
[ ] 16
[ ] Custom Range

[?] What submodule do you want?:
[ ] Ising
Expand All @@ -102,25 +119,38 @@ Example run (You need to check at least one option with an ``X`` for the checkbo
[ ] ReverseGreedyClassicalTSP
[ ] RandomTSP

2023-03-21 09:18:49,563 [INFO] Skipping asking for submodule, since only 1 option (Local) is available.
2023-03-21 09:18:49,566 [INFO] Submodule configuration finished
[?] How many repetitions do you want?: 1
2023-03-21 09:18:50,577 [INFO] Import module modules.applications.optimization.TSP.TSP
2023-03-21 09:18:50,948 [INFO] Created Benchmark run directory /Users/user1/QUARK/benchmark_runs/tsp-2023-03-21-09-18-50
2023-03-21 09:18:51,025 [INFO] Codebase is based on revision 075201825fa71c24b5567e1290966081be7dbdc0 and has some uncommitted changes
2023-03-21 09:18:51,026 [INFO] Running backlog item 1/1, Iteration 1/1:
2023-03-21 09:18:51,388 [INFO] Route found:
2024-10-09 15:06:20,897 [INFO] Import module modules.solvers.GreedyClassicalTSP
2024-10-09 15:06:20,933 [INFO] Skipping asking for submodule, since only 1 option (Local) is available.
2024-10-09 15:06:20,933 [INFO] Import module modules.devices.Local
2024-10-09 15:06:20,946 [INFO] Submodule configuration finished
[?] How many repetitions do you want?: 1P
2024-10-09 15:07:11,573 [INFO] Import module modules.applications.optimization.TSP.TSP
2024-10-09 15:07:11,573 [INFO] Import module modules.solvers.GreedyClassicalTSP
2024-10-09 15:07:11,574 [INFO] Import module modules.devices.Local
2024-10-09 15:07:12,194 [INFO] [INFO] Created Benchmark run directory /Users/user1/quark/benchmark_runs/tsp-2024-10-09-15-07-11
2024-10-09 15:07:12,194 [INFO] Codebase is based on revision 1d9d17aad7ddff623ff51f62ca3ec2756621c345 and has no uncommitted changes
2024-10-09 15:07:12,195 [INFO] Running backlog item 1/1, Iteration 1/1:
2024-10-09 15:07:12,386 [INFO] Route found:
Node 0 ->
Node 2 ->
Node 1
2023-03-21 09:18:51,388 [INFO] All 3 nodes got visited
2023-03-21 09:18:51,388 [INFO] Total distance (without return): 727223.0
2023-03-21 09:18:51,388 [INFO] Total distance (including return): 1436368.0
2023-03-21 09:18:51,389 [INFO]
2023-03-21 09:18:51,389 [INFO] ============================================================
2023-03-21 09:18:51,389 [INFO]
2023-03-21 09:18:51,389 [INFO] Saving 1 benchmark records to /Users/user1/QUARK/benchmark_runs/tsp-2023-03-21-09-18-50/results.json
2023-03-21 09:18:51,746 [INFO] Finished creating plots.
2024-10-09 15:07:12,386 [INFO] All 3 nodes got visited
2024-10-09 15:07:12,386 [INFO] Total distance (without return): 727223.0
2024-10-09 15:07:12,386 [INFO] Total distance (including return): 1436368.0
2024-10-09 15:07:12,386 [INFO]
2024-10-09 15:07:12,386 [INFO] ==== Run backlog item 1/1 with 1 iterations - FINISHED:1 ====
2024-10-09 15:07:12,387 [INFO]
2024-10-09 15:07:12,387 [INFO] =============== Run finished ===============
2024-10-09 15:07:12,387 [INFO]
2024-10-09 15:07:12,387 [INFO] ================================================================================
2024-10-09 15:07:12,387 [INFO] ====== Run 1 backlog items with 1 iterations - FINISHED:1
2024-10-09 15:07:12,387 [INFO] ================================================================================
2024-10-09 15:07:12,395 [INFO]
2024-10-09 15:07:12,400 [INFO] Saving 1 benchmark records to /Users/user1/QUARK/benchmark_runs/tsp-2024-10-09-15-07-11/results.json
2024-10-09 15:07:12,942 [INFO] Finished creating plots.
2024-10-09 15:07:12,943 [INFO] ============================================================
2024-10-09 15:07:12,944 [INFO] ==================== QUARK finished! ====================
2024-10-09 15:07:12,944 [INFO] ============================================================

```

Expand Down
2 changes: 1 addition & 1 deletion docs/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Python Example
import json

# Load the results
filename = "benchmark_runs/tsp-2023-03-13-15-31-17/results.json"
filename = "benchmark_runs/tsp-2024-10-09-15-07-11/results.json"
with open(filename) as f:

results = json.load(f)
Loading
Loading