Skip to content

Commit

Permalink
Made ramps consider ramp rate. Added built in mapping for QumadaDevices.
Browse files Browse the repository at this point in the history
Added some comments.
  • Loading branch information
THuckemann committed May 15, 2024
1 parent 8229ade commit 3473ad6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/qumada/measurement/device_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ def save_to_dict(self, priorize_stored_value=False):
else:
logger.warning(f"Couldn't find value for {terminal_name} {param_name}")
return return_dict

Check warning on line 198 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L197-L198

Added lines #L197 - L198 were not covered by tests

def mapping(self, instrument_parameters: None|dict = None):
if instrument_parameters == None:
instrument_parameters = self.instrument_parameters
if not isinstance(self.station, Station):
raise TypeError("No valid qcodes station found. Make sure you have set the station attribute correctly!")
map_terminals_gui(self.station.components, self.instrument_parameters, instrument_parameters)
self.update_terminal_parameters()

Check warning on line 206 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L200-L206

Added lines #L200 - L206 were not covered by tests


def timetrace(

Check warning on line 209 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L209

Added line #L209 was not covered by tests
self,
Expand Down Expand Up @@ -380,7 +389,7 @@ def __init__(self, name: str, Terminal: Terminal, properties: dict = {}) -> None
self.ramp_rate = self.properties.get("ramp_rate", 0.1)
self.group = self.properties.get("group", None)
self.default_value = None
self.scaling = 1
self.scaling = 1 #Only relevant for setting values. Not taken into account for measurements!
self._instrument_parameter = None
self.locked = False
self._limit_validator = None

Check warning on line 395 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L373-L395

Added lines #L373 - L395 were not covered by tests
Expand Down Expand Up @@ -442,7 +451,7 @@ def instrument_parameter(self):
def instrument_parameter(self, param: Parameter):
if isinstance(param, Parameter) or param == None:
self._instrument_parameter = param
self.set_limits()
self._set_limits()

Check warning on line 454 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L450-L454

Added lines #L450 - L454 were not covered by tests
else:
raise TypeError(f"{param} is not a QCoDeS parameter!")

Check warning on line 456 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L456

Added line #L456 was not covered by tests

Expand Down Expand Up @@ -484,7 +493,9 @@ def _set_limits(self):
self._limit_validator = Numbers(min_value=min(self.limits), max_value=max(self.limits))
param.add_validator(self._limit_validator)

Check warning on line 494 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L491-L494

Added lines #L491 - L494 were not covered by tests

def ramp(self, value, ramp_rate: float = 0.1, ramp_time: float = 5, setpoint_intervall: float = 0.01):
def ramp(self, value, ramp_rate: float|None = None, ramp_time: float = 5, setpoint_intervall: float = 0.01):
if ramp_rate is None:
ramp_rate = self.ramp_rate
ramp_or_set_parameter(

Check warning on line 499 in src/qumada/measurement/device_object.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/device_object.py#L496-L499

Added lines #L496 - L499 were not covered by tests
self.instrument_parameter,
value,
Expand Down

0 comments on commit 3473ad6

Please sign in to comment.