Commit Graph

6 Commits

Author SHA1 Message Date
Lev Bishop 9cc325e7a4
Pylint tools (#6609)
* Pylint tools

* update tox.ini, makefile, azure pipelines

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-06-22 20:22:31 +00:00
Matthew Treinish 2eee56616d
Switch to using black for code formatting (#6361)
* make compatible with pylint and pycodestyle

* black config

* flake8 compatible config

* Missing newline

* Add black check to CI and dev requirements

This commit updates the CI configuration and local tox configuration to
leverage black instead of pycodestyle. It adds a check job to ci and the
tox lint job so we can quickly check if black has been run. A tox job
named 'black' is added to run black on all the code in the repo.

* Run black on everything

This commit reformats all the code in the qiskit-terra repository to use
black. It changes no functionality in the project and just adjusts the
code formatting to be consistent and automated. If you are looking at
this commit in the git log you can likely safely ignore any diff from
this commit as it is just the result of running '`black' on the repo
and instead you should look at any commits before or after this for
functional changes.

Co-authored-by: Lev S. Bishop <18673315+levbishop@users.noreply.github.com>
2021-05-05 09:53:39 -04:00
Lev Bishop 779fa14d44
Remove coding: utf-8 per PEP 3120 (#4914)
utf-8 has been the default since PEP 3120.
https://www.python.org/dev/peps/pep-3120/

Non trivial edits are to Makefile and verify_headers.py
2020-08-12 08:29:16 -04:00
Thomas Alexander 3e20d3c367
Update configurations to perform serialization/deserialization scalings before initializing class (#4728)
* Add fake backends for Bogota, Montreal, and Toronto

IBM Quantum has added 3 new backends recently: Bogota, Montreal, and
Toronto. This commit creates new fake backends FakeBogota, FakeMontreal,
and FakeToronto from snapshots of the real devices.

* Refactor QobjConfiguration transformations to happen in to_dict and from_dict

* Refactor PulseDefaults transformations to happen in to_dict and from_dict

* Remove conversions from update fake backends scripts.

* Update mock backends. Added ibmq_toronto and ibmq_montreal.

* fix bug in the parametric pulse code.

* Undo from_dict/init changes.

* Do conversion of complex number better.

* Update mock backend files.

* Linting.

* Add conversion tests.

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-07-30 17:59:01 +00:00
Matthew Treinish bf30f3551e
Update fake backend snapshots (#4329)
* Update fake backend snapshots

This commit goes through and updates the snapshots for all the fake
backends. This should fix inconsistencies between the current state of
the backends and what is represented by the fakes prior to this commit.
The json files were generated using the script being added in #4327.

* Fix obvious test failures

* Revert updates to fake melbourne backend

The melbourne device has undergone significant changes since the current
snapshot used for the fake device. This includes the restoration of
previously disabled qubits, which changes the coupling map. This had the
unexpected side effect of breaking several test cases that were
dependent on it having 14 qubits instead of 15. To just simplify things
and not have to update numerous test cases this commit just reverts
melbourne to the previous snapshot.

* Adjust dt units in script and update pulse backends

The auto-update script was incorrectly converting the pulse units to
seconds instead of nano-seconds (which is the expected snapshot value).
This commit corrects that in the script and re-updates the json files
for the pulse backends.

* Fix lint and remove dates from docstrings

* Rollback poughkeepsie updates
2020-04-30 13:20:07 -04:00
Matthew Treinish ecc8783e2c
Fix to_dict() bugs and add script to update fake backends (#4327)
This adds a new script to the tools/ directory to update the json file
snapshots for the fake backends. This should be used in the future
periodically to go in and update the snapshots from the ibmq devices.
In writing this a couple of edge cases were found in the to_dict()
method of the backendproperties and backendconfiguration classes that
needed to be fixed for the script to function. These errors are
corrected at the same time
2020-04-29 07:24:18 -04:00