9.2.5.1. qumada.instrument.mapping.base
- class qumada.instrument.mapping.base.InstrumentMapping(mapping_path, is_triggerable=False)[source]
Bases:
ABC- pulse(parameters, *, setpoints, delay, **kwargs)[source]
Wrapper to apply pulse of arbitrary values
- Return type:
- exception qumada.instrument.mapping.base.MappingError[source]
Bases:
ExceptionException is raised, if an error occured during Mapping.
- qumada.instrument.mapping.base.add_mapping_to_instrument(instrument, *, mapping=None)[source]
Loads instrument mapping from mapping JSON file and adds it as instrument attribute. Alternatively, provide a mapping object, that contains the mapping contents, as well as wrapper functions e.g. for ramps
instr._mapping
- Parameters:
instrument (Instrument) – Instrument, the mapping is added to.
mapping (InstrumentMapping | str) – Either mapping object or path to json file with mapping.
- Return type:
- qumada.instrument.mapping.base.filter_flatten_parameters(node)[source]
Recursively filters objects of Parameter types from data structure, that consists of dicts, lists and Metadatable.
- Parameters:
node (Union[Dict, List, Metadatable]) – Current/starting node in the data structure
- Returns:
Flat dict of parameters
- Return type:
Dict[Any, Parameter]
- qumada.instrument.mapping.base.load_mapped_terminal_parameters(terminal_parameters, station, path)[source]
Loads a concrete mapping, that was previously saved to file. If errors occur, the mapping will continue, and a warning will be logged.
Warning: Existing mapping for terminal parameters are overwritten if they are given in the file!
- Return type:
- qumada.instrument.mapping.base.map_gates_to_instruments(components, gate_parameters, existing_gate_parameters=None, *, metadata=None, map_manually=False)[source]
Maps the gates, that were defined in the MeasurementScript to the instruments, that are initialized in QCoDeS.
- Parameters:
components (Mapping[Any, Metadatable]) – Instruments/Components in QCoDeS
gate_parameters (TerminalParameters) – Gates, as defined in the measurement script
existing_gate_parameters (TerminalParameters | None) – Already existing mapping that is used to automatically create the mapping for already known gates without user input.
metadata (Metadata | None) – If provided, add mapping to the metadata object.
map_manually (bool) – If set to True, don’t try to automatically map parameters to gates. Defaults to False.
- Return type:
- qumada.instrument.mapping.base.save_mapped_terminal_parameters(terminal_parameters, path)[source]
Saves already mapped terminals and components to a json file, so they can be loaded easily for the exact same setup.
The saved JSON-structure is as follows:
{ :rtype:
None- “name_of_parameter”: {
“name_of_terminal”: “qcodes_parameter_full_name”, …
}, “name_of_parameter_2”: {
…
},
}