Skip to content
Draft
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
3 changes: 2 additions & 1 deletion src/qcodes/instrument/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import sys
import warnings
from collections.abc import Callable, Iterable, Iterator, MutableSequence, Sequence
from functools import cached_property
from typing import TYPE_CHECKING, Any, Generic, Self, cast, overload

from typing_extensions import TypeVar
Expand Down Expand Up @@ -291,7 +292,7 @@ def __add__(self: Self, other: ChannelTuple) -> Self:
def short_name(self) -> str:
return self._name

@property
@cached_property
def full_name(self) -> str:
return "_".join(self.name_parts)

Expand Down
3 changes: 2 additions & 1 deletion src/qcodes/instrument/instrument_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import warnings
from collections.abc import Callable, Mapping, Sequence
from functools import cached_property
from typing import TYPE_CHECKING, Any, ClassVar, cast

import numpy as np
Expand Down Expand Up @@ -596,7 +597,7 @@ def name_parts(self) -> list[str]:
"""
return [self.short_name]

@property
@cached_property
def full_name(self) -> str:
"""
Full name of the instrument.
Expand Down
3 changes: 2 additions & 1 deletion src/qcodes/metadatable/metadatable_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from abc import abstractmethod
from functools import cached_property
from typing import TYPE_CHECKING, Any, final

from qcodes.utils import deep_update
Expand Down Expand Up @@ -79,7 +80,7 @@ def short_name(self) -> str:
Name excluding name of any parent that this object is bound to.
"""

@property
@cached_property
@abstractmethod
def full_name(self) -> str:
"""
Expand Down
3 changes: 2 additions & 1 deletion src/qcodes/parameters/function.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from functools import cached_property
from typing import TYPE_CHECKING, Any

from qcodes.metadatable import MetadatableWithName
Expand Down Expand Up @@ -180,7 +181,7 @@ def short_name(self) -> str:
"""
return self.name

@property
@cached_property
def full_name(self) -> str:
"""
Name of the function including the name of the instrument and
Expand Down
2 changes: 1 addition & 1 deletion src/qcodes/parameters/parameter_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ def short_name(self) -> str:
full name refer to :meth:`full_name`."""
return self._short_name

@property
@cached_property
def full_name(self) -> str:
"""
Name of the parameter including the name of the instrument and
Expand Down
4 changes: 2 additions & 2 deletions tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cProfile
import os
from functools import wraps
from functools import cached_property, wraps
from time import sleep
from typing import TYPE_CHECKING, Any, TypeVar

Expand Down Expand Up @@ -159,6 +159,6 @@ def set(self, value: float) -> float:
def short_name(self) -> str:
return self.name

@property
@cached_property
def full_name(self) -> str:
return self.full_name
Loading