Skip to content

Commit

Permalink
Merge pull request #643 from qiboteam/cumulative
Browse files Browse the repository at this point in the history
Remove numba from cumulative
  • Loading branch information
andrea-pasquale authored Nov 29, 2023
2 parents 73ff1eb + c109552 commit 4b28236
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 108 deletions.
94 changes: 2 additions & 92 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ skl2onnx = { version = "^1.14.0", optional = true }
onnxruntime = { version = "^1.14.1", optional = true }
onnx = { version = "^1.13.1", optional = true }
pyyaml = "^6.0"
numba = "^0.57.1"


[tool.poetry.group.test]
Expand Down Expand Up @@ -106,7 +105,6 @@ test-docs = "make -C doc doctest"
[tool.pytest.ini_options]
testpaths = ['tests/']
addopts = ['--cov=qibocal', '--cov-report=xml', '--cov-report=html']
env = ["D:NUMBA_DISABLE_JIT=1"]

[tool.pylint.master]
# extensions not to check
Expand Down
15 changes: 1 addition & 14 deletions src/qibocal/protocols/characterization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import numpy.typing as npt
import pandas as pd
import plotly.graph_objects as go
from numba import njit
from plotly.subplots import make_subplots
from qibolab.qubits import QubitId
from scipy import constants
Expand Down Expand Up @@ -244,23 +243,11 @@ def norm(x_mags):
return (x_mags - np.min(x_mags)) / (np.max(x_mags) - np.min(x_mags))


@njit(["float64[:] (float64[:], float64[:])"], parallel=True, cache=True)
def cumulative(input_data, points):
r"""Evaluates in data the cumulative distribution
function of `points`.
WARNING: `input_data` and `points` should be sorted data.
"""
input_data = np.sort(input_data)
points = np.sort(points)
# data and points sorted
prob = []
app = 0

for val in input_data:
app += np.maximum(np.searchsorted(points[app::], val), 0)
prob.append(float(app))

return np.array(prob)
return np.searchsorted(np.sort(points), np.sort(input_data))


def fit_punchout(data: Data, fit_type: str):
Expand Down

0 comments on commit 4b28236

Please sign in to comment.