Skip to content

Commit

Permalink
Working tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Dec 3, 2024
1 parent 1cfe182 commit 62b3d16
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions quam/core/quam_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,12 @@ def print_summary(self, indent: int = 0):
print(" " * (indent + 2) + f"{attr}: {val}")

def set_at_reference(self, attr: str, value: Any):
"""Follow the reference of an attribute and set the value at the reference
Args:
attr: The attribute to set the value at the reference of.
value: The value to set.
"""
raw_value = self.get_unreferenced_value(attr)
if not string_reference.is_reference(raw_value):
raise ValueError(
Expand All @@ -555,8 +561,6 @@ def set_at_reference(self, attr: str, value: Any):
parent_obj = self._get_referenced_value(parent_reference)
setattr(parent_obj, ref_attr, value)

return raw_value


# Type annotation for QuamRoot, can be replaced by typing.Self from Python 3.11
QuamRootType = TypeVar("QuamRootType", bound="QuamRoot")
Expand Down Expand Up @@ -697,8 +701,8 @@ def generate_config(self) -> Dict[str, Any]:

return qua_config

def get_unreferenced_value(self, attr: str):
return getattr(self, attr)
# def get_unreferenced_value(self, attr: str):
# return getattr(self, attr)


class QuamComponent(QuamBase):
Expand Down

0 comments on commit 62b3d16

Please sign in to comment.