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

Added device_setup to Zurich #664

Merged
merged 9 commits into from
Nov 30, 2023
Merged

Added device_setup to Zurich #664

merged 9 commits into from
Nov 30, 2023

Conversation

GabrielePalazzo
Copy link
Contributor

@GabrielePalazzo GabrielePalazzo commented Nov 20, 2023

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (532dce7) 66.07% compared to head (124a749) 66.06%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #664      +/-   ##
==========================================
- Coverage   66.07%   66.06%   -0.01%     
==========================================
  Files          57       57              
  Lines        7826     7819       -7     
==========================================
- Hits         5171     5166       -5     
+ Misses       2655     2653       -2     
Flag Coverage Δ
unittests 66.06% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -288,7 +288,7 @@ class Zurich(Controller):

PortType = ZhPort

def __init__(self, name, descriptor, use_emulation=False, time_of_flight=0.0, smearing=0.0):
def __init__(self, name, descriptor=None, device_setup=None, use_emulation=False, time_of_flight=0.0, smearing=0.0):
Copy link

@ckutlu ckutlu Nov 21, 2023

Choose a reason for hiding this comment

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

suggestion: Instead of adding optional arguments, alternate constructors might make this interface cleaner. I suggest adding two class methods:

@classmethod
def from_descriptor(cls, descriptor: ?, name: str, ...):
    ...
@classmethod
def from_device_setup(cls, device_setup: DeviceSetup, name: str, ...):
    ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, my intention was only to temporarily keep backwards compatibility.
We should probably just drop descriptor from the constructor (removing default None from device_setup), but I'd like to discuss it with @stavros11 and @Jacfomg.

@Jacfomg Jacfomg requested review from Jacfomg and stavros11 November 29, 2023 08:38
@scarrazza scarrazza added this to the Qibolab 0.1.4 milestone Nov 29, 2023
@Jacfomg
Copy link
Contributor

Jacfomg commented Nov 29, 2023

@GabrielePalazzo can you have a look at the last failing test for the serialization ?

@Jacfomg Jacfomg marked this pull request as ready for review November 29, 2023 09:16
@stavros11 stavros11 merged commit 99f1a1a into main Nov 30, 2023
@stavros11 stavros11 deleted the zh_devicesetup branch November 30, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants