Skip to content

Commit

Permalink
Merge branch 'fix_flux_fit' into fit_flux_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Jan 29, 2024
2 parents 88f801c + 76397f1 commit 44defc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/qibocal/cli/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def fit(path, update):
# dump updated runcard
if platform is not None and update: # pragma: no cover
# cannot test update since dummy may produce wrong values and trigger errors
(path / UPDATED_PLATFORM).mkdir(parents=True, exist_ok=True)
dump_runcard(platform, path / UPDATED_PLATFORM)

# dump json

(path / META).write_text(json.dumps(meta, indent=4))
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,6 @@ def resonator_flux_dependence_fit_bounds(
left_bound, right_bound = qubit_flux_dependence_fit_bounds(
qubit_frequency=qubit_frequency, bias=bias
)
left_bound += [bare_resonator_frequency - 0.5, 0]
right_bound += [bare_resonator_frequency + 0.5, 1]
left_bound += [bare_resonator_frequency * HZ_TO_GHZ - 0.5, 0]
right_bound += [bare_resonator_frequency * HZ_TO_GHZ + 0.5, 1]
return (left_bound, right_bound)
5 changes: 3 additions & 2 deletions tests/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ def test_acquire_command(runcard, backend, platform, tmp_path):
assert results_report.exit_code == 0


@pytest.mark.parametrize("update", ["--update", "--no-update"])
@pytest.mark.parametrize("runcard", generate_runcard_single_protocol(), ids=idfn)
def test_fit_command(runcard, tmp_path):
def test_fit_command(runcard, update, tmp_path):
"""Test fit builder and report generated."""
(tmp_path / SINGLE_ACTION_RUNCARD).write_text(yaml.safe_dump(runcard))
runner = CliRunner()
Expand All @@ -116,7 +117,7 @@ def test_fit_command(runcard, tmp_path):
assert results.exit_code == 0

# perform fit
results_fit = runner.invoke(command, ["fit", str(tmp_path), "--no-update"])
results_fit = runner.invoke(command, ["fit", str(tmp_path), update])

assert not results_fit.exception
assert results_fit.exit_code == 0
Expand Down

0 comments on commit 44defc6

Please sign in to comment.