Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

Fix ignis without optional requirements installed #533

Merged
merged 5 commits into from
Nov 10, 2020
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
26 changes: 26 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,32 @@ jobs:
QISKIT_IN_PARALLEL: TRUE
run: tox -e py
if: runner.os == 'macOS'
tests-no-opt:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really should break the GHA into separate scripts at some point

name: tests-python3.8-no-optional-dependencies
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.8]
os: ["ubuntu-latest"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','constraints.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-tests-
${{ runner.os }}-${{ matrix.python-version }}-pip-
${{ runner.os }}-${{ matrix.python-version }}
- name: Install Deps
run: python -m pip install -U tox setuptools virtualenv wheel
- name: Install and Run Tests
run: tox -e no-opt
windows-tests:
name: tests-python${{ matrix.python-version }}-windows
runs-on: windows-latest
Expand Down
22 changes: 11 additions & 11 deletions qiskit/ignis/mitigation/expval/base_meas_mitigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ def stddev_upper_bound(self, shots: int = 1, qubits: Optional[List[int]] = None)
return gamma / np.sqrt(shots)

def plot_assignment_matrix(self,
qubits: Optional[List[int]] = None,
ax: Optional[plt.axes] = None) -> plt.axes:
qubits=None,
ax=None):
"""Matrix plot of the readout error assignment matrix.

Args:
qubits: Optional, qubits being measured for operator expval.
ax: Optional. Axes object to add plot to.
qubits (list(int)): Optional, qubits being measured for operator expval.
ax (axes): Optional. Axes object to add plot to.

Returns:
plt.axes: the figure axes object.
Expand All @@ -195,13 +195,13 @@ def plot_assignment_matrix(self,
return ax

def plot_mitigation_matrix(self,
qubits: Optional[List[int]] = None,
ax: Optional[plt.axes] = None) -> plt.axes:
qubits=None,
ax=None):
"""Matrix plot of the readout error mitigation matrix.

Args:
qubits: Optional, qubits being measured for operator expval.
ax: Optional. Axes object to add plot to.
qubits (list(int)): Optional, qubits being measured for operator expval.
ax (plt.axes): Optional. Axes object to add plot to.

Returns:
plt.axes: the figure axes object.
Expand Down Expand Up @@ -247,12 +247,12 @@ def _int_to_bitstring(i, num_qubits=None):
return label

@staticmethod
def _plot_axis(mat: np.ndarray, ax: plt.axes) -> plt.axes:
def _plot_axis(mat, ax):
"""Helper function for setting up axes for plots.

Args:
mat: the N-qubit matrix to plot.
ax: Optional. Axes object to add plot to.
mat (np.ndarray): the N-qubit matrix to plot.
ax (plt.axes): Optional. Axes object to add plot to.

Returns:
plt.axes: the figure object and axes object.
Expand Down