hexsha stringlengths 40 40 | repo stringlengths 7 114 | path stringlengths 4 124 | license listlengths 1 9 | language stringclasses 1
value | identifier stringlengths 1 71 | return_type stringlengths 1 749 ⌀ | original_string stringlengths 76 22.7k | original_docstring stringlengths 16 7.61k | docstring stringlengths 16 2.47k | docstring_tokens listlengths 6 477 | code stringlengths 14 10.2k | code_tokens listlengths 6 996 | short_docstring stringlengths 2 644 | short_docstring_tokens listlengths 1 116 | comment listlengths 1 89 | parameters listlengths 0 64 | docstring_params dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
51b8111ffa32d8906f685fdb3d75f1111ebe6d98 | jakeogh/Qcodes | qcodes/instrument_drivers/rigol/DG4000.py | [
"MIT"
] | Python | _upload_data | None | def _upload_data(self, data: Union[Sequence[float], np.ndarray]) -> None:
"""
Upload data to the AWG memory.
data: list, tuple or numpy array containing the datapoints
"""
if 1 <= len(data) <= 16384:
# Convert the input to a comma-separated string
string ... |
Upload data to the AWG memory.
data: list, tuple or numpy array containing the datapoints
| Upload data to the AWG memory.
data: list, tuple or numpy array containing the datapoints | [
"Upload",
"data",
"to",
"the",
"AWG",
"memory",
".",
"data",
":",
"list",
"tuple",
"or",
"numpy",
"array",
"containing",
"the",
"datapoints"
] | def _upload_data(self, data: Union[Sequence[float], np.ndarray]) -> None:
if 1 <= len(data) <= 16384:
string = ','.join(format(f, '.9f') for f in data)
self.write('DATA VOLATILE,' + string)
else:
raise Exception('Data length of ' + str(len(data)) +
... | [
"def",
"_upload_data",
"(",
"self",
",",
"data",
":",
"Union",
"[",
"Sequence",
"[",
"float",
"]",
",",
"np",
".",
"ndarray",
"]",
")",
"->",
"None",
":",
"if",
"1",
"<=",
"len",
"(",
"data",
")",
"<=",
"16384",
":",
"string",
"=",
"','",
".",
... | Upload data to the AWG memory. | [
"Upload",
"data",
"to",
"the",
"AWG",
"memory",
"."
] | [
"\"\"\"\n Upload data to the AWG memory.\n\n data: list, tuple or numpy array containing the datapoints\n \"\"\"",
"# Convert the input to a comma-separated string"
] | [
{
"param": "self",
"type": null
},
{
"param": "data",
"type": "Union[Sequence[float], np.ndarray]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "Union[Sequence[float], np.ndarray]",
"docstring": n... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | _unpacker | Tuple[np.ndarray, np.ndarray, np.ndarray] | def _unpacker(
binaryarray: np.ndarray,
dacbitdepth: int = 14
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
"""
Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does. This can be useful for checking
how the signals are going to be interpreted ... |
Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does. This can be useful for checking
how the signals are going to be interpreted by the instrument.
Args:
binaryarray: A numpy array containing the
packed waveform and markers.
dacb... | Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does. This can be useful for checking
how the signals are going to be interpreted by the instrument. | [
"Unpacks",
"an",
"awg",
"-",
"file",
"integer",
"wave",
"into",
"a",
"waveform",
"and",
"two",
"markers",
"in",
"the",
"same",
"way",
"as",
"the",
"AWG",
"does",
".",
"This",
"can",
"be",
"useful",
"for",
"checking",
"how",
"the",
"signals",
"are",
"go... | def _unpacker(
binaryarray: np.ndarray,
dacbitdepth: int = 14
) -> Tuple[np.ndarray, np.ndarray, np.ndarray]:
wflength = len(binaryarray)
wf = np.zeros(wflength)
m1 = np.zeros(wflength)
m2 = np.zeros(wflength)
for ii, bitnum in enumerate(binaryarray):
bitstring = bin(bitnum)[... | [
"def",
"_unpacker",
"(",
"binaryarray",
":",
"np",
".",
"ndarray",
",",
"dacbitdepth",
":",
"int",
"=",
"14",
")",
"->",
"Tuple",
"[",
"np",
".",
"ndarray",
",",
"np",
".",
"ndarray",
",",
"np",
".",
"ndarray",
"]",
":",
"wflength",
"=",
"len",
"("... | Unpacks an awg-file integer wave into a waveform and two markers
in the same way as the AWG does. | [
"Unpacks",
"an",
"awg",
"-",
"file",
"integer",
"wave",
"into",
"a",
"waveform",
"and",
"two",
"markers",
"in",
"the",
"same",
"way",
"as",
"the",
"AWG",
"does",
"."
] | [
"\"\"\"\n Unpacks an awg-file integer wave into a waveform and two markers\n in the same way as the AWG does. This can be useful for checking\n how the signals are going to be interpreted by the instrument.\n\n Args:\n binaryarray: A numpy array containing the\n packed waveform and mar... | [
{
"param": "binaryarray",
"type": "np.ndarray"
},
{
"param": "dacbitdepth",
"type": "int"
}
] | {
"returns": [
{
"docstring": "The waveform scaled to have values from -1 to 1, marker 1, marker 2.",
"docstring_tokens": [
"The",
"waveform",
"scaled",
"to",
"have",
"values",
"from",
"-",
"1",
"to",
"1",
... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | _unwrap | Union[str, int, Tuple[Any, ...]] | def _unwrap(bites: bytes, fmt: str) -> Union[str, int, Tuple[Any, ...]]:
"""
Helper function for interpreting the bytes from the awg file.
Args:
bites: a bytes object
fmt: the format string (either 's', 'h' or 'd')
"""
value: Union[str, int, Tuple[Any, ...]]
if fmt == 's':
... |
Helper function for interpreting the bytes from the awg file.
Args:
bites: a bytes object
fmt: the format string (either 's', 'h' or 'd')
| Helper function for interpreting the bytes from the awg file. | [
"Helper",
"function",
"for",
"interpreting",
"the",
"bytes",
"from",
"the",
"awg",
"file",
"."
] | def _unwrap(bites: bytes, fmt: str) -> Union[str, int, Tuple[Any, ...]]:
value: Union[str, int, Tuple[Any, ...]]
if fmt == 's':
value = bites[:-1].decode('ascii')
elif fmt == 'ignore':
value = 'Not read'
else:
value = struct.unpack('<'+fmt, bites)
if len(value) == 1:
... | [
"def",
"_unwrap",
"(",
"bites",
":",
"bytes",
",",
"fmt",
":",
"str",
")",
"->",
"Union",
"[",
"str",
",",
"int",
",",
"Tuple",
"[",
"Any",
",",
"...",
"]",
"]",
":",
"value",
":",
"Union",
"[",
"str",
",",
"int",
",",
"Tuple",
"[",
"Any",
",... | Helper function for interpreting the bytes from the awg file. | [
"Helper",
"function",
"for",
"interpreting",
"the",
"bytes",
"from",
"the",
"awg",
"file",
"."
] | [
"\"\"\"\n Helper function for interpreting the bytes from the awg file.\n\n Args:\n bites: a bytes object\n fmt: the format string (either 's', 'h' or 'd')\n\n \"\"\""
] | [
{
"param": "bites",
"type": "bytes"
},
{
"param": "fmt",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bites",
"type": "bytes",
"docstring": "a bytes object",
"docstring_tokens": [
"a",
"bytes",
"object"
],
"default": null,
"is_optional": null
},
{
"identifier": "fmt",
... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | _getendingnumber | Tuple[int, str] | def _getendingnumber(string: str) -> Tuple[int, str]:
"""
Helper function to extract the last number of a string
Args:
string: A .awg field name, like SEQUENCE_JUMP_23
Returns:
The number and the shortened string,
e.g. 'SEQUENCE_JUMP_23' -> (23, 'SEQUENCE_JUMP_')
"""
n... |
Helper function to extract the last number of a string
Args:
string: A .awg field name, like SEQUENCE_JUMP_23
Returns:
The number and the shortened string,
e.g. 'SEQUENCE_JUMP_23' -> (23, 'SEQUENCE_JUMP_')
| Helper function to extract the last number of a string | [
"Helper",
"function",
"to",
"extract",
"the",
"last",
"number",
"of",
"a",
"string"
] | def _getendingnumber(string: str) -> Tuple[int, str]:
num = ''
for char in string[::-1]:
if char.isdigit():
num += char
else:
break
return int(num[::-1]), string[:-len(num)] | [
"def",
"_getendingnumber",
"(",
"string",
":",
"str",
")",
"->",
"Tuple",
"[",
"int",
",",
"str",
"]",
":",
"num",
"=",
"''",
"for",
"char",
"in",
"string",
"[",
":",
":",
"-",
"1",
"]",
":",
"if",
"char",
".",
"isdigit",
"(",
")",
":",
"num",
... | Helper function to extract the last number of a string | [
"Helper",
"function",
"to",
"extract",
"the",
"last",
"number",
"of",
"a",
"string"
] | [
"\"\"\"\n Helper function to extract the last number of a string\n\n Args:\n string: A .awg field name, like SEQUENCE_JUMP_23\n\n Returns:\n The number and the shortened string,\n e.g. 'SEQUENCE_JUMP_23' -> (23, 'SEQUENCE_JUMP_')\n \"\"\""
] | [
{
"param": "string",
"type": "str"
}
] | {
"returns": [
{
"docstring": "The number and the shortened string,\ne.g.",
"docstring_tokens": [
"The",
"number",
"and",
"the",
"shortened",
"string",
"e",
".",
"g",
"."
],
"type": null
}
],
"raises": ... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | _parser1 | Tuple[Dict[str, Union[str, int, Tuple[Any, ...]]], List[List[Any]], List[List[Any]]] | def _parser1(
awgfilepath: str
) -> Tuple[Dict[str, Union[str, int, Tuple[Any, ...]]], List[List[Any]], List[List[Any]]]:
"""
Helper function doing the heavy lifting of reading and understanding the
binary .awg file format.
Args:
awgfilepath: The absolute path of the awg file to read
... |
Helper function doing the heavy lifting of reading and understanding the
binary .awg file format.
Args:
awgfilepath: The absolute path of the awg file to read
Returns:
Tuple of instrument settings (a dict), waveforms (list of lists), sequencer settings (list of lists)
| Helper function doing the heavy lifting of reading and understanding the
binary .awg file format. | [
"Helper",
"function",
"doing",
"the",
"heavy",
"lifting",
"of",
"reading",
"and",
"understanding",
"the",
"binary",
".",
"awg",
"file",
"format",
"."
] | def _parser1(
awgfilepath: str
) -> Tuple[Dict[str, Union[str, int, Tuple[Any, ...]]], List[List[Any]], List[List[Any]]]:
instdict = {}
waveformlist: List[List[Any]] = [[], []]
sequencelist: List[List[Any]] = [[], []]
wfmlen: int
with open(awgfilepath, 'rb') as fid:
while True:
... | [
"def",
"_parser1",
"(",
"awgfilepath",
":",
"str",
")",
"->",
"Tuple",
"[",
"Dict",
"[",
"str",
",",
"Union",
"[",
"str",
",",
"int",
",",
"Tuple",
"[",
"Any",
",",
"...",
"]",
"]",
"]",
",",
"List",
"[",
"List",
"[",
"Any",
"]",
"]",
",",
"L... | Helper function doing the heavy lifting of reading and understanding the
binary .awg file format. | [
"Helper",
"function",
"doing",
"the",
"heavy",
"lifting",
"of",
"reading",
"and",
"understanding",
"the",
"binary",
".",
"awg",
"file",
"format",
"."
] | [
"\"\"\"\n Helper function doing the heavy lifting of reading and understanding the\n binary .awg file format.\n\n Args:\n awgfilepath: The absolute path of the awg file to read\n\n Returns:\n Tuple of instrument settings (a dict), waveforms (list of lists), sequencer settings (list of list... | [
{
"param": "awgfilepath",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Tuple of instrument settings (a dict), waveforms (list of lists), sequencer settings (list of lists)",
"docstring_tokens": [
"Tuple",
"of",
"instrument",
"settings",
"(",
"a",
"dict",
")",
"waveforms... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | _parser2 | Dict[str, Dict[str, np.ndarray]] | def _parser2(waveformlist: List[List[Any]]) -> Dict[str, Dict[str, np.ndarray]]:
"""
Cast the waveformlist from _parser1 into a dict used by _parser3.
Args:
waveformlist: A list of lists of waveforms from ``_parser1``
Returns:
dict: A dictionary with keys waveform name and values for m... |
Cast the waveformlist from _parser1 into a dict used by _parser3.
Args:
waveformlist: A list of lists of waveforms from ``_parser1``
Returns:
dict: A dictionary with keys waveform name and values for marker1,
marker2, and the waveform as np.arrays
| Cast the waveformlist from _parser1 into a dict used by _parser3. | [
"Cast",
"the",
"waveformlist",
"from",
"_parser1",
"into",
"a",
"dict",
"used",
"by",
"_parser3",
"."
] | def _parser2(waveformlist: List[List[Any]]) -> Dict[str, Dict[str, np.ndarray]]:
outdict = {}
for (fieldname, fieldvalue) in zip(waveformlist[0], waveformlist[1]):
if 'NAME' in fieldname:
name = fieldvalue
if 'DATA' in fieldname:
value = _unpacker(fieldvalue)
... | [
"def",
"_parser2",
"(",
"waveformlist",
":",
"List",
"[",
"List",
"[",
"Any",
"]",
"]",
")",
"->",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"np",
".",
"ndarray",
"]",
"]",
":",
"outdict",
"=",
"{",
"}",
"for",
"(",
"fieldname",
",",
"f... | Cast the waveformlist from _parser1 into a dict used by _parser3. | [
"Cast",
"the",
"waveformlist",
"from",
"_parser1",
"into",
"a",
"dict",
"used",
"by",
"_parser3",
"."
] | [
"\"\"\"\n Cast the waveformlist from _parser1 into a dict used by _parser3.\n\n Args:\n waveformlist: A list of lists of waveforms from ``_parser1``\n\n Returns:\n dict: A dictionary with keys waveform name and values for marker1,\n marker2, and the waveform as np.arrays\n \"\"\... | [
{
"param": "waveformlist",
"type": "List[List[Any]]"
}
] | {
"returns": [
{
"docstring": "A dictionary with keys waveform name and values for marker1,\nmarker2, and the waveform as np.arrays",
"docstring_tokens": [
"A",
"dictionary",
"with",
"keys",
"waveform",
"name",
"and",
"values",
"f... |
9f7c3f391e181ef181671dd95982307952ef4b8a | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/AWGFileParser.py | [
"MIT"
] | Python | parse_awg_file | Tuple[_parser3_output, Dict[str, Union[str, int, Tuple[Any, ...]]]] | def parse_awg_file(
awgfilepath: str
) -> Tuple[_parser3_output, Dict[str, Union[str, int, Tuple[Any, ...]]]]:
"""
Parser for a binary .awg file. Returns a tuple matching the call signature
of make_send_and_load_awg_file and a dictionary with instrument settings
NOTE: Build-in waveforms are not... |
Parser for a binary .awg file. Returns a tuple matching the call signature
of make_send_and_load_awg_file and a dictionary with instrument settings
NOTE: Build-in waveforms are not stored in .awg files. Blame tektronix.
Args:
awgfilepath: The absolute path to the awg file
Returns:
... | Parser for a binary .awg file. Returns a tuple matching the call signature
of make_send_and_load_awg_file and a dictionary with instrument settings
Build-in waveforms are not stored in .awg files. Blame tektronix. | [
"Parser",
"for",
"a",
"binary",
".",
"awg",
"file",
".",
"Returns",
"a",
"tuple",
"matching",
"the",
"call",
"signature",
"of",
"make_send_and_load_awg_file",
"and",
"a",
"dictionary",
"with",
"instrument",
"settings",
"Build",
"-",
"in",
"waveforms",
"are",
"... | def parse_awg_file(
awgfilepath: str
) -> Tuple[_parser3_output, Dict[str, Union[str, int, Tuple[Any, ...]]]]:
instdict, waveformlist, sequencelist = _parser1(awgfilepath)
wfmdict = _parser2(waveformlist)
callsigtuple = _parser3(sequencelist, wfmdict)
return callsigtuple, instdict | [
"def",
"parse_awg_file",
"(",
"awgfilepath",
":",
"str",
")",
"->",
"Tuple",
"[",
"_parser3_output",
",",
"Dict",
"[",
"str",
",",
"Union",
"[",
"str",
",",
"int",
",",
"Tuple",
"[",
"Any",
",",
"...",
"]",
"]",
"]",
"]",
":",
"instdict",
",",
"wav... | Parser for a binary .awg file. | [
"Parser",
"for",
"a",
"binary",
".",
"awg",
"file",
"."
] | [
"\"\"\"\n Parser for a binary .awg file. Returns a tuple matching the call signature\n of make_send_and_load_awg_file and a dictionary with instrument settings\n\n NOTE: Build-in waveforms are not stored in .awg files. Blame tektronix.\n\n Args:\n awgfilepath: The absolute path to the awg file\n\... | [
{
"param": "awgfilepath",
"type": "str"
}
] | {
"returns": [
{
"docstring": "A tuple and a dict, where the tuple is\n(wfms, m1s, m2s, nreps, trigs, gotos, jumps, channels)\nand the dict contains all instrument settings from the file",
"docstring_tokens": [
"A",
"tuple",
"and",
"a",
"dict",
"where",
... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | phase_compensation | constants.ADJQuery.Response | def phase_compensation(
self,
mode: Optional[Union[constants.ADJQuery.Mode, int]] = None
) -> constants.ADJQuery.Response:
"""
Performs the MFCMU phase compensation, sets the compensation
data to the KeysightB1500, and returns the execution results.
This meth... |
Performs the MFCMU phase compensation, sets the compensation
data to the KeysightB1500, and returns the execution results.
This method resets the MFCMU. Before executing this method, set the
phase compensation mode to manual by using
``phase_compensation_mode`` parameter, and o... | Performs the MFCMU phase compensation, sets the compensation
data to the KeysightB1500, and returns the execution results.
This method resets the MFCMU. Before executing this method, set the
phase compensation mode to manual by using
``phase_compensation_mode`` parameter, and open the measurement
terminals at the end ... | [
"Performs",
"the",
"MFCMU",
"phase",
"compensation",
"sets",
"the",
"compensation",
"data",
"to",
"the",
"KeysightB1500",
"and",
"returns",
"the",
"execution",
"results",
".",
"This",
"method",
"resets",
"the",
"MFCMU",
".",
"Before",
"executing",
"this",
"metho... | def phase_compensation(
self,
mode: Optional[Union[constants.ADJQuery.Mode, int]] = None
) -> constants.ADJQuery.Response:
with self.root_instrument.timeout.set_to(
self.phase_compensation_timeout):
msg = MessageBuilder().adj_query(chnum=self.channels[0],
... | [
"def",
"phase_compensation",
"(",
"self",
",",
"mode",
":",
"Optional",
"[",
"Union",
"[",
"constants",
".",
"ADJQuery",
".",
"Mode",
",",
"int",
"]",
"]",
"=",
"None",
")",
"->",
"constants",
".",
"ADJQuery",
".",
"Response",
":",
"with",
"self",
".",... | Performs the MFCMU phase compensation, sets the compensation
data to the KeysightB1500, and returns the execution results. | [
"Performs",
"the",
"MFCMU",
"phase",
"compensation",
"sets",
"the",
"compensation",
"data",
"to",
"the",
"KeysightB1500",
"and",
"returns",
"the",
"execution",
"results",
"."
] | [
"\"\"\"\n Performs the MFCMU phase compensation, sets the compensation\n data to the KeysightB1500, and returns the execution results.\n\n This method resets the MFCMU. Before executing this method, set the\n phase compensation mode to manual by using\n ``phase_compensation_mode``... | [
{
"param": "self",
"type": null
},
{
"param": "mode",
"type": "Optional[Union[constants.ADJQuery.Mode, int]]"
}
] | {
"returns": [
{
"docstring": "Status result of performing the phase compensation as\n:class:`.constants.ADJQuery.Response`",
"docstring_tokens": [
"Status",
"result",
"of",
"performing",
"the",
"phase",
"compensation",
"as",
":",... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | abort | None | def abort(self) -> None:
"""
Aborts currently running operation and the subsequent execution.
This does not abort the timeout process. Only when the kernel is
free this command is executed and the further commands are aborted.
"""
msg = MessageBuilder().ab()
self.... |
Aborts currently running operation and the subsequent execution.
This does not abort the timeout process. Only when the kernel is
free this command is executed and the further commands are aborted.
| Aborts currently running operation and the subsequent execution.
This does not abort the timeout process. Only when the kernel is
free this command is executed and the further commands are aborted. | [
"Aborts",
"currently",
"running",
"operation",
"and",
"the",
"subsequent",
"execution",
".",
"This",
"does",
"not",
"abort",
"the",
"timeout",
"process",
".",
"Only",
"when",
"the",
"kernel",
"is",
"free",
"this",
"command",
"is",
"executed",
"and",
"the",
"... | def abort(self) -> None:
msg = MessageBuilder().ab()
self.write(msg.message) | [
"def",
"abort",
"(",
"self",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"ab",
"(",
")",
"self",
".",
"write",
"(",
"msg",
".",
"message",
")"
] | Aborts currently running operation and the subsequent execution. | [
"Aborts",
"currently",
"running",
"operation",
"and",
"the",
"subsequent",
"execution",
"."
] | [
"\"\"\"\n Aborts currently running operation and the subsequent execution.\n This does not abort the timeout process. Only when the kernel is\n free this command is executed and the further commands are aborted.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | enable | None | def enable(self, corr: constants.CalibrationType) -> None:
"""
This command enables the open/short/load correction. Before enabling a
correction, perform the corresponding correction data measurement by
using the :meth:`perform`.
Args:
corr: Depending on the the corr... |
This command enables the open/short/load correction. Before enabling a
correction, perform the corresponding correction data measurement by
using the :meth:`perform`.
Args:
corr: Depending on the the correction you want to perform,
set this to OPEN, SHORT or... | This command enables the open/short/load correction. Before enabling a
correction, perform the corresponding correction data measurement by
using the :meth:`perform`. | [
"This",
"command",
"enables",
"the",
"open",
"/",
"short",
"/",
"load",
"correction",
".",
"Before",
"enabling",
"a",
"correction",
"perform",
"the",
"corresponding",
"correction",
"data",
"measurement",
"by",
"using",
"the",
":",
"meth",
":",
"`",
"perform",
... | def enable(self, corr: constants.CalibrationType) -> None:
msg = MessageBuilder().corrst(chnum=self._chnum,
corr=corr,
state=True)
self.write(msg.message) | [
"def",
"enable",
"(",
"self",
",",
"corr",
":",
"constants",
".",
"CalibrationType",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corrst",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
",",
"corr",
"=",
"corr",
",",
"state",
"=",... | This command enables the open/short/load correction. | [
"This",
"command",
"enables",
"the",
"open",
"/",
"short",
"/",
"load",
"correction",
"."
] | [
"\"\"\"\n This command enables the open/short/load correction. Before enabling a\n correction, perform the corresponding correction data measurement by\n using the :meth:`perform`.\n\n Args:\n corr: Depending on the the correction you want to perform,\n set this... | [
{
"param": "self",
"type": null
},
{
"param": "corr",
"type": "constants.CalibrationType"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "corr",
"type": "constants.CalibrationType",
"docstring": "Depending... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | disable | None | def disable(self, corr: constants.CalibrationType) -> None:
"""
This command disables an open/short/load correction.
Args:
corr: Correction type as in :class:`.constants.CalibrationType`
"""
msg = MessageBuilder().corrst(chnum=self._chnum,
... |
This command disables an open/short/load correction.
Args:
corr: Correction type as in :class:`.constants.CalibrationType`
| This command disables an open/short/load correction. | [
"This",
"command",
"disables",
"an",
"open",
"/",
"short",
"/",
"load",
"correction",
"."
] | def disable(self, corr: constants.CalibrationType) -> None:
msg = MessageBuilder().corrst(chnum=self._chnum,
corr=corr,
state=False)
self.write(msg.message) | [
"def",
"disable",
"(",
"self",
",",
"corr",
":",
"constants",
".",
"CalibrationType",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corrst",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
",",
"corr",
"=",
"corr",
",",
"state",
"="... | This command disables an open/short/load correction. | [
"This",
"command",
"disables",
"an",
"open",
"/",
"short",
"/",
"load",
"correction",
"."
] | [
"\"\"\"\n This command disables an open/short/load correction.\n\n Args:\n corr: Correction type as in :class:`.constants.CalibrationType`\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "corr",
"type": "constants.CalibrationType"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "corr",
"type": "constants.CalibrationType",
"docstring": "Correctio... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | is_enabled | constants.CORRST.Response | def is_enabled(self, corr: constants.CalibrationType
) -> constants.CORRST.Response:
"""
Query instrument to see if a correction of the given type is
enabled.
Args:
corr: Correction type as in :class:`.constants.CalibrationType`
"""
msg = M... |
Query instrument to see if a correction of the given type is
enabled.
Args:
corr: Correction type as in :class:`.constants.CalibrationType`
| Query instrument to see if a correction of the given type is
enabled. | [
"Query",
"instrument",
"to",
"see",
"if",
"a",
"correction",
"of",
"the",
"given",
"type",
"is",
"enabled",
"."
] | def is_enabled(self, corr: constants.CalibrationType
) -> constants.CORRST.Response:
msg = MessageBuilder().corrst_query(chnum=self._chnum, corr=corr)
response = self.ask(msg.message)
return constants.CORRST.Response(int(response)) | [
"def",
"is_enabled",
"(",
"self",
",",
"corr",
":",
"constants",
".",
"CalibrationType",
")",
"->",
"constants",
".",
"CORRST",
".",
"Response",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corrst_query",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
"... | Query instrument to see if a correction of the given type is
enabled. | [
"Query",
"instrument",
"to",
"see",
"if",
"a",
"correction",
"of",
"the",
"given",
"type",
"is",
"enabled",
"."
] | [
"\"\"\"\n Query instrument to see if a correction of the given type is\n enabled.\n\n Args:\n corr: Correction type as in :class:`.constants.CalibrationType`\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "corr",
"type": "constants.CalibrationType"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "corr",
"type": "constants.CalibrationType",
"docstring": "Correctio... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | perform | constants.CORR.Response | def perform(self, corr: constants.CalibrationType
) -> constants.CORR.Response:
"""
Perform Open/Short/Load corrections using this method. Refer to the
example notebook to understand how each of the corrections are
performed.
Before executing this method, set the... |
Perform Open/Short/Load corrections using this method. Refer to the
example notebook to understand how each of the corrections are
performed.
Before executing this method, set the oscillator level of the MFCMU.
If you use the correction standard, execute the
:meth:`set... | Perform Open/Short/Load corrections using this method. Refer to the
example notebook to understand how each of the corrections are
performed.
Before executing this method, set the oscillator level of the MFCMU.
| [
"Perform",
"Open",
"/",
"Short",
"/",
"Load",
"corrections",
"using",
"this",
"method",
".",
"Refer",
"to",
"the",
"example",
"notebook",
"to",
"understand",
"how",
"each",
"of",
"the",
"corrections",
"are",
"performed",
".",
"Before",
"executing",
"this",
"... | def perform(self, corr: constants.CalibrationType
) -> constants.CORR.Response:
msg = MessageBuilder().corr_query(
chnum=self._chnum,
corr=corr
)
response = self.ask(msg.message)
return constants.CORR.Response(int(response)) | [
"def",
"perform",
"(",
"self",
",",
"corr",
":",
"constants",
".",
"CalibrationType",
")",
"->",
"constants",
".",
"CORR",
".",
"Response",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corr_query",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
",",
"... | Perform Open/Short/Load corrections using this method. | [
"Perform",
"Open",
"/",
"Short",
"/",
"Load",
"corrections",
"using",
"this",
"method",
"."
] | [
"\"\"\"\n Perform Open/Short/Load corrections using this method. Refer to the\n example notebook to understand how each of the corrections are\n performed.\n\n Before executing this method, set the oscillator level of the MFCMU.\n\n If you use the correction standard, execute the\... | [
{
"param": "self",
"type": null
},
{
"param": "corr",
"type": "constants.CalibrationType"
}
] | {
"returns": [
{
"docstring": "Status of correction data measurement in the form of\n:class:`.constants.CORR.Response`",
"docstring_tokens": [
"Status",
"of",
"correction",
"data",
"measurement",
"in",
"the",
"form",
"of",
... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | perform_and_enable | str | def perform_and_enable(self, corr: constants.CalibrationType) -> str:
"""
Perform the correction AND enable it. It is equivalent to calling
:meth:`perform` and :meth:`enable` methods sequentially.
Returns:
A human readable string with status of the operation.
"""
... |
Perform the correction AND enable it. It is equivalent to calling
:meth:`perform` and :meth:`enable` methods sequentially.
Returns:
A human readable string with status of the operation.
| Perform the correction AND enable it. It is equivalent to calling | [
"Perform",
"the",
"correction",
"AND",
"enable",
"it",
".",
"It",
"is",
"equivalent",
"to",
"calling"
] | def perform_and_enable(self, corr: constants.CalibrationType) -> str:
correction_status = self.perform(corr=corr)
self.enable(corr=corr)
is_enabled = self.is_enabled(corr=corr)
response_out = f'Correction status {correction_status.name} and ' \
f'Enable {is_enabled... | [
"def",
"perform_and_enable",
"(",
"self",
",",
"corr",
":",
"constants",
".",
"CalibrationType",
")",
"->",
"str",
":",
"correction_status",
"=",
"self",
".",
"perform",
"(",
"corr",
"=",
"corr",
")",
"self",
".",
"enable",
"(",
"corr",
"=",
"corr",
")",... | Perform the correction AND enable it. | [
"Perform",
"the",
"correction",
"AND",
"enable",
"it",
"."
] | [
"\"\"\"\n Perform the correction AND enable it. It is equivalent to calling\n :meth:`perform` and :meth:`enable` methods sequentially.\n\n Returns:\n A human readable string with status of the operation.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "corr",
"type": "constants.CalibrationType"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "corr",
"type": "constants.CalibrationType",
"docstring": null,
... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | clear | None | def clear(self) -> None:
"""
Remove all frequencies in the list for data correction.
"""
self._clear(constants.CLCORR.Mode.CLEAR_ONLY) |
Remove all frequencies in the list for data correction.
| Remove all frequencies in the list for data correction. | [
"Remove",
"all",
"frequencies",
"in",
"the",
"list",
"for",
"data",
"correction",
"."
] | def clear(self) -> None:
self._clear(constants.CLCORR.Mode.CLEAR_ONLY) | [
"def",
"clear",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_clear",
"(",
"constants",
".",
"CLCORR",
".",
"Mode",
".",
"CLEAR_ONLY",
")"
] | Remove all frequencies in the list for data correction. | [
"Remove",
"all",
"frequencies",
"in",
"the",
"list",
"for",
"data",
"correction",
"."
] | [
"\"\"\"\n Remove all frequencies in the list for data correction.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | clear_and_set_default | None | def clear_and_set_default(self) -> None:
"""
Remove all frequencies in the list for data correction AND set the
default frequency list.
For the list of default frequencies, refer to the documentation of
the ``CLCORR`` command in the programming manual.
"""
self._... |
Remove all frequencies in the list for data correction AND set the
default frequency list.
For the list of default frequencies, refer to the documentation of
the ``CLCORR`` command in the programming manual.
| Remove all frequencies in the list for data correction AND set the
default frequency list.
For the list of default frequencies, refer to the documentation of
the ``CLCORR`` command in the programming manual. | [
"Remove",
"all",
"frequencies",
"in",
"the",
"list",
"for",
"data",
"correction",
"AND",
"set",
"the",
"default",
"frequency",
"list",
".",
"For",
"the",
"list",
"of",
"default",
"frequencies",
"refer",
"to",
"the",
"documentation",
"of",
"the",
"`",
"`",
... | def clear_and_set_default(self) -> None:
self._clear(constants.CLCORR.Mode.CLEAR_AND_SET_DEFAULT_FREQ) | [
"def",
"clear_and_set_default",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_clear",
"(",
"constants",
".",
"CLCORR",
".",
"Mode",
".",
"CLEAR_AND_SET_DEFAULT_FREQ",
")"
] | Remove all frequencies in the list for data correction AND set the
default frequency list. | [
"Remove",
"all",
"frequencies",
"in",
"the",
"list",
"for",
"data",
"correction",
"AND",
"set",
"the",
"default",
"frequency",
"list",
"."
] | [
"\"\"\"\n Remove all frequencies in the list for data correction AND set the\n default frequency list.\n\n For the list of default frequencies, refer to the documentation of\n the ``CLCORR`` command in the programming manual.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | add | None | def add(self, freq: float) -> None:
"""
Append MFCMU output frequency for data correction in the list.
The frequency value can be given with a certain resolution as per
Table 4-18 in the programming manual (year 2016).
"""
msg = MessageBuilder().corrl(chnum=self._chnum, ... |
Append MFCMU output frequency for data correction in the list.
The frequency value can be given with a certain resolution as per
Table 4-18 in the programming manual (year 2016).
| Append MFCMU output frequency for data correction in the list.
The frequency value can be given with a certain resolution as per
Table 4-18 in the programming manual (year 2016). | [
"Append",
"MFCMU",
"output",
"frequency",
"for",
"data",
"correction",
"in",
"the",
"list",
".",
"The",
"frequency",
"value",
"can",
"be",
"given",
"with",
"a",
"certain",
"resolution",
"as",
"per",
"Table",
"4",
"-",
"18",
"in",
"the",
"programming",
"man... | def add(self, freq: float) -> None:
msg = MessageBuilder().corrl(chnum=self._chnum, freq=freq)
self.write(msg.message) | [
"def",
"add",
"(",
"self",
",",
"freq",
":",
"float",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corrl",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
",",
"freq",
"=",
"freq",
")",
"self",
".",
"write",
"(",
"msg",
".",
... | Append MFCMU output frequency for data correction in the list. | [
"Append",
"MFCMU",
"output",
"frequency",
"for",
"data",
"correction",
"in",
"the",
"list",
"."
] | [
"\"\"\"\n Append MFCMU output frequency for data correction in the list.\n\n The frequency value can be given with a certain resolution as per\n Table 4-18 in the programming manual (year 2016).\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "freq",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "freq",
"type": "float",
"docstring": null,
"docstring_tokens"... |
ce09a2c844e915a1c1ea8b03ae83741ee4d4bdb8 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1520A.py | [
"MIT"
] | Python | query | float | def query(self, index: Optional[int] = None) -> float:
"""
Query the frequency list for CMU data correction.
If ``index`` is ``None``, the query returns a total number of
frequencies in the list. If ``index`` is given, then the query
returns the frequency value from the list at ... |
Query the frequency list for CMU data correction.
If ``index`` is ``None``, the query returns a total number of
frequencies in the list. If ``index`` is given, then the query
returns the frequency value from the list at that index.
| Query the frequency list for CMU data correction. | [
"Query",
"the",
"frequency",
"list",
"for",
"CMU",
"data",
"correction",
"."
] | def query(self, index: Optional[int] = None) -> float:
msg = MessageBuilder().corrl_query(chnum=self._chnum,
index=index)
response = self.ask(msg.message)
return float(response) | [
"def",
"query",
"(",
"self",
",",
"index",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"float",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"corrl_query",
"(",
"chnum",
"=",
"self",
".",
"_chnum",
",",
"index",
"=",
"index",
")"... | Query the frequency list for CMU data correction. | [
"Query",
"the",
"frequency",
"list",
"for",
"CMU",
"data",
"correction",
"."
] | [
"\"\"\"\n Query the frequency list for CMU data correction.\n\n If ``index`` is ``None``, the query returns a total number of\n frequencies in the list. If ``index`` is given, then the query\n returns the frequency value from the list at that index.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "index",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "index",
"type": "Optional[int]",
"docstring": null,
"docstrin... |
b2891f4c94863d3368fb6c4c1db028b399183396 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/v0.py | [
"MIT"
] | Python | _to_dict | InterDependenciesDict | def _to_dict(self) -> InterDependenciesDict:
"""
Return a dictionary representation of this object instance
"""
return {'paramspecs': tuple(ps._to_dict() for ps in self.paramspecs)} |
Return a dictionary representation of this object instance
| Return a dictionary representation of this object instance | [
"Return",
"a",
"dictionary",
"representation",
"of",
"this",
"object",
"instance"
] | def _to_dict(self) -> InterDependenciesDict:
return {'paramspecs': tuple(ps._to_dict() for ps in self.paramspecs)} | [
"def",
"_to_dict",
"(",
"self",
")",
"->",
"InterDependenciesDict",
":",
"return",
"{",
"'paramspecs'",
":",
"tuple",
"(",
"ps",
".",
"_to_dict",
"(",
")",
"for",
"ps",
"in",
"self",
".",
"paramspecs",
")",
"}"
] | Return a dictionary representation of this object instance | [
"Return",
"a",
"dictionary",
"representation",
"of",
"this",
"object",
"instance"
] | [
"\"\"\"\n Return a dictionary representation of this object instance\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
b2891f4c94863d3368fb6c4c1db028b399183396 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/v0.py | [
"MIT"
] | Python | _from_dict | 'InterDependencies' | def _from_dict(cls, ser: InterDependenciesDict) -> 'InterDependencies':
"""
Create an InterDependencies object from a dictionary
"""
paramspecs = [ParamSpec._from_dict(sps) for sps in ser['paramspecs']]
idp = cls(*paramspecs)
return idp |
Create an InterDependencies object from a dictionary
| Create an InterDependencies object from a dictionary | [
"Create",
"an",
"InterDependencies",
"object",
"from",
"a",
"dictionary"
] | def _from_dict(cls, ser: InterDependenciesDict) -> 'InterDependencies':
paramspecs = [ParamSpec._from_dict(sps) for sps in ser['paramspecs']]
idp = cls(*paramspecs)
return idp | [
"def",
"_from_dict",
"(",
"cls",
",",
"ser",
":",
"InterDependenciesDict",
")",
"->",
"'InterDependencies'",
":",
"paramspecs",
"=",
"[",
"ParamSpec",
".",
"_from_dict",
"(",
"sps",
")",
"for",
"sps",
"in",
"ser",
"[",
"'paramspecs'",
"]",
"]",
"idp",
"=",... | Create an InterDependencies object from a dictionary | [
"Create",
"an",
"InterDependencies",
"object",
"from",
"a",
"dictionary"
] | [
"\"\"\"\n Create an InterDependencies object from a dictionary\n \"\"\""
] | [
{
"param": "cls",
"type": null
},
{
"param": "ser",
"type": "InterDependenciesDict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ser",
"type": "InterDependenciesDict",
"docstring": null,
"doc... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | write | None | def write(self, cmd: str) -> None:
"""
Extend write method from the super to ask for error message each
time a write command is called.
"""
super().write(cmd)
error_message = self.error_message()
if error_message != '+0,"No Error."':
raise RuntimeError... |
Extend write method from the super to ask for error message each
time a write command is called.
| Extend write method from the super to ask for error message each
time a write command is called. | [
"Extend",
"write",
"method",
"from",
"the",
"super",
"to",
"ask",
"for",
"error",
"message",
"each",
"time",
"a",
"write",
"command",
"is",
"called",
"."
] | def write(self, cmd: str) -> None:
super().write(cmd)
error_message = self.error_message()
if error_message != '+0,"No Error."':
raise RuntimeError(f"While setting this parameter received "
f"error: {error_message}") | [
"def",
"write",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"write",
"(",
"cmd",
")",
"error_message",
"=",
"self",
".",
"error_message",
"(",
")",
"if",
"error_message",
"!=",
"'+0,\"No Error.\"'",
":",
"raise"... | Extend write method from the super to ask for error message each
time a write command is called. | [
"Extend",
"write",
"method",
"from",
"the",
"super",
"to",
"ask",
"for",
"error",
"message",
"each",
"time",
"a",
"write",
"command",
"is",
"called",
"."
] | [
"\"\"\"\n Extend write method from the super to ask for error message each\n time a write command is called.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "cmd",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "str",
"docstring": null,
"docstring_tokens": [... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | reset | None | def reset(self) -> None:
"""Performs an instrument reset.
This does not reset error queue!
"""
self.write("*RST") | Performs an instrument reset.
This does not reset error queue!
| Performs an instrument reset.
This does not reset error queue! | [
"Performs",
"an",
"instrument",
"reset",
".",
"This",
"does",
"not",
"reset",
"error",
"queue!"
] | def reset(self) -> None:
self.write("*RST") | [
"def",
"reset",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"\"*RST\"",
")"
] | Performs an instrument reset. | [
"Performs",
"an",
"instrument",
"reset",
"."
] | [
"\"\"\"Performs an instrument reset.\n\n This does not reset error queue!\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | from_model_name | 'B1500Module' | def from_model_name(model: str, slot_nr: int, parent: 'KeysightB1500',
name: Optional[str] = None) -> 'B1500Module':
"""Creates the correct instance of instrument module by model name.
Args:
model: Model name such as 'B1517A'
slot_nr: Slot number of this ... | Creates the correct instance of instrument module by model name.
Args:
model: Model name such as 'B1517A'
slot_nr: Slot number of this module (not channel number)
parent: Reference to B1500 mainframe instance
name: Name of the instrument instance to create. If `N... | Creates the correct instance of instrument module by model name. | [
"Creates",
"the",
"correct",
"instance",
"of",
"instrument",
"module",
"by",
"model",
"name",
"."
] | def from_model_name(model: str, slot_nr: int, parent: 'KeysightB1500',
name: Optional[str] = None) -> 'B1500Module':
if model == "B1511B":
return B1511B(slot_nr=slot_nr, parent=parent, name=name)
elif model == "B1517A":
return B1517A(slot_nr=slot_nr, paren... | [
"def",
"from_model_name",
"(",
"model",
":",
"str",
",",
"slot_nr",
":",
"int",
",",
"parent",
":",
"'KeysightB1500'",
",",
"name",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"'B1500Module'",
":",
"if",
"model",
"==",
"\"B1511B\"",
":",
... | Creates the correct instance of instrument module by model name. | [
"Creates",
"the",
"correct",
"instance",
"of",
"instrument",
"module",
"by",
"model",
"name",
"."
] | [
"\"\"\"Creates the correct instance of instrument module by model name.\n\n Args:\n model: Model name such as 'B1517A'\n slot_nr: Slot number of this module (not channel number)\n parent: Reference to B1500 mainframe instance\n name: Name of the instrument instance... | [
{
"param": "model",
"type": "str"
},
{
"param": "slot_nr",
"type": "int"
},
{
"param": "parent",
"type": "'KeysightB1500'"
},
{
"param": "name",
"type": "Optional[str]"
}
] | {
"returns": [
{
"docstring": "A specific instance of :class:`.B1500Module`",
"docstring_tokens": [
"A",
"specific",
"instance",
"of",
":",
"class",
":",
"`",
".",
"B1500Module",
"`"
],
"type": null
... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | enable_channels | None | def enable_channels(self, channels: Optional[constants.ChannelList] = None
) -> None:
"""Enable specified channels.
If channels is omitted or `None`, then all channels are enabled.
"""
msg = MessageBuilder().cn(channels)
self.write(msg.message) | Enable specified channels.
If channels is omitted or `None`, then all channels are enabled.
| Enable specified channels.
If channels is omitted or `None`, then all channels are enabled. | [
"Enable",
"specified",
"channels",
".",
"If",
"channels",
"is",
"omitted",
"or",
"`",
"None",
"`",
"then",
"all",
"channels",
"are",
"enabled",
"."
] | def enable_channels(self, channels: Optional[constants.ChannelList] = None
) -> None:
msg = MessageBuilder().cn(channels)
self.write(msg.message) | [
"def",
"enable_channels",
"(",
"self",
",",
"channels",
":",
"Optional",
"[",
"constants",
".",
"ChannelList",
"]",
"=",
"None",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"cn",
"(",
"channels",
")",
"self",
".",
"write",
"(",... | Enable specified channels. | [
"Enable",
"specified",
"channels",
"."
] | [
"\"\"\"Enable specified channels.\n\n If channels is omitted or `None`, then all channels are enabled.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "channels",
"type": "Optional[constants.ChannelList]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "channels",
"type": "Optional[constants.ChannelList]",
"docstring": ... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | disable_channels | None | def disable_channels(
self,
channels: Optional[constants.ChannelList] = None
) -> None:
"""Disable specified channels.
If channels is omitted or `None`, then all channels are disabled.
"""
msg = MessageBuilder().cl(channels)
self.write(msg.message) | Disable specified channels.
If channels is omitted or `None`, then all channels are disabled.
| Disable specified channels.
If channels is omitted or `None`, then all channels are disabled. | [
"Disable",
"specified",
"channels",
".",
"If",
"channels",
"is",
"omitted",
"or",
"`",
"None",
"`",
"then",
"all",
"channels",
"are",
"disabled",
"."
] | def disable_channels(
self,
channels: Optional[constants.ChannelList] = None
) -> None:
msg = MessageBuilder().cl(channels)
self.write(msg.message) | [
"def",
"disable_channels",
"(",
"self",
",",
"channels",
":",
"Optional",
"[",
"constants",
".",
"ChannelList",
"]",
"=",
"None",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"cl",
"(",
"channels",
")",
"self",
".",
"write",
"("... | Disable specified channels. | [
"Disable",
"specified",
"channels",
"."
] | [
"\"\"\"Disable specified channels.\n\n If channels is omitted or `None`, then all channels are disabled.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "channels",
"type": "Optional[constants.ChannelList]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "channels",
"type": "Optional[constants.ChannelList]",
"docstring": ... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | use_nplc_for_high_speed_adc | None | def use_nplc_for_high_speed_adc(
self, n: Optional[int] = None) -> None:
"""
Set the high-speed ADC to NPLC mode, with optionally defining number
of averaging samples via argument `n`.
Args:
n: Value that defines the number of averaging samples given by
... |
Set the high-speed ADC to NPLC mode, with optionally defining number
of averaging samples via argument `n`.
Args:
n: Value that defines the number of averaging samples given by
the following formula:
``Number of averaging samples = n / 128``.
... | Set the high-speed ADC to NPLC mode, with optionally defining number
of averaging samples via argument `n`. | [
"Set",
"the",
"high",
"-",
"speed",
"ADC",
"to",
"NPLC",
"mode",
"with",
"optionally",
"defining",
"number",
"of",
"averaging",
"samples",
"via",
"argument",
"`",
"n",
"`",
"."
] | def use_nplc_for_high_speed_adc(
self, n: Optional[int] = None) -> None:
self._setup_integration_time(
adc_type=constants.AIT.Type.HIGH_SPEED,
mode=constants.AIT.Mode.NPLC,
coeff=n
) | [
"def",
"use_nplc_for_high_speed_adc",
"(",
"self",
",",
"n",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"_setup_integration_time",
"(",
"adc_type",
"=",
"constants",
".",
"AIT",
".",
"Type",
".",
"HIGH_SPEED",
",",
... | Set the high-speed ADC to NPLC mode, with optionally defining number
of averaging samples via argument `n`. | [
"Set",
"the",
"high",
"-",
"speed",
"ADC",
"to",
"NPLC",
"mode",
"with",
"optionally",
"defining",
"number",
"of",
"averaging",
"samples",
"via",
"argument",
"`",
"n",
"`",
"."
] | [
"\"\"\"\n Set the high-speed ADC to NPLC mode, with optionally defining number\n of averaging samples via argument `n`.\n\n Args:\n n: Value that defines the number of averaging samples given by\n the following formula:\n\n ``Number of averaging samples ... | [
{
"param": "self",
"type": null
},
{
"param": "n",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": "Optional[int]",
"docstring": "Value that defines the n... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | use_nplc_for_high_resolution_adc | None | def use_nplc_for_high_resolution_adc(
self, n: Optional[int] = None) -> None:
"""
Set the high-resolution ADC to NPLC mode, with optionally defining
the number of PLCs per sample via argument `n`.
Args:
n: Value that defines the integration time given by the
... |
Set the high-resolution ADC to NPLC mode, with optionally defining
the number of PLCs per sample via argument `n`.
Args:
n: Value that defines the integration time given by the
following formula:
``Integration time = n / power line frequency``.
... | Set the high-resolution ADC to NPLC mode, with optionally defining
the number of PLCs per sample via argument `n`. | [
"Set",
"the",
"high",
"-",
"resolution",
"ADC",
"to",
"NPLC",
"mode",
"with",
"optionally",
"defining",
"the",
"number",
"of",
"PLCs",
"per",
"sample",
"via",
"argument",
"`",
"n",
"`",
"."
] | def use_nplc_for_high_resolution_adc(
self, n: Optional[int] = None) -> None:
self._setup_integration_time(
adc_type=constants.AIT.Type.HIGH_RESOLUTION,
mode=constants.AIT.Mode.NPLC,
coeff=n
) | [
"def",
"use_nplc_for_high_resolution_adc",
"(",
"self",
",",
"n",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"_setup_integration_time",
"(",
"adc_type",
"=",
"constants",
".",
"AIT",
".",
"Type",
".",
"HIGH_RESOLUTION... | Set the high-resolution ADC to NPLC mode, with optionally defining
the number of PLCs per sample via argument `n`. | [
"Set",
"the",
"high",
"-",
"resolution",
"ADC",
"to",
"NPLC",
"mode",
"with",
"optionally",
"defining",
"the",
"number",
"of",
"PLCs",
"per",
"sample",
"via",
"argument",
"`",
"n",
"`",
"."
] | [
"\"\"\"\n Set the high-resolution ADC to NPLC mode, with optionally defining\n the number of PLCs per sample via argument `n`.\n\n Args:\n n: Value that defines the integration time given by the\n following formula:\n\n ``Integration time = n / power lin... | [
{
"param": "self",
"type": null
},
{
"param": "n",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": "Optional[int]",
"docstring": "Value that defines the i... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | use_manual_mode_for_high_speed_adc | None | def use_manual_mode_for_high_speed_adc(
self, n: Optional[int] = None) -> None:
"""
Set the high-speed ADC to manual mode, with optionally defining number
of averaging samples via argument `n`.
Use ``n=1`` to disable averaging (``n=None`` uses the default
setting fro... |
Set the high-speed ADC to manual mode, with optionally defining number
of averaging samples via argument `n`.
Use ``n=1`` to disable averaging (``n=None`` uses the default
setting from the instrument which is also ``n=1``).
Args:
n: Number of averaging samples, bet... | Set the high-speed ADC to manual mode, with optionally defining number
of averaging samples via argument `n`.
| [
"Set",
"the",
"high",
"-",
"speed",
"ADC",
"to",
"manual",
"mode",
"with",
"optionally",
"defining",
"number",
"of",
"averaging",
"samples",
"via",
"argument",
"`",
"n",
"`",
"."
] | def use_manual_mode_for_high_speed_adc(
self, n: Optional[int] = None) -> None:
self._setup_integration_time(
adc_type=constants.AIT.Type.HIGH_SPEED,
mode=constants.AIT.Mode.MANUAL,
coeff=n
) | [
"def",
"use_manual_mode_for_high_speed_adc",
"(",
"self",
",",
"n",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"_setup_integration_time",
"(",
"adc_type",
"=",
"constants",
".",
"AIT",
".",
"Type",
".",
"HIGH_SPEED",
... | Set the high-speed ADC to manual mode, with optionally defining number
of averaging samples via argument `n`. | [
"Set",
"the",
"high",
"-",
"speed",
"ADC",
"to",
"manual",
"mode",
"with",
"optionally",
"defining",
"number",
"of",
"averaging",
"samples",
"via",
"argument",
"`",
"n",
"`",
"."
] | [
"\"\"\"\n Set the high-speed ADC to manual mode, with optionally defining number\n of averaging samples via argument `n`.\n\n Use ``n=1`` to disable averaging (``n=None`` uses the default\n setting from the instrument which is also ``n=1``).\n\n Args:\n n: Number of ave... | [
{
"param": "self",
"type": null
},
{
"param": "n",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": "Optional[int]",
"docstring": "Number of averaging samp... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | clear_buffer_of_error_message | None | def clear_buffer_of_error_message(self) -> None:
"""
This method clears the error message stored in buffer when the
error_message command is executed.
"""
msg = MessageBuilder().err_query()
self.write(msg.message) |
This method clears the error message stored in buffer when the
error_message command is executed.
| This method clears the error message stored in buffer when the
error_message command is executed. | [
"This",
"method",
"clears",
"the",
"error",
"message",
"stored",
"in",
"buffer",
"when",
"the",
"error_message",
"command",
"is",
"executed",
"."
] | def clear_buffer_of_error_message(self) -> None:
msg = MessageBuilder().err_query()
self.write(msg.message) | [
"def",
"clear_buffer_of_error_message",
"(",
"self",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"err_query",
"(",
")",
"self",
".",
"write",
"(",
"msg",
".",
"message",
")"
] | This method clears the error message stored in buffer when the
error_message command is executed. | [
"This",
"method",
"clears",
"the",
"error",
"message",
"stored",
"in",
"buffer",
"when",
"the",
"error_message",
"command",
"is",
"executed",
"."
] | [
"\"\"\"\n This method clears the error message stored in buffer when the\n error_message command is executed.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | clear_timer_count | None | def clear_timer_count(self, chnum: Optional[int] = None) -> None:
"""
This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4).
... |
This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4).
Args:
chnum: SMU or MFCMU channel number. Integer express... | This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4). | [
"This",
"command",
"clears",
"the",
"timer",
"count",
".",
"This",
"command",
"is",
"effective",
"for",
"all",
"measurement",
"modes",
"regardless",
"of",
"the",
"TSC",
"setting",
".",
"This",
"command",
"is",
"not",
"effective",
"for",
"the",
"4",
"byte",
... | def clear_timer_count(self, chnum: Optional[int] = None) -> None:
msg = MessageBuilder().tsr(chnum=chnum)
self.write(msg.message) | [
"def",
"clear_timer_count",
"(",
"self",
",",
"chnum",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"tsr",
"(",
"chnum",
"=",
"chnum",
")",
"self",
".",
"write",
"(",
"msg",
"."... | This command clears the timer count. | [
"This",
"command",
"clears",
"the",
"timer",
"count",
"."
] | [
"\"\"\"\n This command clears the timer count. This command is effective for\n all measurement modes, regardless of the TSC setting. This command\n is not effective for the 4 byte binary data output format\n (FMT3 and FMT4).\n\n Args:\n chnum: SMU or MFCMU channel numbe... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Optional[int]",
"docstring": "SMU or MFCMU channel... |
176bec7b6a7269a78b47003bf29d2dda824a0ee2 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_base.py | [
"MIT"
] | Python | enable_smu_filters | None | def enable_smu_filters(
self,
enable_filter: bool,
channels: Optional[constants.ChannelList] = None
) -> None:
"""
This methods sets the connection mode of a SMU filter for each channel.
A filter is mounted on the SMU. It assures clean source output with
... |
This methods sets the connection mode of a SMU filter for each channel.
A filter is mounted on the SMU. It assures clean source output with
no spikes or overshooting. A maximum of ten channels can be set.
Args:
enable_filter : Status of the filter.
False: Di... | This methods sets the connection mode of a SMU filter for each channel.
A filter is mounted on the SMU. It assures clean source output with
no spikes or overshooting. A maximum of ten channels can be set. | [
"This",
"methods",
"sets",
"the",
"connection",
"mode",
"of",
"a",
"SMU",
"filter",
"for",
"each",
"channel",
".",
"A",
"filter",
"is",
"mounted",
"on",
"the",
"SMU",
".",
"It",
"assures",
"clean",
"source",
"output",
"with",
"no",
"spikes",
"or",
"overs... | def enable_smu_filters(
self,
enable_filter: bool,
channels: Optional[constants.ChannelList] = None
) -> None:
self.write(MessageBuilder().fl(enable_filter=enable_filter,
channels=channels).message) | [
"def",
"enable_smu_filters",
"(",
"self",
",",
"enable_filter",
":",
"bool",
",",
"channels",
":",
"Optional",
"[",
"constants",
".",
"ChannelList",
"]",
"=",
"None",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"MessageBuilder",
"(",
")",
".",
"fl... | This methods sets the connection mode of a SMU filter for each channel. | [
"This",
"methods",
"sets",
"the",
"connection",
"mode",
"of",
"a",
"SMU",
"filter",
"for",
"each",
"channel",
"."
] | [
"\"\"\"\n This methods sets the connection mode of a SMU filter for each channel.\n A filter is mounted on the SMU. It assures clean source output with\n no spikes or overshooting. A maximum of ten channels can be set.\n\n Args:\n enable_filter : Status of the filter.\n ... | [
{
"param": "self",
"type": null
},
{
"param": "enable_filter",
"type": "bool"
},
{
"param": "channels",
"type": "Optional[constants.ChannelList]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "enable_filter",
"type": "bool",
"docstring": null,
"docstring... |
8b9939ed54ed192e02247ccafc9f806eb68e927a | jakeogh/Qcodes | qcodes/dataset/database_fix_functions.py | [
"MIT"
] | Python | fix_version_4a_run_description_bug | Dict[str, int] | def fix_version_4a_run_description_bug(conn: ConnectionPlus) -> Dict[str, int]:
"""
Fix function to fix a bug where the RunDescriber accidentally wrote itself
to string using the (new) InterDependencies_ object instead of the (old)
InterDependencies object. After the first call, this function should be
... |
Fix function to fix a bug where the RunDescriber accidentally wrote itself
to string using the (new) InterDependencies_ object instead of the (old)
InterDependencies object. After the first call, this function should be
idempotent.
Args:
conn: the connection to the database
Returns:
... | Fix function to fix a bug where the RunDescriber accidentally wrote itself
to string using the (new) InterDependencies_ object instead of the (old)
InterDependencies object. After the first call, this function should be
idempotent. | [
"Fix",
"function",
"to",
"fix",
"a",
"bug",
"where",
"the",
"RunDescriber",
"accidentally",
"wrote",
"itself",
"to",
"string",
"using",
"the",
"(",
"new",
")",
"InterDependencies_",
"object",
"instead",
"of",
"the",
"(",
"old",
")",
"InterDependencies",
"objec... | def fix_version_4a_run_description_bug(conn: ConnectionPlus) -> Dict[str, int]:
user_version = get_user_version(conn)
if not user_version == 4:
raise RuntimeError('Database of wrong version. Will not apply fix. '
'Expected version 4, found version {user_version}')
no_of_ru... | [
"def",
"fix_version_4a_run_description_bug",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"Dict",
"[",
"str",
",",
"int",
"]",
":",
"user_version",
"=",
"get_user_version",
"(",
"conn",
")",
"if",
"not",
"user_version",
"==",
"4",
":",
"raise",
"RuntimeError... | Fix function to fix a bug where the RunDescriber accidentally wrote itself
to string using the (new) InterDependencies_ object instead of the (old)
InterDependencies object. | [
"Fix",
"function",
"to",
"fix",
"a",
"bug",
"where",
"the",
"RunDescriber",
"accidentally",
"wrote",
"itself",
"to",
"string",
"using",
"the",
"(",
"new",
")",
"InterDependencies_",
"object",
"instead",
"of",
"the",
"(",
"old",
")",
"InterDependencies",
"objec... | [
"\"\"\"\n Fix function to fix a bug where the RunDescriber accidentally wrote itself\n to string using the (new) InterDependencies_ object instead of the (old)\n InterDependencies object. After the first call, this function should be\n idempotent.\n\n\n Args:\n conn: the connection to the data... | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [
{
"docstring": "A dict with the fix results ('runs_inspected', 'runs_fixed')",
"docstring_tokens": [
"A",
"dict",
"with",
"the",
"fix",
"results",
"(",
"'",
"runs_inspected",
"'",
"'",
"runs_... |
8b9939ed54ed192e02247ccafc9f806eb68e927a | jakeogh/Qcodes | qcodes/dataset/database_fix_functions.py | [
"MIT"
] | Python | fix_wrong_run_descriptions | None | def fix_wrong_run_descriptions(conn: ConnectionPlus,
run_ids: Sequence[int]) -> None:
"""
NB: This is a FIX function. Do not use it unless your database has been
diagnosed with the problem that this function fixes.
Overwrite faulty run_descriptions by using information fr... |
NB: This is a FIX function. Do not use it unless your database has been
diagnosed with the problem that this function fixes.
Overwrite faulty run_descriptions by using information from the layouts and
dependencies tables. If a correct description is found for a run, that
run is left untouched.
... | This is a FIX function. Do not use it unless your database has been
diagnosed with the problem that this function fixes.
Overwrite faulty run_descriptions by using information from the layouts and
dependencies tables. If a correct description is found for a run, that
run is left untouched. | [
"This",
"is",
"a",
"FIX",
"function",
".",
"Do",
"not",
"use",
"it",
"unless",
"your",
"database",
"has",
"been",
"diagnosed",
"with",
"the",
"problem",
"that",
"this",
"function",
"fixes",
".",
"Overwrite",
"faulty",
"run_descriptions",
"by",
"using",
"info... | def fix_wrong_run_descriptions(conn: ConnectionPlus,
run_ids: Sequence[int]) -> None:
user_version = get_user_version(conn)
if not user_version == 3:
raise RuntimeError('Database of wrong version. Will not apply fix. '
'Expected version 3, found ... | [
"def",
"fix_wrong_run_descriptions",
"(",
"conn",
":",
"ConnectionPlus",
",",
"run_ids",
":",
"Sequence",
"[",
"int",
"]",
")",
"->",
"None",
":",
"user_version",
"=",
"get_user_version",
"(",
"conn",
")",
"if",
"not",
"user_version",
"==",
"3",
":",
"raise"... | NB: This is a FIX function. | [
"NB",
":",
"This",
"is",
"a",
"FIX",
"function",
"."
] | [
"\"\"\"\n NB: This is a FIX function. Do not use it unless your database has been\n diagnosed with the problem that this function fixes.\n\n Overwrite faulty run_descriptions by using information from the layouts and\n dependencies tables. If a correct description is found for a run, that\n run is le... | [
{
"param": "conn",
"type": "ConnectionPlus"
},
{
"param": "run_ids",
"type": "Sequence[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": "The connection to the database",
"docstring_tokens": [
"The",
"connection",
"to",
"the",
"database"
],
"default": null,
"... |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v0_to_v1 | RunDescriberV1Dict | def v0_to_v1(old: RunDescriberV0Dict) -> RunDescriberV1Dict:
"""
Convert a v0 RunDescriber Dict to a v1 RunDescriber Dict
"""
old_idps = InterDependencies._from_dict(old["interdependencies"])
new_idps_dict = old_to_new(old_idps)._to_dict()
return RunDescriberV1Dict(version=1, interdependencies=n... |
Convert a v0 RunDescriber Dict to a v1 RunDescriber Dict
| Convert a v0 RunDescriber Dict to a v1 RunDescriber Dict | [
"Convert",
"a",
"v0",
"RunDescriber",
"Dict",
"to",
"a",
"v1",
"RunDescriber",
"Dict"
] | def v0_to_v1(old: RunDescriberV0Dict) -> RunDescriberV1Dict:
old_idps = InterDependencies._from_dict(old["interdependencies"])
new_idps_dict = old_to_new(old_idps)._to_dict()
return RunDescriberV1Dict(version=1, interdependencies=new_idps_dict) | [
"def",
"v0_to_v1",
"(",
"old",
":",
"RunDescriberV0Dict",
")",
"->",
"RunDescriberV1Dict",
":",
"old_idps",
"=",
"InterDependencies",
".",
"_from_dict",
"(",
"old",
"[",
"\"interdependencies\"",
"]",
")",
"new_idps_dict",
"=",
"old_to_new",
"(",
"old_idps",
")",
... | Convert a v0 RunDescriber Dict to a v1 RunDescriber Dict | [
"Convert",
"a",
"v0",
"RunDescriber",
"Dict",
"to",
"a",
"v1",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v0 RunDescriber Dict to a v1 RunDescriber Dict\n \"\"\""
] | [
{
"param": "old",
"type": "RunDescriberV0Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "old",
"type": "RunDescriberV0Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v1_to_v2 | RunDescriberV2Dict | def v1_to_v2(old: RunDescriberV1Dict) -> RunDescriberV2Dict:
"""
Convert a v1 RunDescriber Dict to a v2 RunDescriber Dict
"""
interdeps_dict = old['interdependencies']
interdeps_ = InterDependencies_._from_dict(interdeps_dict)
interdepsdict = new_to_old(interdeps_)._to_dict()
return RunDescr... |
Convert a v1 RunDescriber Dict to a v2 RunDescriber Dict
| Convert a v1 RunDescriber Dict to a v2 RunDescriber Dict | [
"Convert",
"a",
"v1",
"RunDescriber",
"Dict",
"to",
"a",
"v2",
"RunDescriber",
"Dict"
] | def v1_to_v2(old: RunDescriberV1Dict) -> RunDescriberV2Dict:
interdeps_dict = old['interdependencies']
interdeps_ = InterDependencies_._from_dict(interdeps_dict)
interdepsdict = new_to_old(interdeps_)._to_dict()
return RunDescriberV2Dict(version=2, interdependencies_=interdeps_dict,
... | [
"def",
"v1_to_v2",
"(",
"old",
":",
"RunDescriberV1Dict",
")",
"->",
"RunDescriberV2Dict",
":",
"interdeps_dict",
"=",
"old",
"[",
"'interdependencies'",
"]",
"interdeps_",
"=",
"InterDependencies_",
".",
"_from_dict",
"(",
"interdeps_dict",
")",
"interdepsdict",
"=... | Convert a v1 RunDescriber Dict to a v2 RunDescriber Dict | [
"Convert",
"a",
"v1",
"RunDescriber",
"Dict",
"to",
"a",
"v2",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v1 RunDescriber Dict to a v2 RunDescriber Dict\n \"\"\""
] | [
{
"param": "old",
"type": "RunDescriberV1Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "old",
"type": "RunDescriberV1Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v0_to_v2 | RunDescriberV2Dict | def v0_to_v2(old: RunDescriberV0Dict) -> RunDescriberV2Dict:
"""
Convert a v0 RunDescriber Dict to a v2 RunDescriber Dict
"""
return v1_to_v2(v0_to_v1(old)) |
Convert a v0 RunDescriber Dict to a v2 RunDescriber Dict
| Convert a v0 RunDescriber Dict to a v2 RunDescriber Dict | [
"Convert",
"a",
"v0",
"RunDescriber",
"Dict",
"to",
"a",
"v2",
"RunDescriber",
"Dict"
] | def v0_to_v2(old: RunDescriberV0Dict) -> RunDescriberV2Dict:
return v1_to_v2(v0_to_v1(old)) | [
"def",
"v0_to_v2",
"(",
"old",
":",
"RunDescriberV0Dict",
")",
"->",
"RunDescriberV2Dict",
":",
"return",
"v1_to_v2",
"(",
"v0_to_v1",
"(",
"old",
")",
")"
] | Convert a v0 RunDescriber Dict to a v2 RunDescriber Dict | [
"Convert",
"a",
"v0",
"RunDescriber",
"Dict",
"to",
"a",
"v2",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v0 RunDescriber Dict to a v2 RunDescriber Dict\n \"\"\""
] | [
{
"param": "old",
"type": "RunDescriberV0Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "old",
"type": "RunDescriberV0Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v2_to_v1 | RunDescriberV1Dict | def v2_to_v1(new: RunDescriberV2Dict) -> RunDescriberV1Dict:
"""
Convert a v2 RunDescriber Dict to a v1 RunDescriber Dict
"""
rundescriberdictv1 = RunDescriberV1Dict(
version=1,
interdependencies=new['interdependencies_']
)
return rundescriberdictv1 |
Convert a v2 RunDescriber Dict to a v1 RunDescriber Dict
| Convert a v2 RunDescriber Dict to a v1 RunDescriber Dict | [
"Convert",
"a",
"v2",
"RunDescriber",
"Dict",
"to",
"a",
"v1",
"RunDescriber",
"Dict"
] | def v2_to_v1(new: RunDescriberV2Dict) -> RunDescriberV1Dict:
rundescriberdictv1 = RunDescriberV1Dict(
version=1,
interdependencies=new['interdependencies_']
)
return rundescriberdictv1 | [
"def",
"v2_to_v1",
"(",
"new",
":",
"RunDescriberV2Dict",
")",
"->",
"RunDescriberV1Dict",
":",
"rundescriberdictv1",
"=",
"RunDescriberV1Dict",
"(",
"version",
"=",
"1",
",",
"interdependencies",
"=",
"new",
"[",
"'interdependencies_'",
"]",
")",
"return",
"runde... | Convert a v2 RunDescriber Dict to a v1 RunDescriber Dict | [
"Convert",
"a",
"v2",
"RunDescriber",
"Dict",
"to",
"a",
"v1",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v2 RunDescriber Dict to a v1 RunDescriber Dict\n \"\"\""
] | [
{
"param": "new",
"type": "RunDescriberV2Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "new",
"type": "RunDescriberV2Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v1_to_v0 | RunDescriberV0Dict | def v1_to_v0(new: RunDescriberV1Dict) -> RunDescriberV0Dict:
"""
Convert a v1 RunDescriber Dict to a v0 RunDescriber Dict
"""
interdeps_dict = new['interdependencies']
interdeps_ = InterDependencies_._from_dict(interdeps_dict)
interdepsdict = new_to_old(interdeps_)._to_dict()
rundescriberv0d... |
Convert a v1 RunDescriber Dict to a v0 RunDescriber Dict
| Convert a v1 RunDescriber Dict to a v0 RunDescriber Dict | [
"Convert",
"a",
"v1",
"RunDescriber",
"Dict",
"to",
"a",
"v0",
"RunDescriber",
"Dict"
] | def v1_to_v0(new: RunDescriberV1Dict) -> RunDescriberV0Dict:
interdeps_dict = new['interdependencies']
interdeps_ = InterDependencies_._from_dict(interdeps_dict)
interdepsdict = new_to_old(interdeps_)._to_dict()
rundescriberv0dict = RunDescriberV0Dict(version=0,
... | [
"def",
"v1_to_v0",
"(",
"new",
":",
"RunDescriberV1Dict",
")",
"->",
"RunDescriberV0Dict",
":",
"interdeps_dict",
"=",
"new",
"[",
"'interdependencies'",
"]",
"interdeps_",
"=",
"InterDependencies_",
".",
"_from_dict",
"(",
"interdeps_dict",
")",
"interdepsdict",
"=... | Convert a v1 RunDescriber Dict to a v0 RunDescriber Dict | [
"Convert",
"a",
"v1",
"RunDescriber",
"Dict",
"to",
"a",
"v0",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v1 RunDescriber Dict to a v0 RunDescriber Dict\n \"\"\""
] | [
{
"param": "new",
"type": "RunDescriberV1Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "new",
"type": "RunDescriberV1Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
e16f8656d0a49a88d5c4da6156e4943cbc142ed6 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/converters.py | [
"MIT"
] | Python | v2_to_v0 | RunDescriberV0Dict | def v2_to_v0(new: RunDescriberV2Dict) -> RunDescriberV0Dict:
"""
Convert a v2 RunDescriber Dict to a v0 RunDescriber Dict
"""
return v1_to_v0(v2_to_v1(new)) |
Convert a v2 RunDescriber Dict to a v0 RunDescriber Dict
| Convert a v2 RunDescriber Dict to a v0 RunDescriber Dict | [
"Convert",
"a",
"v2",
"RunDescriber",
"Dict",
"to",
"a",
"v0",
"RunDescriber",
"Dict"
] | def v2_to_v0(new: RunDescriberV2Dict) -> RunDescriberV0Dict:
return v1_to_v0(v2_to_v1(new)) | [
"def",
"v2_to_v0",
"(",
"new",
":",
"RunDescriberV2Dict",
")",
"->",
"RunDescriberV0Dict",
":",
"return",
"v1_to_v0",
"(",
"v2_to_v1",
"(",
"new",
")",
")"
] | Convert a v2 RunDescriber Dict to a v0 RunDescriber Dict | [
"Convert",
"a",
"v2",
"RunDescriber",
"Dict",
"to",
"a",
"v0",
"RunDescriber",
"Dict"
] | [
"\"\"\"\n Convert a v2 RunDescriber Dict to a v0 RunDescriber Dict\n \"\"\""
] | [
{
"param": "new",
"type": "RunDescriberV2Dict"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "new",
"type": "RunDescriberV2Dict",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | upgrader | TUpgraderFunction | def upgrader(func: TUpgraderFunction) -> TUpgraderFunction:
"""
Decorator for database version upgrade functions. An upgrade function
must have the name `perform_db_upgrade_N_to_M` where N = M-1. For
simplicity, an upgrade function must take a single argument of type
`ConnectionPlus`. The upgrade fu... |
Decorator for database version upgrade functions. An upgrade function
must have the name `perform_db_upgrade_N_to_M` where N = M-1. For
simplicity, an upgrade function must take a single argument of type
`ConnectionPlus`. The upgrade function must either perform the upgrade
and return (no return va... | Decorator for database version upgrade functions. An upgrade function
must have the name `perform_db_upgrade_N_to_M` where N = M-1. For
simplicity, an upgrade function must take a single argument of type
`ConnectionPlus`. The upgrade function must either perform the upgrade
and return (no return values allowed) or fail... | [
"Decorator",
"for",
"database",
"version",
"upgrade",
"functions",
".",
"An",
"upgrade",
"function",
"must",
"have",
"the",
"name",
"`",
"perform_db_upgrade_N_to_M",
"`",
"where",
"N",
"=",
"M",
"-",
"1",
".",
"For",
"simplicity",
"an",
"upgrade",
"function",
... | def upgrader(func: TUpgraderFunction) -> TUpgraderFunction:
name_comps = func.__name__.split('_')
if not len(name_comps) == 6:
raise NameError('Decorated function not a valid upgrader. '
'Must have name "perform_db_upgrade_N_to_M"')
if not ''.join(name_comps[:3]+[name_comps[4... | [
"def",
"upgrader",
"(",
"func",
":",
"TUpgraderFunction",
")",
"->",
"TUpgraderFunction",
":",
"name_comps",
"=",
"func",
".",
"__name__",
".",
"split",
"(",
"'_'",
")",
"if",
"not",
"len",
"(",
"name_comps",
")",
"==",
"6",
":",
"raise",
"NameError",
"(... | Decorator for database version upgrade functions. | [
"Decorator",
"for",
"database",
"version",
"upgrade",
"functions",
"."
] | [
"\"\"\"\n Decorator for database version upgrade functions. An upgrade function\n must have the name `perform_db_upgrade_N_to_M` where N = M-1. For\n simplicity, an upgrade function must take a single argument of type\n `ConnectionPlus`. The upgrade function must either perform the upgrade\n and retu... | [
{
"param": "func",
"type": "TUpgraderFunction"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "func",
"type": "TUpgraderFunction",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade | None | def perform_db_upgrade(conn: ConnectionPlus, version: int = -1) -> None:
"""
This is intended to perform all upgrades as needed to bring the
db from version 0 to the most current version (or the version specified).
All the perform_db_upgrade_X_to_Y functions must raise if they cannot
upgrade and be ... |
This is intended to perform all upgrades as needed to bring the
db from version 0 to the most current version (or the version specified).
All the perform_db_upgrade_X_to_Y functions must raise if they cannot
upgrade and be a NOOP if the current version is higher than their target.
Args:
co... | This is intended to perform all upgrades as needed to bring the
db from version 0 to the most current version (or the version specified).
All the perform_db_upgrade_X_to_Y functions must raise if they cannot
upgrade and be a NOOP if the current version is higher than their target. | [
"This",
"is",
"intended",
"to",
"perform",
"all",
"upgrades",
"as",
"needed",
"to",
"bring",
"the",
"db",
"from",
"version",
"0",
"to",
"the",
"most",
"current",
"version",
"(",
"or",
"the",
"version",
"specified",
")",
".",
"All",
"the",
"perform_db_upgra... | def perform_db_upgrade(conn: ConnectionPlus, version: int = -1) -> None:
version = _latest_available_version() if version == -1 else version
current_version = get_user_version(conn)
if current_version < version:
log.info("Commencing database upgrade")
for target_version in sorted(_UPGRADE_AC... | [
"def",
"perform_db_upgrade",
"(",
"conn",
":",
"ConnectionPlus",
",",
"version",
":",
"int",
"=",
"-",
"1",
")",
"->",
"None",
":",
"version",
"=",
"_latest_available_version",
"(",
")",
"if",
"version",
"==",
"-",
"1",
"else",
"version",
"current_version",
... | This is intended to perform all upgrades as needed to bring the
db from version 0 to the most current version (or the version specified). | [
"This",
"is",
"intended",
"to",
"perform",
"all",
"upgrades",
"as",
"needed",
"to",
"bring",
"the",
"db",
"from",
"version",
"0",
"to",
"the",
"most",
"current",
"version",
"(",
"or",
"the",
"version",
"specified",
")",
"."
] | [
"\"\"\"\n This is intended to perform all upgrades as needed to bring the\n db from version 0 to the most current version (or the version specified).\n All the perform_db_upgrade_X_to_Y functions must raise if they cannot\n upgrade and be a NOOP if the current version is higher than their target.\n\n ... | [
{
"param": "conn",
"type": "ConnectionPlus"
},
{
"param": "version",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": "object for connection to the database",
"docstring_tokens": [
"object",
"for",
"connection",
"to",
"the",
"database"
],
... |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_0_to_1 | None | def perform_db_upgrade_0_to_1(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 0 to version 1
Add a GUID column to the runs table and assign guids for all existing runs
"""
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(con... |
Perform the upgrade from version 0 to version 1
Add a GUID column to the runs table and assign guids for all existing runs
| Perform the upgrade from version 0 to version 1
Add a GUID column to the runs table and assign guids for all existing runs | [
"Perform",
"the",
"upgrade",
"from",
"version",
"0",
"to",
"version",
"1",
"Add",
"a",
"GUID",
"column",
"to",
"the",
"runs",
"table",
"and",
"assign",
"guids",
"for",
"all",
"existing",
"runs"
] | def perform_db_upgrade_0_to_1(conn: ConnectionPlus) -> None:
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
n_run_tables = len(cur.fetchall())
if n_run_tables == 1:
with atomic(conn) as conn:
sql = "ALTER TABLE runs ADD C... | [
"def",
"perform_db_upgrade_0_to_1",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"sql",
"=",
"\"SELECT name FROM sqlite_master WHERE type='table' AND name='runs'\"",
"cur",
"=",
"atomic_transaction",
"(",
"conn",
",",
"sql",
")",
"n_run_tables",
"=",
"len... | Perform the upgrade from version 0 to version 1
Add a GUID column to the runs table and assign guids for all existing runs | [
"Perform",
"the",
"upgrade",
"from",
"version",
"0",
"to",
"version",
"1",
"Add",
"a",
"GUID",
"column",
"to",
"the",
"runs",
"table",
"and",
"assign",
"guids",
"for",
"all",
"existing",
"runs"
] | [
"\"\"\"\n Perform the upgrade from version 0 to version 1\n\n Add a GUID column to the runs table and assign guids for all existing runs\n \"\"\"",
"# now assign GUIDs to existing runs",
"# 'deafcafe'"
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_1_to_2 | None | def perform_db_upgrade_1_to_2(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 1 to version 2
Add two indeces on the runs table, one for exp_id and one for GUID
"""
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
... |
Perform the upgrade from version 1 to version 2
Add two indeces on the runs table, one for exp_id and one for GUID
| Perform the upgrade from version 1 to version 2
Add two indeces on the runs table, one for exp_id and one for GUID | [
"Perform",
"the",
"upgrade",
"from",
"version",
"1",
"to",
"version",
"2",
"Add",
"two",
"indeces",
"on",
"the",
"runs",
"table",
"one",
"for",
"exp_id",
"and",
"one",
"for",
"GUID"
] | def perform_db_upgrade_1_to_2(conn: ConnectionPlus) -> None:
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
n_run_tables = len(cur.fetchall())
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description("Upgrading database; v1 -> v2")
... | [
"def",
"perform_db_upgrade_1_to_2",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"sql",
"=",
"\"SELECT name FROM sqlite_master WHERE type='table' AND name='runs'\"",
"cur",
"=",
"atomic_transaction",
"(",
"conn",
",",
"sql",
")",
"n_run_tables",
"=",
"len... | Perform the upgrade from version 1 to version 2
Add two indeces on the runs table, one for exp_id and one for GUID | [
"Perform",
"the",
"upgrade",
"from",
"version",
"1",
"to",
"version",
"2",
"Add",
"two",
"indeces",
"on",
"the",
"runs",
"table",
"one",
"for",
"exp_id",
"and",
"one",
"for",
"GUID"
] | [
"\"\"\"\n Perform the upgrade from version 1 to version 2\n\n Add two indeces on the runs table, one for exp_id and one for GUID\n \"\"\"",
"# iterate through the pbar for the sake of the side effect; it",
"# prints that the database is being upgraded"
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_2_to_3 | None | def perform_db_upgrade_2_to_3(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json outp... |
Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object
| Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object | [
"Perform",
"the",
"upgrade",
"from",
"version",
"2",
"to",
"version",
"3",
"Insert",
"a",
"new",
"column",
"run_description",
"to",
"the",
"runs",
"table",
"and",
"fill",
"it",
"out",
"for",
"exisitng",
"runs",
"with",
"information",
"retrieved",
"from",
"th... | def perform_db_upgrade_2_to_3(conn: ConnectionPlus) -> None:
from qcodes.dataset.sqlite.db_upgrades.upgrade_2_to_3 import upgrade_2_to_3
upgrade_2_to_3(conn) | [
"def",
"perform_db_upgrade_2_to_3",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"from",
"qcodes",
".",
"dataset",
".",
"sqlite",
".",
"db_upgrades",
".",
"upgrade_2_to_3",
"import",
"upgrade_2_to_3",
"upgrade_2_to_3",
"(",
"conn",
")"
] | Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object | [
"Perform",
"the",
"upgrade",
"from",
"version",
"2",
"to",
"version",
"3",
"Insert",
"a",
"new",
"column",
"run_description",
"to",
"the",
"runs",
"table",
"and",
"fill",
"it",
"out",
"for",
"exisitng",
"runs",
"with",
"information",
"retrieved",
"from",
"th... | [
"\"\"\"\n Perform the upgrade from version 2 to version 3\n\n Insert a new column, run_description, to the runs table and fill it out\n for exisitng runs with information retrieved from the layouts and\n dependencies tables represented as the json output of a RunDescriber\n object\n \"\"\""
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_3_to_4 | None | def perform_db_upgrade_3_to_4(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 3 to version 4. This really
repeats the version 3 upgrade as it originally had two bugs in
the inferred annotation. inferred_from was passed incorrectly
resulting in the parameter being marked inferred_... |
Perform the upgrade from version 3 to version 4. This really
repeats the version 3 upgrade as it originally had two bugs in
the inferred annotation. inferred_from was passed incorrectly
resulting in the parameter being marked inferred_from for each char
in the inferred_from variable and inferred_fr... | Perform the upgrade from version 3 to version 4. This really
repeats the version 3 upgrade as it originally had two bugs in
the inferred annotation. inferred_from was passed incorrectly
resulting in the parameter being marked inferred_from for each char
in the inferred_from variable and inferred_from was not handled
co... | [
"Perform",
"the",
"upgrade",
"from",
"version",
"3",
"to",
"version",
"4",
".",
"This",
"really",
"repeats",
"the",
"version",
"3",
"upgrade",
"as",
"it",
"originally",
"had",
"two",
"bugs",
"in",
"the",
"inferred",
"annotation",
".",
"inferred_from",
"was",... | def perform_db_upgrade_3_to_4(conn: ConnectionPlus) -> None:
from qcodes.dataset.sqlite.db_upgrades.upgrade_3_to_4 import upgrade_3_to_4
upgrade_3_to_4(conn) | [
"def",
"perform_db_upgrade_3_to_4",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"from",
"qcodes",
".",
"dataset",
".",
"sqlite",
".",
"db_upgrades",
".",
"upgrade_3_to_4",
"import",
"upgrade_3_to_4",
"upgrade_3_to_4",
"(",
"conn",
")"
] | Perform the upgrade from version 3 to version 4. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"3",
"to",
"version",
"4",
"."
] | [
"\"\"\"\n Perform the upgrade from version 3 to version 4. This really\n repeats the version 3 upgrade as it originally had two bugs in\n the inferred annotation. inferred_from was passed incorrectly\n resulting in the parameter being marked inferred_from for each char\n in the inferred_from variable... | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_4_to_5 | None | def perform_db_upgrade_4_to_5(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 4 to version 5.
Make sure that 'snapshot' column always exists in the 'runs' table. This
was not the case before because 'snapshot' was treated as 'metadata',
hence the 'snapshot' column was dynamicall... |
Perform the upgrade from version 4 to version 5.
Make sure that 'snapshot' column always exists in the 'runs' table. This
was not the case before because 'snapshot' was treated as 'metadata',
hence the 'snapshot' column was dynamically created once there was a run
with snapshot information.
| Perform the upgrade from version 4 to version 5.
Make sure that 'snapshot' column always exists in the 'runs' table. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"4",
"to",
"version",
"5",
".",
"Make",
"sure",
"that",
"'",
"snapshot",
"'",
"column",
"always",
"exists",
"in",
"the",
"'",
"runs",
"'",
"table",
"."
] | def perform_db_upgrade_4_to_5(conn: ConnectionPlus) -> None:
with atomic(conn) as conn:
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description("Upgrading database; v4 -> v5")
for _ in pbar:
insert_column(conn, 'runs', 'snapshot', 'TEXT') | [
"def",
"perform_db_upgrade_4_to_5",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"with",
"atomic",
"(",
"conn",
")",
"as",
"conn",
":",
"pbar",
"=",
"tqdm",
"(",
"range",
"(",
"1",
")",
",",
"file",
"=",
"sys",
".",
"stdout",
")",
"pba... | Perform the upgrade from version 4 to version 5. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"4",
"to",
"version",
"5",
"."
] | [
"\"\"\"\n Perform the upgrade from version 4 to version 5.\n\n Make sure that 'snapshot' column always exists in the 'runs' table. This\n was not the case before because 'snapshot' was treated as 'metadata',\n hence the 'snapshot' column was dynamically created once there was a run\n with snapshot in... | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_5_to_6 | None | def perform_db_upgrade_5_to_6(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 5 to version 6.
The upgrade ensures that the runs_description has a top-level entry
called 'version'. Note that version changes of the runs_description will
not be tracked as schema upgrades.
"""
... |
Perform the upgrade from version 5 to version 6.
The upgrade ensures that the runs_description has a top-level entry
called 'version'. Note that version changes of the runs_description will
not be tracked as schema upgrades.
| Perform the upgrade from version 5 to version 6.
The upgrade ensures that the runs_description has a top-level entry
called 'version'. Note that version changes of the runs_description will
not be tracked as schema upgrades. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"5",
"to",
"version",
"6",
".",
"The",
"upgrade",
"ensures",
"that",
"the",
"runs_description",
"has",
"a",
"top",
"-",
"level",
"entry",
"called",
"'",
"version",
"'",
".",
"Note",
"that",
"version",
"change... | def perform_db_upgrade_5_to_6(conn: ConnectionPlus) -> None:
from qcodes.dataset.sqlite.db_upgrades.upgrade_5_to_6 import upgrade_5_to_6
upgrade_5_to_6(conn) | [
"def",
"perform_db_upgrade_5_to_6",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"from",
"qcodes",
".",
"dataset",
".",
"sqlite",
".",
"db_upgrades",
".",
"upgrade_5_to_6",
"import",
"upgrade_5_to_6",
"upgrade_5_to_6",
"(",
"conn",
")"
] | Perform the upgrade from version 5 to version 6. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"5",
"to",
"version",
"6",
"."
] | [
"\"\"\"\n Perform the upgrade from version 5 to version 6.\n\n The upgrade ensures that the runs_description has a top-level entry\n called 'version'. Note that version changes of the runs_description will\n not be tracked as schema upgrades.\n \"\"\""
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_6_to_7 | None | def perform_db_upgrade_6_to_7(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 6 to version 7
Add a captured_run_id and captured_counter column to the runs table and
assign the value from the run_id and result_counter to these columns.
"""
sql = "SELECT name FROM sqlite_mast... |
Perform the upgrade from version 6 to version 7
Add a captured_run_id and captured_counter column to the runs table and
assign the value from the run_id and result_counter to these columns.
| Perform the upgrade from version 6 to version 7
Add a captured_run_id and captured_counter column to the runs table and
assign the value from the run_id and result_counter to these columns. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"6",
"to",
"version",
"7",
"Add",
"a",
"captured_run_id",
"and",
"captured_counter",
"column",
"to",
"the",
"runs",
"table",
"and",
"assign",
"the",
"value",
"from",
"the",
"run_id",
"and",
"result_counter",
"to"... | def perform_db_upgrade_6_to_7(conn: ConnectionPlus) -> None:
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
n_run_tables = len(cur.fetchall())
if n_run_tables == 1:
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description(... | [
"def",
"perform_db_upgrade_6_to_7",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"sql",
"=",
"\"SELECT name FROM sqlite_master WHERE type='table' AND name='runs'\"",
"cur",
"=",
"atomic_transaction",
"(",
"conn",
",",
"sql",
")",
"n_run_tables",
"=",
"len... | Perform the upgrade from version 6 to version 7
Add a captured_run_id and captured_counter column to the runs table and
assign the value from the run_id and result_counter to these columns. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"6",
"to",
"version",
"7",
"Add",
"a",
"captured_run_id",
"and",
"captured_counter",
"column",
"to",
"the",
"runs",
"table",
"and",
"assign",
"the",
"value",
"from",
"the",
"run_id",
"and",
"result_counter",
"to"... | [
"\"\"\"\n Perform the upgrade from version 6 to version 7\n\n Add a captured_run_id and captured_counter column to the runs table and\n assign the value from the run_id and result_counter to these columns.\n \"\"\"",
"# iterate through the pbar for the sake of the side effect; it",
"# prints that th... | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_7_to_8 | None | def perform_db_upgrade_7_to_8(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 7 to version 8.
Add a new column to store the dataset's parents to the runs table.
"""
with atomic(conn) as conn:
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description("Upgrading ... |
Perform the upgrade from version 7 to version 8.
Add a new column to store the dataset's parents to the runs table.
| Perform the upgrade from version 7 to version 8.
Add a new column to store the dataset's parents to the runs table. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"7",
"to",
"version",
"8",
".",
"Add",
"a",
"new",
"column",
"to",
"store",
"the",
"dataset",
"'",
"s",
"parents",
"to",
"the",
"runs",
"table",
"."
] | def perform_db_upgrade_7_to_8(conn: ConnectionPlus) -> None:
with atomic(conn) as conn:
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description("Upgrading database; v7 -> v8")
for _ in pbar:
insert_column(conn, 'runs', 'parent_datasets', 'TEXT') | [
"def",
"perform_db_upgrade_7_to_8",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"with",
"atomic",
"(",
"conn",
")",
"as",
"conn",
":",
"pbar",
"=",
"tqdm",
"(",
"range",
"(",
"1",
")",
",",
"file",
"=",
"sys",
".",
"stdout",
")",
"pba... | Perform the upgrade from version 7 to version 8. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"7",
"to",
"version",
"8",
"."
] | [
"\"\"\"\n Perform the upgrade from version 7 to version 8.\n\n Add a new column to store the dataset's parents to the runs table.\n \"\"\"",
"# iterate through the pbar for the sake of the side effect; it",
"# prints that the database is being upgraded"
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
eeeb5e1b5f06b3bd3ab98797a12d8093885fa971 | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/__init__.py | [
"MIT"
] | Python | perform_db_upgrade_8_to_9 | None | def perform_db_upgrade_8_to_9(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 8 to version 9.
Add indices on the runs table for captured_run_id
"""
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
n_run_tables... |
Perform the upgrade from version 8 to version 9.
Add indices on the runs table for captured_run_id
| Perform the upgrade from version 8 to version 9.
Add indices on the runs table for captured_run_id | [
"Perform",
"the",
"upgrade",
"from",
"version",
"8",
"to",
"version",
"9",
".",
"Add",
"indices",
"on",
"the",
"runs",
"table",
"for",
"captured_run_id"
] | def perform_db_upgrade_8_to_9(conn: ConnectionPlus) -> None:
sql = "SELECT name FROM sqlite_master WHERE type='table' AND name='runs'"
cur = atomic_transaction(conn, sql)
n_run_tables = len(cur.fetchall())
pbar = tqdm(range(1), file=sys.stdout)
pbar.set_description("Upgrading database; v8 -> v9")
... | [
"def",
"perform_db_upgrade_8_to_9",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"sql",
"=",
"\"SELECT name FROM sqlite_master WHERE type='table' AND name='runs'\"",
"cur",
"=",
"atomic_transaction",
"(",
"conn",
",",
"sql",
")",
"n_run_tables",
"=",
"len... | Perform the upgrade from version 8 to version 9. | [
"Perform",
"the",
"upgrade",
"from",
"version",
"8",
"to",
"version",
"9",
"."
] | [
"\"\"\"\n Perform the upgrade from version 8 to version 9.\n\n Add indices on the runs table for captured_run_id\n \"\"\"",
"# iterate through the pbar for the sake of the side effect; it",
"# prints that the database is being upgraded"
] | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
2168ab99eb6f4bb6517bf121e0ab273dff6f8cf4 | jakeogh/Qcodes | qcodes/tests/dataset/helper_functions.py | [
"MIT"
] | Python | verify_data_dict | None | def verify_data_dict(data: Dict[str, Dict[str, np.ndarray]],
dataframe: Optional[Dict[str, pandas.DataFrame]],
parameter_names: Sequence[str],
expected_names: Dict[str, Sequence[str]],
expected_shapes: Dict[str, Sequence[Tuple[int, ...]... |
Simple helper function to verify a dict of data. It can also optionally
The expected names values
and shapes should be given as a dict with keys given by the dependent
parameters. Each value in the dicts should be the sequence of expected
names/shapes/values for that requested parameter and its de... | Simple helper function to verify a dict of data. It can also optionally
The expected names values
and shapes should be given as a dict with keys given by the dependent
parameters. Each value in the dicts should be the sequence of expected
names/shapes/values for that requested parameter and its dependencies.
The first ... | [
"Simple",
"helper",
"function",
"to",
"verify",
"a",
"dict",
"of",
"data",
".",
"It",
"can",
"also",
"optionally",
"The",
"expected",
"names",
"values",
"and",
"shapes",
"should",
"be",
"given",
"as",
"a",
"dict",
"with",
"keys",
"given",
"by",
"the",
"d... | def verify_data_dict(data: Dict[str, Dict[str, np.ndarray]],
dataframe: Optional[Dict[str, pandas.DataFrame]],
parameter_names: Sequence[str],
expected_names: Dict[str, Sequence[str]],
expected_shapes: Dict[str, Sequence[Tuple[int, ...]... | [
"def",
"verify_data_dict",
"(",
"data",
":",
"Dict",
"[",
"str",
",",
"Dict",
"[",
"str",
",",
"np",
".",
"ndarray",
"]",
"]",
",",
"dataframe",
":",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"pandas",
".",
"DataFrame",
"]",
"]",
",",
"parameter_name... | Simple helper function to verify a dict of data. | [
"Simple",
"helper",
"function",
"to",
"verify",
"a",
"dict",
"of",
"data",
"."
] | [
"\"\"\"\n Simple helper function to verify a dict of data. It can also optionally\n\n The expected names values\n and shapes should be given as a dict with keys given by the dependent\n parameters. Each value in the dicts should be the sequence of expected\n names/shapes/values for that requested par... | [
{
"param": "data",
"type": "Dict[str, Dict[str, np.ndarray]]"
},
{
"param": "dataframe",
"type": "Optional[Dict[str, pandas.DataFrame]]"
},
{
"param": "parameter_names",
"type": "Sequence[str]"
},
{
"param": "expected_names",
"type": "Dict[str, Sequence[str]]"
},
{
... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data",
"type": "Dict[str, Dict[str, np.ndarray]]",
"docstring": "The dict data to verify the shape and content of.",
"docstring_tokens": [
"The",
"dict",
"data",
"to",
"verify",
... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | parse_module_query_response | Dict[SlotNr, str] | def parse_module_query_response(response: str) -> Dict[SlotNr, str]:
"""
Extract installed module information from the given string and return the
information as a dictionary.
Args:
response: Response str to `UNT? 0` query.
Returns:
Dictionary from slot numbers to model name string... |
Extract installed module information from the given string and return the
information as a dictionary.
Args:
response: Response str to `UNT? 0` query.
Returns:
Dictionary from slot numbers to model name strings.
| Extract installed module information from the given string and return the
information as a dictionary. | [
"Extract",
"installed",
"module",
"information",
"from",
"the",
"given",
"string",
"and",
"return",
"the",
"information",
"as",
"a",
"dictionary",
"."
] | def parse_module_query_response(response: str) -> Dict[SlotNr, str]:
pattern = r";?(?P<model>\w+),(?P<revision>\d+)"
moduleinfo = re.findall(pattern, response)
return {
SlotNr(slot_nr): model
for slot_nr, (model, rev) in enumerate(moduleinfo, start=1)
if model != "0"
} | [
"def",
"parse_module_query_response",
"(",
"response",
":",
"str",
")",
"->",
"Dict",
"[",
"SlotNr",
",",
"str",
"]",
":",
"pattern",
"=",
"r\";?(?P<model>\\w+),(?P<revision>\\d+)\"",
"moduleinfo",
"=",
"re",
".",
"findall",
"(",
"pattern",
",",
"response",
")",... | Extract installed module information from the given string and return the
information as a dictionary. | [
"Extract",
"installed",
"module",
"information",
"from",
"the",
"given",
"string",
"and",
"return",
"the",
"information",
"as",
"a",
"dictionary",
"."
] | [
"\"\"\"\n Extract installed module information from the given string and return the\n information as a dictionary.\n\n Args:\n response: Response str to `UNT? 0` query.\n\n Returns:\n Dictionary from slot numbers to model name strings.\n \"\"\""
] | [
{
"param": "response",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Dictionary from slot numbers to model name strings.",
"docstring_tokens": [
"Dictionary",
"from",
"slot",
"numbers",
"to",
"model",
"name",
"strings",
"."
],
"type": null
}
],
"ra... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | parse_dcv_measurement_response | Dict[str, Union[str,
float]] | def parse_dcv_measurement_response(response: str) -> Dict[str, Union[str,
float]]:
"""
Extract status, channel number, value and accompanying metadata from
the string and return them as a dictionary.
Args:
response: Response ... |
Extract status, channel number, value and accompanying metadata from
the string and return them as a dictionary.
Args:
response: Response str to lrn_query For the MFCMU.
| Extract status, channel number, value and accompanying metadata from
the string and return them as a dictionary. | [
"Extract",
"status",
"channel",
"number",
"value",
"and",
"accompanying",
"metadata",
"from",
"the",
"string",
"and",
"return",
"them",
"as",
"a",
"dictionary",
"."
] | def parse_dcv_measurement_response(response: str) -> Dict[str, Union[str,
float]]:
match = re.match(_pattern_lrn, response)
if match is None:
raise ValueError(f"{response!r} didn't match {_pattern_lrn!r} pattern")
dd = match.groupd... | [
"def",
"parse_dcv_measurement_response",
"(",
"response",
":",
"str",
")",
"->",
"Dict",
"[",
"str",
",",
"Union",
"[",
"str",
",",
"float",
"]",
"]",
":",
"match",
"=",
"re",
".",
"match",
"(",
"_pattern_lrn",
",",
"response",
")",
"if",
"match",
"is"... | Extract status, channel number, value and accompanying metadata from
the string and return them as a dictionary. | [
"Extract",
"status",
"channel",
"number",
"value",
"and",
"accompanying",
"metadata",
"from",
"the",
"string",
"and",
"return",
"them",
"as",
"a",
"dictionary",
"."
] | [
"\"\"\"\n Extract status, channel number, value and accompanying metadata from\n the string and return them as a dictionary.\n\n Args:\n response: Response str to lrn_query For the MFCMU.\n \"\"\""
] | [
{
"param": "response",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "response",
"type": "str",
"docstring": "Response str to lrn_query For the MFCMU.",
"docstring_tokens": [
"Response",
"str",
"to",
"lrn_query",
"For",
"the",
"MFCMU",
... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | parse_spot_measurement_response | SpotResponse | def parse_spot_measurement_response(response: str) -> SpotResponse:
"""
Extract measured value and accompanying metadata from the string
and return them as a dictionary.
Args:
response: Response str to spot measurement query.
Returns:
Dictionary with measured value and associated m... |
Extract measured value and accompanying metadata from the string
and return them as a dictionary.
Args:
response: Response str to spot measurement query.
Returns:
Dictionary with measured value and associated metadata (e.g.
timestamp, channel number, etc.)
| Extract measured value and accompanying metadata from the string
and return them as a dictionary. | [
"Extract",
"measured",
"value",
"and",
"accompanying",
"metadata",
"from",
"the",
"string",
"and",
"return",
"them",
"as",
"a",
"dictionary",
"."
] | def parse_spot_measurement_response(response: str) -> SpotResponse:
match = re.match(_pattern, response)
if match is None:
raise ValueError(f"{response!r} didn't match {_pattern!r} pattern")
dd = match.groupdict()
d = SpotResponse(
value=_convert_to_nan_if_dummy_value(float(dd["value"]))... | [
"def",
"parse_spot_measurement_response",
"(",
"response",
":",
"str",
")",
"->",
"SpotResponse",
":",
"match",
"=",
"re",
".",
"match",
"(",
"_pattern",
",",
"response",
")",
"if",
"match",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"f\"{response!r} didn'... | Extract measured value and accompanying metadata from the string
and return them as a dictionary. | [
"Extract",
"measured",
"value",
"and",
"accompanying",
"metadata",
"from",
"the",
"string",
"and",
"return",
"them",
"as",
"a",
"dictionary",
"."
] | [
"\"\"\"\n Extract measured value and accompanying metadata from the string\n and return them as a dictionary.\n\n Args:\n response: Response str to spot measurement query.\n\n Returns:\n Dictionary with measured value and associated metadata (e.g.\n timestamp, channel number, etc.)\... | [
{
"param": "response",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Dictionary with measured value and associated metadata",
"docstring_tokens": [
"Dictionary",
"with",
"measured",
"value",
"and",
"associated",
"metadata"
],
"type": null
}
],
"raises": [],
"par... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | convert_dummy_val_to_nan | None | def convert_dummy_val_to_nan(param: _FMTResponse) -> None:
"""
Converts dummy value to NaN. Instrument may output dummy value (
199.999E+99) if measurement data is over the measurement range. Or the
sweep measurement was aborted by the automatic stop function or power
compliance. Or if any abort con... |
Converts dummy value to NaN. Instrument may output dummy value (
199.999E+99) if measurement data is over the measurement range. Or the
sweep measurement was aborted by the automatic stop function or power
compliance. Or if any abort condition is detected. Dummy data
199.999E+99 will be returned fo... | Converts dummy value to NaN. Instrument may output dummy value (
199.999E+99) if measurement data is over the measurement range. Or the
sweep measurement was aborted by the automatic stop function or power
compliance. Or if any abort condition is detected. Dummy data
199.999E+99 will be returned for the data after abor... | [
"Converts",
"dummy",
"value",
"to",
"NaN",
".",
"Instrument",
"may",
"output",
"dummy",
"value",
"(",
"199",
".",
"999E",
"+",
"99",
")",
"if",
"measurement",
"data",
"is",
"over",
"the",
"measurement",
"range",
".",
"Or",
"the",
"sweep",
"measurement",
... | def convert_dummy_val_to_nan(param: _FMTResponse) -> None:
for index, value in enumerate(param.value):
param.value[index] = _convert_to_nan_if_dummy_value(param.value[index]) | [
"def",
"convert_dummy_val_to_nan",
"(",
"param",
":",
"_FMTResponse",
")",
"->",
"None",
":",
"for",
"index",
",",
"value",
"in",
"enumerate",
"(",
"param",
".",
"value",
")",
":",
"param",
".",
"value",
"[",
"index",
"]",
"=",
"_convert_to_nan_if_dummy_valu... | Converts dummy value to NaN. | [
"Converts",
"dummy",
"value",
"to",
"NaN",
"."
] | [
"\"\"\"\n Converts dummy value to NaN. Instrument may output dummy value (\n 199.999E+99) if measurement data is over the measurement range. Or the\n sweep measurement was aborted by the automatic stop function or power\n compliance. Or if any abort condition is detected. Dummy data\n 199.999E+99 wil... | [
{
"param": "param",
"type": "_FMTResponse"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "param",
"type": "_FMTResponse",
"docstring": "This must be of type named tuple _FMTResponse.",
"docstring_tokens": [
"This",
"must",
"be",
"of",
"type",
"named",
"tuple",... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | enable_outputs | None | def enable_outputs(self) -> None:
"""
Enables all outputs of this module by closing the output relays of its
channels.
"""
# TODO This always enables all outputs of a module, which is maybe not
# desirable. (Also check the TODO item at the top about
# InstrumentCh... |
Enables all outputs of this module by closing the output relays of its
channels.
| Enables all outputs of this module by closing the output relays of its
channels. | [
"Enables",
"all",
"outputs",
"of",
"this",
"module",
"by",
"closing",
"the",
"output",
"relays",
"of",
"its",
"channels",
"."
] | def enable_outputs(self) -> None:
msg = MessageBuilder().cn(self.channels).message
self.write(msg) | [
"def",
"enable_outputs",
"(",
"self",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"cn",
"(",
"self",
".",
"channels",
")",
".",
"message",
"self",
".",
"write",
"(",
"msg",
")"
] | Enables all outputs of this module by closing the output relays of its
channels. | [
"Enables",
"all",
"outputs",
"of",
"this",
"module",
"by",
"closing",
"the",
"output",
"relays",
"of",
"its",
"channels",
"."
] | [
"\"\"\"\n Enables all outputs of this module by closing the output relays of its\n channels.\n \"\"\"",
"# TODO This always enables all outputs of a module, which is maybe not",
"# desirable. (Also check the TODO item at the top about",
"# InstrumentChannel per Channel instead of per Modu... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | disable_outputs | None | def disable_outputs(self) -> None:
"""
Disables all outputs of this module by opening the output relays of its
channels.
"""
# TODO See enable_output TODO item
msg = MessageBuilder().cl(self.channels).message
self.write(msg) |
Disables all outputs of this module by opening the output relays of its
channels.
| Disables all outputs of this module by opening the output relays of its
channels. | [
"Disables",
"all",
"outputs",
"of",
"this",
"module",
"by",
"opening",
"the",
"output",
"relays",
"of",
"its",
"channels",
"."
] | def disable_outputs(self) -> None:
msg = MessageBuilder().cl(self.channels).message
self.write(msg) | [
"def",
"disable_outputs",
"(",
"self",
")",
"->",
"None",
":",
"msg",
"=",
"MessageBuilder",
"(",
")",
".",
"cl",
"(",
"self",
".",
"channels",
")",
".",
"message",
"self",
".",
"write",
"(",
"msg",
")"
] | Disables all outputs of this module by opening the output relays of its
channels. | [
"Disables",
"all",
"outputs",
"of",
"this",
"module",
"by",
"opening",
"the",
"output",
"relays",
"of",
"its",
"channels",
"."
] | [
"\"\"\"\n Disables all outputs of this module by opening the output relays of its\n channels.\n \"\"\"",
"# TODO See enable_output TODO item"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | is_enabled | bool | def is_enabled(self) -> bool:
"""
Check if channels of this module are enabled.
Returns:
`True` if *all* channels of this module are enabled. `False`,
otherwise.
"""
# TODO If a module has multiple channels, and only one is enabled, then
# this wi... |
Check if channels of this module are enabled.
Returns:
`True` if *all* channels of this module are enabled. `False`,
otherwise.
| Check if channels of this module are enabled. | [
"Check",
"if",
"channels",
"of",
"this",
"module",
"are",
"enabled",
"."
] | def is_enabled(self) -> bool:
msg = (MessageBuilder()
.lrn_query(constants.LRN.Type.OUTPUT_SWITCH)
.message
)
response = self.ask(msg)
activated_channels = re.sub(r"[^,\d]", "", response).split(",")
is_enabled = set(self.channels).issubset(
... | [
"def",
"is_enabled",
"(",
"self",
")",
"->",
"bool",
":",
"msg",
"=",
"(",
"MessageBuilder",
"(",
")",
".",
"lrn_query",
"(",
"constants",
".",
"LRN",
".",
"Type",
".",
"OUTPUT_SWITCH",
")",
".",
"message",
")",
"response",
"=",
"self",
".",
"ask",
"... | Check if channels of this module are enabled. | [
"Check",
"if",
"channels",
"of",
"this",
"module",
"are",
"enabled",
"."
] | [
"\"\"\"\n Check if channels of this module are enabled.\n\n Returns:\n `True` if *all* channels of this module are enabled. `False`,\n otherwise.\n \"\"\"",
"# TODO If a module has multiple channels, and only one is enabled, then",
"# this will return false, which is p... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "`True` if *all* channels of this module are enabled. `False`,\notherwise.",
"docstring_tokens": [
"`",
"True",
"`",
"if",
"*",
"all",
"*",
"channels",
"of",
"this",
"module",
... |
1f6da956d7d9b506e78a8d097ff4c6fce8e1a447 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_module.py | [
"MIT"
] | Python | clear_timer_count | None | def clear_timer_count(self) -> None:
"""
This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4).
"""
self.root_... |
This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4).
| This command clears the timer count. This command is effective for
all measurement modes, regardless of the TSC setting. This command
is not effective for the 4 byte binary data output format
(FMT3 and FMT4). | [
"This",
"command",
"clears",
"the",
"timer",
"count",
".",
"This",
"command",
"is",
"effective",
"for",
"all",
"measurement",
"modes",
"regardless",
"of",
"the",
"TSC",
"setting",
".",
"This",
"command",
"is",
"not",
"effective",
"for",
"the",
"4",
"byte",
... | def clear_timer_count(self) -> None:
self.root_instrument.clear_timer_count(chnum=self.channels) | [
"def",
"clear_timer_count",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"root_instrument",
".",
"clear_timer_count",
"(",
"chnum",
"=",
"self",
".",
"channels",
")"
] | This command clears the timer count. | [
"This",
"command",
"clears",
"the",
"timer",
"count",
"."
] | [
"\"\"\"\n This command clears the timer count. This command is effective for\n all measurement modes, regardless of the TSC setting. This command\n is not effective for the 4 byte binary data output format\n (FMT3 and FMT4).\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
da6f9cfbb04f1a1a41c2b568f8487d67e36ff452 | jakeogh/Qcodes | qcodes/tests/test_autoloadable_channels.py | [
"MIT"
] | Python | send | Any | def send(self, cmd: str) -> Any:
"""
Instead of sending a string to the Visa backend, we use this function
as a mock
"""
keys = self._command_dict.keys()
ans = None
key = ""
for key in keys:
ans = re.match(key, cmd)
if ans is not No... |
Instead of sending a string to the Visa backend, we use this function
as a mock
| Instead of sending a string to the Visa backend, we use this function
as a mock | [
"Instead",
"of",
"sending",
"a",
"string",
"to",
"the",
"Visa",
"backend",
"we",
"use",
"this",
"function",
"as",
"a",
"mock"
] | def send(self, cmd: str) -> Any:
keys = self._command_dict.keys()
ans = None
key = ""
for key in keys:
ans = re.match(key, cmd)
if ans is not None:
break
if ans is None:
raise ValueError(f"Command {cmd} unknown")
args = ... | [
"def",
"send",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"Any",
":",
"keys",
"=",
"self",
".",
"_command_dict",
".",
"keys",
"(",
")",
"ans",
"=",
"None",
"key",
"=",
"\"\"",
"for",
"key",
"in",
"keys",
":",
"ans",
"=",
"re",
".",
"match"... | Instead of sending a string to the Visa backend, we use this function
as a mock | [
"Instead",
"of",
"sending",
"a",
"string",
"to",
"the",
"Visa",
"backend",
"we",
"use",
"this",
"function",
"as",
"a",
"mock"
] | [
"\"\"\"\n Instead of sending a string to the Visa backend, we use this function\n as a mock\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "cmd",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "str",
"docstring": null,
"docstring_tokens": [... |
da6f9cfbb04f1a1a41c2b568f8487d67e36ff452 | jakeogh/Qcodes | qcodes/tests/test_autoloadable_channels.py | [
"MIT"
] | Python | _add_channel | None | def _add_channel(self, chn: int, greeting: str)->None:
"""
Add a channel on the mock instrument
"""
self._channel_catalog.append(str(chn))
self._greetings[str(chn)] = greeting |
Add a channel on the mock instrument
| Add a channel on the mock instrument | [
"Add",
"a",
"channel",
"on",
"the",
"mock",
"instrument"
] | def _add_channel(self, chn: int, greeting: str)->None:
self._channel_catalog.append(str(chn))
self._greetings[str(chn)] = greeting | [
"def",
"_add_channel",
"(",
"self",
",",
"chn",
":",
"int",
",",
"greeting",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"_channel_catalog",
".",
"append",
"(",
"str",
"(",
"chn",
")",
")",
"self",
".",
"_greetings",
"[",
"str",
"(",
"chn",
")... | Add a channel on the mock instrument | [
"Add",
"a",
"channel",
"on",
"the",
"mock",
"instrument"
] | [
"\"\"\"\n Add a channel on the mock instrument\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "chn",
"type": "int"
},
{
"param": "greeting",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chn",
"type": "int",
"docstring": null,
"docstring_tokens": [... |
da6f9cfbb04f1a1a41c2b568f8487d67e36ff452 | jakeogh/Qcodes | qcodes/tests/test_autoloadable_channels.py | [
"MIT"
] | Python | _get_new_instance_kwargs | Dict[Any, Any] | def _get_new_instance_kwargs(
cls, parent: Optional[Instrument] = None, **kwargs
) -> Dict[Any, Any]:
"""
Find the smallest channel number not yet occupied. An optional keyword
`greeting` is extracted from the kwargs. The default is "Hello"
"""
if parent is None:
... |
Find the smallest channel number not yet occupied. An optional keyword
`greeting` is extracted from the kwargs. The default is "Hello"
| Find the smallest channel number not yet occupied. An optional keyword
`greeting` is extracted from the kwargs. The default is "Hello" | [
"Find",
"the",
"smallest",
"channel",
"number",
"not",
"yet",
"occupied",
".",
"An",
"optional",
"keyword",
"`",
"greeting",
"`",
"is",
"extracted",
"from",
"the",
"kwargs",
".",
"The",
"default",
"is",
"\"",
"Hello",
"\""
] | def _get_new_instance_kwargs(
cls, parent: Optional[Instrument] = None, **kwargs
) -> Dict[Any, Any]:
if parent is None:
raise RuntimeError("SimpleTestChannel needs a parent instrument")
channels_str = parent.channel_catalog()
existing_channels = [int(i) for i in chan... | [
"def",
"_get_new_instance_kwargs",
"(",
"cls",
",",
"parent",
":",
"Optional",
"[",
"Instrument",
"]",
"=",
"None",
",",
"**",
"kwargs",
")",
"->",
"Dict",
"[",
"Any",
",",
"Any",
"]",
":",
"if",
"parent",
"is",
"None",
":",
"raise",
"RuntimeError",
"(... | Find the smallest channel number not yet occupied. | [
"Find",
"the",
"smallest",
"channel",
"number",
"not",
"yet",
"occupied",
"."
] | [
"\"\"\"\n Find the smallest channel number not yet occupied. An optional keyword\n `greeting` is extracted from the kwargs. The default is \"Hello\"\n \"\"\""
] | [
{
"param": "cls",
"type": null
},
{
"param": "parent",
"type": "Optional[Instrument]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parent",
"type": "Optional[Instrument]",
"docstring": null,
"d... |
75f9f41c049086b1a4a05ea91d324717d1f5448d | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/KeysightB1500_sampling_measurement.py | [
"MIT"
] | Python | compliance | List[int] | def compliance(self) -> List[int]:
"""
check for the status other than "N" (normal) and output the
number of data values which were not measured under "N" (normal)
status.
For the list of all the status values and their meaning refer to
:class:`.constants.MeasurementStat... |
check for the status other than "N" (normal) and output the
number of data values which were not measured under "N" (normal)
status.
For the list of all the status values and their meaning refer to
:class:`.constants.MeasurementStatus`.
| check for the status other than "N" (normal) and output the
number of data values which were not measured under "N" (normal)
status.
For the list of all the status values and their meaning refer to | [
"check",
"for",
"the",
"status",
"other",
"than",
"\"",
"N",
"\"",
"(",
"normal",
")",
"and",
"output",
"the",
"number",
"of",
"data",
"values",
"which",
"were",
"not",
"measured",
"under",
"\"",
"N",
"\"",
"(",
"normal",
")",
"status",
".",
"For",
"... | def compliance(self) -> List[int]:
if self.data.status is None:
raise MeasurementNotTaken('First run sampling_measurement'
' method to generate the data')
else:
data = self.data
total_count = len(data.status)
normal_co... | [
"def",
"compliance",
"(",
"self",
")",
"->",
"List",
"[",
"int",
"]",
":",
"if",
"self",
".",
"data",
".",
"status",
"is",
"None",
":",
"raise",
"MeasurementNotTaken",
"(",
"'First run sampling_measurement'",
"' method to generate the data'",
")",
"else",
":",
... | check for the status other than "N" (normal) and output the
number of data values which were not measured under "N" (normal)
status. | [
"check",
"for",
"the",
"status",
"other",
"than",
"\"",
"N",
"\"",
"(",
"normal",
")",
"and",
"output",
"the",
"number",
"of",
"data",
"values",
"which",
"were",
"not",
"measured",
"under",
"\"",
"N",
"\"",
"(",
"normal",
")",
"status",
"."
] | [
"\"\"\"\n check for the status other than \"N\" (normal) and output the\n number of data values which were not measured under \"N\" (normal)\n status.\n\n For the list of all the status values and their meaning refer to\n :class:`.constants.MeasurementStatus`.\n\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": [
{
"identifier": "class",
"docstring": null,
... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | write | null | def write(self, data_set: 'DataSet', io_manager, location, write_metadata=True,
force_write=False, only_complete=True):
"""
Write the DataSet to storage.
Subclasses must override this method.
It is up to the Formatter to decide when to overwrite completely,
and wh... |
Write the DataSet to storage.
Subclasses must override this method.
It is up to the Formatter to decide when to overwrite completely,
and when to just append or otherwise update the file(s).
Args:
data_set: the data we are writing.
io_manager (io_manag... | Write the DataSet to storage.
Subclasses must override this method.
It is up to the Formatter to decide when to overwrite completely,
and when to just append or otherwise update the file(s). | [
"Write",
"the",
"DataSet",
"to",
"storage",
".",
"Subclasses",
"must",
"override",
"this",
"method",
".",
"It",
"is",
"up",
"to",
"the",
"Formatter",
"to",
"decide",
"when",
"to",
"overwrite",
"completely",
"and",
"when",
"to",
"just",
"append",
"or",
"oth... | def write(self, data_set: 'DataSet', io_manager, location, write_metadata=True,
force_write=False, only_complete=True):
raise NotImplementedError | [
"def",
"write",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
",",
"io_manager",
",",
"location",
",",
"write_metadata",
"=",
"True",
",",
"force_write",
"=",
"False",
",",
"only_complete",
"=",
"True",
")",
":",
"raise",
"NotImplementedError"
] | Write the DataSet to storage. | [
"Write",
"the",
"DataSet",
"to",
"storage",
"."
] | [
"\"\"\"\n Write the DataSet to storage.\n\n Subclasses must override this method.\n\n It is up to the Formatter to decide when to overwrite completely,\n and when to just append or otherwise update the file(s).\n\n Args:\n data_set: the data we are writing.\n ... | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": "'DataSet'"
},
{
"param": "io_manager",
"type": null
},
{
"param": "location",
"type": null
},
{
"param": "write_metadata",
"type": null
},
{
"param": "force_write",
"type": null
}... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_set",
"type": "'DataSet'",
"docstring": "the data we are writi... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | write_metadata | null | def write_metadata(self, data_set: 'DataSet',
io_manager, location, read_first=True, **kwargs):
"""
Write the metadata for this DataSet to storage.
Subclasses must override this method.
Args:
data_set: the data we are writing.
io_manager (... |
Write the metadata for this DataSet to storage.
Subclasses must override this method.
Args:
data_set: the data we are writing.
io_manager (io_manager): base physical location to write to.
location (str): the file location within the io_manager.
... | Write the metadata for this DataSet to storage.
Subclasses must override this method. | [
"Write",
"the",
"metadata",
"for",
"this",
"DataSet",
"to",
"storage",
".",
"Subclasses",
"must",
"override",
"this",
"method",
"."
] | def write_metadata(self, data_set: 'DataSet',
io_manager, location, read_first=True, **kwargs):
raise NotImplementedError | [
"def",
"write_metadata",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
",",
"io_manager",
",",
"location",
",",
"read_first",
"=",
"True",
",",
"**",
"kwargs",
")",
":",
"raise",
"NotImplementedError"
] | Write the metadata for this DataSet to storage. | [
"Write",
"the",
"metadata",
"for",
"this",
"DataSet",
"to",
"storage",
"."
] | [
"\"\"\"\n Write the metadata for this DataSet to storage.\n\n Subclasses must override this method.\n\n Args:\n data_set: the data we are writing.\n io_manager (io_manager): base physical location to write to.\n location (str): the file location within the io_ma... | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": "'DataSet'"
},
{
"param": "io_manager",
"type": null
},
{
"param": "location",
"type": null
},
{
"param": "read_first",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_set",
"type": "'DataSet'",
"docstring": "the data we are writi... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | read_metadata | null | def read_metadata(self, data_set: 'DataSet'):
"""
Read the metadata from this DataSet from storage.
Subclasses must override this method.
Args:
data_set: the data to read metadata into
"""
raise NotImplementedError |
Read the metadata from this DataSet from storage.
Subclasses must override this method.
Args:
data_set: the data to read metadata into
| Read the metadata from this DataSet from storage.
Subclasses must override this method. | [
"Read",
"the",
"metadata",
"from",
"this",
"DataSet",
"from",
"storage",
".",
"Subclasses",
"must",
"override",
"this",
"method",
"."
] | def read_metadata(self, data_set: 'DataSet'):
raise NotImplementedError | [
"def",
"read_metadata",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
")",
":",
"raise",
"NotImplementedError"
] | Read the metadata from this DataSet from storage. | [
"Read",
"the",
"metadata",
"from",
"this",
"DataSet",
"from",
"storage",
"."
] | [
"\"\"\"\n Read the metadata from this DataSet from storage.\n\n Subclasses must override this method.\n\n Args:\n data_set: the data to read metadata into\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": "'DataSet'"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_set",
"type": "'DataSet'",
"docstring": "the data to read meta... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | read_one_file | null | def read_one_file(self, data_set: 'DataSet', f, ids_read):
"""
Read data from a single file into a ``DataSet``.
Formatter subclasses that break a DataSet into multiple data files may
choose to override either this method, which handles one file at a
time, or ``read`` which finds... |
Read data from a single file into a ``DataSet``.
Formatter subclasses that break a DataSet into multiple data files may
choose to override either this method, which handles one file at a
time, or ``read`` which finds matching files on its own.
Args:
data_set: the d... | Read data from a single file into a ``DataSet``.
Formatter subclasses that break a DataSet into multiple data files may
choose to override either this method, which handles one file at a
time, or ``read`` which finds matching files on its own. | [
"Read",
"data",
"from",
"a",
"single",
"file",
"into",
"a",
"`",
"`",
"DataSet",
"`",
"`",
".",
"Formatter",
"subclasses",
"that",
"break",
"a",
"DataSet",
"into",
"multiple",
"data",
"files",
"may",
"choose",
"to",
"override",
"either",
"this",
"method",
... | def read_one_file(self, data_set: 'DataSet', f, ids_read):
raise NotImplementedError | [
"def",
"read_one_file",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
",",
"f",
",",
"ids_read",
")",
":",
"raise",
"NotImplementedError"
] | Read data from a single file into a ``DataSet``. | [
"Read",
"data",
"from",
"a",
"single",
"file",
"into",
"a",
"`",
"`",
"DataSet",
"`",
"`",
"."
] | [
"\"\"\"\n Read data from a single file into a ``DataSet``.\n\n Formatter subclasses that break a DataSet into multiple data files may\n choose to override either this method, which handles one file at a\n time, or ``read`` which finds matching files on its own.\n\n Args:\n ... | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": "'DataSet'"
},
{
"param": "f",
"type": null
},
{
"param": "ids_read",
"type": null
}
] | {
"returns": [],
"raises": [
{
"docstring": "if a duplicate array_id of measured data is found",
"docstring_tokens": [
"if",
"a",
"duplicate",
"array_id",
"of",
"measured",
"data",
"is",
"found"
],
"type": "ValueErro... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | match_save_range | <not_specific> | def match_save_range(self, group, file_exists, only_complete=True):
"""
Find the save range that will joins all changes in an array group.
Matches all full-sized arrays: the data arrays plus the inner loop
setpoint array.
Note: if an outer loop has changed values (without the i... |
Find the save range that will joins all changes in an array group.
Matches all full-sized arrays: the data arrays plus the inner loop
setpoint array.
Note: if an outer loop has changed values (without the inner
loop or measured data changing) we won't notice it here. We assume... | Find the save range that will joins all changes in an array group.
Matches all full-sized arrays: the data arrays plus the inner loop
setpoint array.
if an outer loop has changed values (without the inner
loop or measured data changing) we won't notice it here. We assume
that before an iteration of the inner loop star... | [
"Find",
"the",
"save",
"range",
"that",
"will",
"joins",
"all",
"changes",
"in",
"an",
"array",
"group",
".",
"Matches",
"all",
"full",
"-",
"sized",
"arrays",
":",
"the",
"data",
"arrays",
"plus",
"the",
"inner",
"loop",
"setpoint",
"array",
".",
"if",
... | def match_save_range(self, group, file_exists, only_complete=True):
inner_setpoint = group.set_arrays[-1]
full_dim_data = (inner_setpoint, ) + group.data
for array in full_dim_data:
if array.modified_range:
break
else:
return None
last_save... | [
"def",
"match_save_range",
"(",
"self",
",",
"group",
",",
"file_exists",
",",
"only_complete",
"=",
"True",
")",
":",
"inner_setpoint",
"=",
"group",
".",
"set_arrays",
"[",
"-",
"1",
"]",
"full_dim_data",
"=",
"(",
"inner_setpoint",
",",
")",
"+",
"group... | Find the save range that will joins all changes in an array group. | [
"Find",
"the",
"save",
"range",
"that",
"will",
"joins",
"all",
"changes",
"in",
"an",
"array",
"group",
"."
] | [
"\"\"\"\n Find the save range that will joins all changes in an array group.\n\n Matches all full-sized arrays: the data arrays plus the inner loop\n setpoint array.\n\n Note: if an outer loop has changed values (without the inner\n loop or measured data changing) we won't notice ... | [
{
"param": "self",
"type": null
},
{
"param": "group",
"type": null
},
{
"param": "file_exists",
"type": null
},
{
"param": "only_complete",
"type": null
}
] | {
"returns": [
{
"docstring": "Tuple(int, int): the first and last raveled indices that should\nbe saved. Returns None if:\nno data is present\nno new data can be found",
"docstring_tokens": [
"Tuple",
"(",
"int",
"int",
")",
":",
"the",
... |
e70fcba80d86ccc974f1f5d6a9b306a27125dc2a | jakeogh/Qcodes | qcodes/data/format.py | [
"MIT"
] | Python | group_arrays | <not_specific> | def group_arrays(self, arrays):
"""
Find the sets of arrays which share all the same setpoint arrays.
Some Formatters use this grouping to determine which arrays to save
together in one file.
Args:
arrays (Dict[DataArray]): all the arrays in a DataSet
Retur... |
Find the sets of arrays which share all the same setpoint arrays.
Some Formatters use this grouping to determine which arrays to save
together in one file.
Args:
arrays (Dict[DataArray]): all the arrays in a DataSet
Returns:
List[Formatter.ArrayGroup]:... | Find the sets of arrays which share all the same setpoint arrays.
Some Formatters use this grouping to determine which arrays to save
together in one file. | [
"Find",
"the",
"sets",
"of",
"arrays",
"which",
"share",
"all",
"the",
"same",
"setpoint",
"arrays",
".",
"Some",
"Formatters",
"use",
"this",
"grouping",
"to",
"determine",
"which",
"arrays",
"to",
"save",
"together",
"in",
"one",
"file",
"."
] | def group_arrays(self, arrays):
set_array_sets = tuple({array.set_arrays
for array in arrays.values()})
all_set_arrays = set()
for set_array_set in set_array_sets:
all_set_arrays.update(set_array_set)
grouped_data = [[] for _ in set_array_se... | [
"def",
"group_arrays",
"(",
"self",
",",
"arrays",
")",
":",
"set_array_sets",
"=",
"tuple",
"(",
"{",
"array",
".",
"set_arrays",
"for",
"array",
"in",
"arrays",
".",
"values",
"(",
")",
"}",
")",
"all_set_arrays",
"=",
"set",
"(",
")",
"for",
"set_ar... | Find the sets of arrays which share all the same setpoint arrays. | [
"Find",
"the",
"sets",
"of",
"arrays",
"which",
"share",
"all",
"the",
"same",
"setpoint",
"arrays",
"."
] | [
"\"\"\"\n Find the sets of arrays which share all the same setpoint arrays.\n\n Some Formatters use this grouping to determine which arrays to save\n together in one file.\n\n Args:\n arrays (Dict[DataArray]): all the arrays in a DataSet\n\n Returns:\n List[F... | [
{
"param": "self",
"type": null
},
{
"param": "arrays",
"type": null
}
] | {
"returns": [
{
"docstring": "namedtuples giving:\nshape (Tuple[int]): dimensions as in numpy\nset_arrays (Tuple[DataArray]): the setpoints of this group\ndata (Tuple[DataArray]): measured arrays in this group\nname (str): a unique name of this group, obtained by joining\nthe setpoint array ids.",
"d... |
7243e3c80b185f82ff252cdb2b34e621baba2241 | jakeogh/Qcodes | qcodes/dataset/guids.py | [
"MIT"
] | Python | generate_guid | str | def generate_guid(timeint: Union[int, None]=None,
sampleint: Union[int, None]=None) -> str:
"""
Generate a guid string to go into the GUID column of the runs table.
The GUID is based on the GUID-components in the qcodesrc file.
The generated string is of the format
'12345678-1234-1... |
Generate a guid string to go into the GUID column of the runs table.
The GUID is based on the GUID-components in the qcodesrc file.
The generated string is of the format
'12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
comprise the 4 byte sample code, the next 2 hex numbers... | Generate a guid string to go into the GUID column of the runs table.
The GUID is based on the GUID-components in the qcodesrc file.
The generated string is of the format
'12345678-1234-1234-1234-123456789abc', where the first eight hex numbers
comprise the 4 byte sample code, the next 2 hex numbers comprise the 1 byte
... | [
"Generate",
"a",
"guid",
"string",
"to",
"go",
"into",
"the",
"GUID",
"column",
"of",
"the",
"runs",
"table",
".",
"The",
"GUID",
"is",
"based",
"on",
"the",
"GUID",
"-",
"components",
"in",
"the",
"qcodesrc",
"file",
".",
"The",
"generated",
"string",
... | def generate_guid(timeint: Union[int, None]=None,
sampleint: Union[int, None]=None) -> str:
cfg = qc.config
try:
guid_comp = cfg['GUID_components']
except KeyError:
raise RuntimeError('Invalid QCoDeS config file! No GUID_components '
'specified. C... | [
"def",
"generate_guid",
"(",
"timeint",
":",
"Union",
"[",
"int",
",",
"None",
"]",
"=",
"None",
",",
"sampleint",
":",
"Union",
"[",
"int",
",",
"None",
"]",
"=",
"None",
")",
"->",
"str",
":",
"cfg",
"=",
"qc",
".",
"config",
"try",
":",
"guid_... | Generate a guid string to go into the GUID column of the runs table. | [
"Generate",
"a",
"guid",
"string",
"to",
"go",
"into",
"the",
"GUID",
"column",
"of",
"the",
"runs",
"table",
"."
] | [
"\"\"\"\n Generate a guid string to go into the GUID column of the runs table.\n The GUID is based on the GUID-components in the qcodesrc file.\n The generated string is of the format\n '12345678-1234-1234-1234-123456789abc', where the first eight hex numbers\n comprise the 4 byte sample code, the ne... | [
{
"param": "timeint",
"type": "Union[int, None]"
},
{
"param": "sampleint",
"type": "Union[int, None]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "timeint",
"type": "Union[int, None]",
"docstring": "An integer of miliseconds since unix epoch time",
"docstring_tokens": [
"An",
"integer",
"of",
"miliseconds",
"since",
"unix",... |
7243e3c80b185f82ff252cdb2b34e621baba2241 | jakeogh/Qcodes | qcodes/dataset/guids.py | [
"MIT"
] | Python | filter_guids_by_parts | List[str] | def filter_guids_by_parts(guids: Sequence[str],
location: Optional[int] = None,
sample_id: Optional[int] = None,
work_station: Optional[int] = None) -> List[str]:
"""
Filter a sequence of GUIDs by location, sample_id and/or work_stati... |
Filter a sequence of GUIDs by location, sample_id and/or work_station.
Args:
guids: Sequence of guids that should be filtered.
location: Location code to match
sample_id: Sample_id to match
work_station: Workstation to match
Returns:
A list of GUIDs that matches th... | Filter a sequence of GUIDs by location, sample_id and/or work_station. | [
"Filter",
"a",
"sequence",
"of",
"GUIDs",
"by",
"location",
"sample_id",
"and",
"/",
"or",
"work_station",
"."
] | def filter_guids_by_parts(guids: Sequence[str],
location: Optional[int] = None,
sample_id: Optional[int] = None,
work_station: Optional[int] = None) -> List[str]:
matched_guids = []
for guid in guids:
guid_dict = parse_guid(gu... | [
"def",
"filter_guids_by_parts",
"(",
"guids",
":",
"Sequence",
"[",
"str",
"]",
",",
"location",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"sample_id",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"work_station",
":",
"Optional",
"[",
... | Filter a sequence of GUIDs by location, sample_id and/or work_station. | [
"Filter",
"a",
"sequence",
"of",
"GUIDs",
"by",
"location",
"sample_id",
"and",
"/",
"or",
"work_station",
"."
] | [
"\"\"\"\n Filter a sequence of GUIDs by location, sample_id and/or work_station.\n\n Args:\n guids: Sequence of guids that should be filtered.\n location: Location code to match\n sample_id: Sample_id to match\n work_station: Workstation to match\n\n Returns:\n A list of ... | [
{
"param": "guids",
"type": "Sequence[str]"
},
{
"param": "location",
"type": "Optional[int]"
},
{
"param": "sample_id",
"type": "Optional[int]"
},
{
"param": "work_station",
"type": "Optional[int]"
}
] | {
"returns": [
{
"docstring": "A list of GUIDs that matches the supplied parts.",
"docstring_tokens": [
"A",
"list",
"of",
"GUIDs",
"that",
"matches",
"the",
"supplied",
"parts",
"."
],
"type": null
}
],
... |
7243e3c80b185f82ff252cdb2b34e621baba2241 | jakeogh/Qcodes | qcodes/dataset/guids.py | [
"MIT"
] | Python | validate_guid_format | None | def validate_guid_format(guid: str) -> None:
"""
Validate the format of the given guid. This function does not check the
correctness of the data inside the guid (e.g. timestamps in the far
future)
"""
if _guid_pattern.match(guid):
return
else:
raise ValueError(f'Did not r... |
Validate the format of the given guid. This function does not check the
correctness of the data inside the guid (e.g. timestamps in the far
future)
| Validate the format of the given guid. This function does not check the
correctness of the data inside the guid | [
"Validate",
"the",
"format",
"of",
"the",
"given",
"guid",
".",
"This",
"function",
"does",
"not",
"check",
"the",
"correctness",
"of",
"the",
"data",
"inside",
"the",
"guid"
] | def validate_guid_format(guid: str) -> None:
if _guid_pattern.match(guid):
return
else:
raise ValueError(f'Did not receive a valid guid. Got {guid}') | [
"def",
"validate_guid_format",
"(",
"guid",
":",
"str",
")",
"->",
"None",
":",
"if",
"_guid_pattern",
".",
"match",
"(",
"guid",
")",
":",
"return",
"else",
":",
"raise",
"ValueError",
"(",
"f'Did not receive a valid guid. Got {guid}'",
")"
] | Validate the format of the given guid. | [
"Validate",
"the",
"format",
"of",
"the",
"given",
"guid",
"."
] | [
"\"\"\"\n Validate the format of the given guid. This function does not check the\n correctness of the data inside the guid (e.g. timestamps in the far\n future)\n \"\"\""
] | [
{
"param": "guid",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "guid",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
dcc7e54d01798fb437d4ac578b84fee6d6b98e8e | jakeogh/Qcodes | qcodes/dataset/sqlite/db_upgrades/upgrade_2_to_3.py | [
"MIT"
] | Python | upgrade_2_to_3 | None | def upgrade_2_to_3(conn: ConnectionPlus) -> None:
"""
Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a Run... |
Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object
| Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object | [
"Perform",
"the",
"upgrade",
"from",
"version",
"2",
"to",
"version",
"3",
"Insert",
"a",
"new",
"column",
"run_description",
"to",
"the",
"runs",
"table",
"and",
"fill",
"it",
"out",
"for",
"exisitng",
"runs",
"with",
"information",
"retrieved",
"from",
"th... | def upgrade_2_to_3(conn: ConnectionPlus) -> None:
no_of_runs_query = "SELECT max(run_id) FROM runs"
no_of_runs = one(atomic_transaction(conn, no_of_runs_query), 'max(run_id)')
no_of_runs = no_of_runs or 0
with atomic(conn) as conn:
sql = "ALTER TABLE runs ADD COLUMN run_description TEXT"
... | [
"def",
"upgrade_2_to_3",
"(",
"conn",
":",
"ConnectionPlus",
")",
"->",
"None",
":",
"no_of_runs_query",
"=",
"\"SELECT max(run_id) FROM runs\"",
"no_of_runs",
"=",
"one",
"(",
"atomic_transaction",
"(",
"conn",
",",
"no_of_runs_query",
")",
",",
"'max(run_id)'",
")... | Perform the upgrade from version 2 to version 3
Insert a new column, run_description, to the runs table and fill it out
for exisitng runs with information retrieved from the layouts and
dependencies tables represented as the json output of a RunDescriber
object | [
"Perform",
"the",
"upgrade",
"from",
"version",
"2",
"to",
"version",
"3",
"Insert",
"a",
"new",
"column",
"run_description",
"to",
"the",
"runs",
"table",
"and",
"fill",
"it",
"out",
"for",
"exisitng",
"runs",
"with",
"information",
"retrieved",
"from",
"th... | [
"\"\"\"\n Perform the upgrade from version 2 to version 3\n\n Insert a new column, run_description, to the runs table and fill it out\n for exisitng runs with information retrieved from the layouts and\n dependencies tables represented as the json output of a RunDescriber\n object\n \"\"\"",
"# ... | [
{
"param": "conn",
"type": "ConnectionPlus"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "ConnectionPlus",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a9fbd97d6d5c575291da4aa352b5acffb898238d | jakeogh/Qcodes | qcodes/instrument_drivers/AlazarTech/helpers.py | [
"MIT"
] | Python | query_pcie_link_speed | float | def query_pcie_link_speed(self) -> float:
"""Query PCIE link speed in GB/s"""
# See the ATS-SDK programmer's guide about the encoding
# of the PCIE link speed.
link_speed_int = self.query(self.CAPABILITIES.GET_PCIE_LINK_SPEED)
link_speed = link_speed_int * 2.5 / 10
return... | Query PCIE link speed in GB/s | Query PCIE link speed in GB/s | [
"Query",
"PCIE",
"link",
"speed",
"in",
"GB",
"/",
"s"
] | def query_pcie_link_speed(self) -> float:
link_speed_int = self.query(self.CAPABILITIES.GET_PCIE_LINK_SPEED)
link_speed = link_speed_int * 2.5 / 10
return link_speed | [
"def",
"query_pcie_link_speed",
"(",
"self",
")",
"->",
"float",
":",
"link_speed_int",
"=",
"self",
".",
"query",
"(",
"self",
".",
"CAPABILITIES",
".",
"GET_PCIE_LINK_SPEED",
")",
"link_speed",
"=",
"link_speed_int",
"*",
"2.5",
"/",
"10",
"return",
"link_sp... | Query PCIE link speed in GB/s | [
"Query",
"PCIE",
"link",
"speed",
"in",
"GB",
"/",
"s"
] | [
"\"\"\"Query PCIE link speed in GB/s\"\"\"",
"# See the ATS-SDK programmer's guide about the encoding",
"# of the PCIE link speed."
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a9fbd97d6d5c575291da4aa352b5acffb898238d | jakeogh/Qcodes | qcodes/instrument_drivers/AlazarTech/helpers.py | [
"MIT"
] | Python | query_firmware_version | str | def query_firmware_version(self) -> str:
"""
Query firmware version in "<major>.<minor>" format
The firmware version reported should match the version number of
downloadable fw files from AlazarTech. But note that the firmware
version has often been found to be incorrect for sev... |
Query firmware version in "<major>.<minor>" format
The firmware version reported should match the version number of
downloadable fw files from AlazarTech. But note that the firmware
version has often been found to be incorrect for several firmware
versions. At the time of writi... | Query firmware version in "." format
The firmware version reported should match the version number of
downloadable fw files from AlazarTech. But note that the firmware
version has often been found to be incorrect for several firmware
versions. At the time of writing it is known to be correct for the
9360 (v 21.07) and ... | [
"Query",
"firmware",
"version",
"in",
"\"",
".",
"\"",
"format",
"The",
"firmware",
"version",
"reported",
"should",
"match",
"the",
"version",
"number",
"of",
"downloadable",
"fw",
"files",
"from",
"AlazarTech",
".",
"But",
"note",
"that",
"the",
"firmware",
... | def query_firmware_version(self) -> str:
asopc_type = self.query_asopc_type()
firmware_major = (asopc_type >> 16) & 0xff
firmware_minor = (asopc_type >> 24) & 0xf
firmware_version = f'{firmware_major}.{firmware_minor:02d}'
return firmware_version | [
"def",
"query_firmware_version",
"(",
"self",
")",
"->",
"str",
":",
"asopc_type",
"=",
"self",
".",
"query_asopc_type",
"(",
")",
"firmware_major",
"=",
"(",
"asopc_type",
">>",
"16",
")",
"&",
"0xff",
"firmware_minor",
"=",
"(",
"asopc_type",
">>",
"24",
... | Query firmware version in "<major>.<minor>" format
The firmware version reported should match the version number of
downloadable fw files from AlazarTech. | [
"Query",
"firmware",
"version",
"in",
"\"",
"<major",
">",
".",
"<minor",
">",
"\"",
"format",
"The",
"firmware",
"version",
"reported",
"should",
"match",
"the",
"version",
"number",
"of",
"downloadable",
"fw",
"files",
"from",
"AlazarTech",
"."
] | [
"\"\"\"\n Query firmware version in \"<major>.<minor>\" format\n\n The firmware version reported should match the version number of\n downloadable fw files from AlazarTech. But note that the firmware\n version has often been found to be incorrect for several firmware\n versions. A... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _set_center | None | def _set_center(self, val: float) -> None:
"""
Sets center frequency and updates start and stop frequencies if they
change.
"""
self.write(f":SENSe:FREQuency:CENTer {val}")
self.update_trace() |
Sets center frequency and updates start and stop frequencies if they
change.
| Sets center frequency and updates start and stop frequencies if they
change. | [
"Sets",
"center",
"frequency",
"and",
"updates",
"start",
"and",
"stop",
"frequencies",
"if",
"they",
"change",
"."
] | def _set_center(self, val: float) -> None:
self.write(f":SENSe:FREQuency:CENTer {val}")
self.update_trace() | [
"def",
"_set_center",
"(",
"self",
",",
"val",
":",
"float",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"f\":SENSe:FREQuency:CENTer {val}\"",
")",
"self",
".",
"update_trace",
"(",
")"
] | Sets center frequency and updates start and stop frequencies if they
change. | [
"Sets",
"center",
"frequency",
"and",
"updates",
"start",
"and",
"stop",
"frequencies",
"if",
"they",
"change",
"."
] | [
"\"\"\"\n Sets center frequency and updates start and stop frequencies if they\n change.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "float",
"docstring": null,
"docstring_tokens":... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _set_span | None | def _set_span(self, val: float) -> None:
"""
Sets frequency span and updates start and stop frequencies if they
change.
"""
self.write(f":SENSe:FREQuency:SPAN {val}")
self.update_trace() |
Sets frequency span and updates start and stop frequencies if they
change.
| Sets frequency span and updates start and stop frequencies if they
change. | [
"Sets",
"frequency",
"span",
"and",
"updates",
"start",
"and",
"stop",
"frequencies",
"if",
"they",
"change",
"."
] | def _set_span(self, val: float) -> None:
self.write(f":SENSe:FREQuency:SPAN {val}")
self.update_trace() | [
"def",
"_set_span",
"(",
"self",
",",
"val",
":",
"float",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"f\":SENSe:FREQuency:SPAN {val}\"",
")",
"self",
".",
"update_trace",
"(",
")"
] | Sets frequency span and updates start and stop frequencies if they
change. | [
"Sets",
"frequency",
"span",
"and",
"updates",
"start",
"and",
"stop",
"frequencies",
"if",
"they",
"change",
"."
] | [
"\"\"\"\n Sets frequency span and updates start and stop frequencies if they\n change.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "float",
"docstring": null,
"docstring_tokens":... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _set_npts | None | def _set_npts(self, val: int) -> None:
"""
Sets number of points for sweep
"""
self.write(f":SENSe:SWEep:POINts {val}") |
Sets number of points for sweep
| Sets number of points for sweep | [
"Sets",
"number",
"of",
"points",
"for",
"sweep"
] | def _set_npts(self, val: int) -> None:
self.write(f":SENSe:SWEep:POINts {val}") | [
"def",
"_set_npts",
"(",
"self",
",",
"val",
":",
"int",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"f\":SENSe:SWEep:POINts {val}\"",
")"
] | Sets number of points for sweep | [
"Sets",
"number",
"of",
"points",
"for",
"sweep"
] | [
"\"\"\"\n Sets number of points for sweep\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "int",
"docstring": null,
"docstring_tokens": [... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _get_data | ParamRawDataType | def _get_data(self, trace_num: int) -> ParamRawDataType:
"""
Gets data from the measurement.
"""
try:
timeout = self.sweep_time() + self.root_instrument._additional_wait
with self.root_instrument.timeout.set_to(timeout):
data_str = self.ask(f":READ... |
Gets data from the measurement.
| Gets data from the measurement. | [
"Gets",
"data",
"from",
"the",
"measurement",
"."
] | def _get_data(self, trace_num: int) -> ParamRawDataType:
try:
timeout = self.sweep_time() + self.root_instrument._additional_wait
with self.root_instrument.timeout.set_to(timeout):
data_str = self.ask(f":READ:"
f"{self.root_instrument.m... | [
"def",
"_get_data",
"(",
"self",
",",
"trace_num",
":",
"int",
")",
"->",
"ParamRawDataType",
":",
"try",
":",
"timeout",
"=",
"self",
".",
"sweep_time",
"(",
")",
"+",
"self",
".",
"root_instrument",
".",
"_additional_wait",
"with",
"self",
".",
"root_ins... | Gets data from the measurement. | [
"Gets",
"data",
"from",
"the",
"measurement",
"."
] | [
"\"\"\"\n Gets data from the measurement.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "trace_num",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "trace_num",
"type": "int",
"docstring": null,
"docstring_toke... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | update_trace | None | def update_trace(self) -> None:
"""
Updates start and stop frequencies whenever span of/or center frequency
is updated.
"""
self.start()
self.stop() |
Updates start and stop frequencies whenever span of/or center frequency
is updated.
| Updates start and stop frequencies whenever span of/or center frequency
is updated. | [
"Updates",
"start",
"and",
"stop",
"frequencies",
"whenever",
"span",
"of",
"/",
"or",
"center",
"frequency",
"is",
"updated",
"."
] | def update_trace(self) -> None:
self.start()
self.stop() | [
"def",
"update_trace",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"start",
"(",
")",
"self",
".",
"stop",
"(",
")"
] | Updates start and stop frequencies whenever span of/or center frequency
is updated. | [
"Updates",
"start",
"and",
"stop",
"frequencies",
"whenever",
"span",
"of",
"/",
"or",
"center",
"frequency",
"is",
"updated",
"."
] | [
"\"\"\"\n Updates start and stop frequencies whenever span of/or center frequency\n is updated.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | autotune | None | def autotune(self) -> None:
"""
Autotune quickly get to the most likely signal of interest, and
position it optimally on the display.
"""
self.write(":SENS:FREQuency:TUNE:IMMediate")
self.center() |
Autotune quickly get to the most likely signal of interest, and
position it optimally on the display.
| Autotune quickly get to the most likely signal of interest, and
position it optimally on the display. | [
"Autotune",
"quickly",
"get",
"to",
"the",
"most",
"likely",
"signal",
"of",
"interest",
"and",
"position",
"it",
"optimally",
"on",
"the",
"display",
"."
] | def autotune(self) -> None:
self.write(":SENS:FREQuency:TUNE:IMMediate")
self.center() | [
"def",
"autotune",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"\":SENS:FREQuency:TUNE:IMMediate\"",
")",
"self",
".",
"center",
"(",
")"
] | Autotune quickly get to the most likely signal of interest, and
position it optimally on the display. | [
"Autotune",
"quickly",
"get",
"to",
"the",
"most",
"likely",
"signal",
"of",
"interest",
"and",
"position",
"it",
"optimally",
"on",
"the",
"display",
"."
] | [
"\"\"\"\n Autotune quickly get to the most likely signal of interest, and\n position it optimally on the display.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _set_start_offset | None | def _set_start_offset(self, val: float) -> None:
"""
Sets start offset for frequency in the plot
"""
stop_offset = self.stop_offset()
self.write(f":SENSe:LPLot:FREQuency:OFFSet:STARt {val}")
start_offset = self.start_offset()
if abs(val - start_offset) >= 1:
... |
Sets start offset for frequency in the plot
| Sets start offset for frequency in the plot | [
"Sets",
"start",
"offset",
"for",
"frequency",
"in",
"the",
"plot"
] | def _set_start_offset(self, val: float) -> None:
stop_offset = self.stop_offset()
self.write(f":SENSe:LPLot:FREQuency:OFFSet:STARt {val}")
start_offset = self.start_offset()
if abs(val - start_offset) >= 1:
self.log.warning(
f"Could not set start offset to {va... | [
"def",
"_set_start_offset",
"(",
"self",
",",
"val",
":",
"float",
")",
"->",
"None",
":",
"stop_offset",
"=",
"self",
".",
"stop_offset",
"(",
")",
"self",
".",
"write",
"(",
"f\":SENSe:LPLot:FREQuency:OFFSet:STARt {val}\"",
")",
"start_offset",
"=",
"self",
... | Sets start offset for frequency in the plot | [
"Sets",
"start",
"offset",
"for",
"frequency",
"in",
"the",
"plot"
] | [
"\"\"\"\n Sets start offset for frequency in the plot\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "float",
"docstring": null,
"docstring_tokens":... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _set_stop_offset | None | def _set_stop_offset(self, val: float) -> None:
"""
Sets stop offset for frequency in the plot
"""
start_offset = self.start_offset()
self.write(f":SENSe:LPLot:FREQuency:OFFSet:STOP {val}")
stop_offset = self.stop_offset()
if abs(val - stop_offset) >= 1:
... |
Sets stop offset for frequency in the plot
| Sets stop offset for frequency in the plot | [
"Sets",
"stop",
"offset",
"for",
"frequency",
"in",
"the",
"plot"
] | def _set_stop_offset(self, val: float) -> None:
start_offset = self.start_offset()
self.write(f":SENSe:LPLot:FREQuency:OFFSet:STOP {val}")
stop_offset = self.stop_offset()
if abs(val - stop_offset) >= 1:
self.log.warning(
f"Could not set stop offset to {val} s... | [
"def",
"_set_stop_offset",
"(",
"self",
",",
"val",
":",
"float",
")",
"->",
"None",
":",
"start_offset",
"=",
"self",
".",
"start_offset",
"(",
")",
"self",
".",
"write",
"(",
"f\":SENSe:LPLot:FREQuency:OFFSet:STOP {val}\"",
")",
"stop_offset",
"=",
"self",
"... | Sets stop offset for frequency in the plot | [
"Sets",
"stop",
"offset",
"for",
"frequency",
"in",
"the",
"plot"
] | [
"\"\"\"\n Sets stop offset for frequency in the plot\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "float",
"docstring": null,
"docstring_tokens":... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _get_data | ParamRawDataType | def _get_data(self, trace_num: int) -> ParamRawDataType:
"""
Gets data from the measurement.
"""
raw_data = self.ask(f":READ:{self.root_instrument.measurement()}{1}?")
trace_res_details = np.array(
raw_data.rstrip().split(",")
).astype("float64")
if l... |
Gets data from the measurement.
| Gets data from the measurement. | [
"Gets",
"data",
"from",
"the",
"measurement",
"."
] | def _get_data(self, trace_num: int) -> ParamRawDataType:
raw_data = self.ask(f":READ:{self.root_instrument.measurement()}{1}?")
trace_res_details = np.array(
raw_data.rstrip().split(",")
).astype("float64")
if len(trace_res_details) != 7 or (
len(trace_res_det... | [
"def",
"_get_data",
"(",
"self",
",",
"trace_num",
":",
"int",
")",
"->",
"ParamRawDataType",
":",
"raw_data",
"=",
"self",
".",
"ask",
"(",
"f\":READ:{self.root_instrument.measurement()}{1}?\"",
")",
"trace_res_details",
"=",
"np",
".",
"array",
"(",
"raw_data",
... | Gets data from the measurement. | [
"Gets",
"data",
"from",
"the",
"measurement",
"."
] | [
"\"\"\"\n Gets data from the measurement.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "trace_num",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "trace_num",
"type": "int",
"docstring": null,
"docstring_toke... |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | autotune | None | def autotune(self) -> None:
"""
On autotune, the measurement automatically searches for and tunes to
the strongest signal in the full span of the analyzer.
"""
self.write(":SENSe:FREQuency:CARRier:SEARch")
self.start_offset()
self.stop_offset() |
On autotune, the measurement automatically searches for and tunes to
the strongest signal in the full span of the analyzer.
| On autotune, the measurement automatically searches for and tunes to
the strongest signal in the full span of the analyzer. | [
"On",
"autotune",
"the",
"measurement",
"automatically",
"searches",
"for",
"and",
"tunes",
"to",
"the",
"strongest",
"signal",
"in",
"the",
"full",
"span",
"of",
"the",
"analyzer",
"."
] | def autotune(self) -> None:
self.write(":SENSe:FREQuency:CARRier:SEARch")
self.start_offset()
self.stop_offset() | [
"def",
"autotune",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"\":SENSe:FREQuency:CARRier:SEARch\"",
")",
"self",
".",
"start_offset",
"(",
")",
"self",
".",
"stop_offset",
"(",
")"
] | On autotune, the measurement automatically searches for and tunes to
the strongest signal in the full span of the analyzer. | [
"On",
"autotune",
"the",
"measurement",
"automatically",
"searches",
"for",
"and",
"tunes",
"to",
"the",
"strongest",
"signal",
"in",
"the",
"full",
"span",
"of",
"the",
"analyzer",
"."
] | [
"\"\"\"\n On autotune, the measurement automatically searches for and tunes to\n the strongest signal in the full span of the analyzer.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _available_modes | Tuple[str, ...] | def _available_modes(self) -> Tuple[str, ...]:
"""
Returns present and licensed modes for the instrument.
"""
available_modes = self.ask(":INSTrument:CATalog?")
av_modes = available_modes[1:-1].split(',')
modes: Tuple[str, ...] = ()
for i, mode in enumerate(av_mod... |
Returns present and licensed modes for the instrument.
| Returns present and licensed modes for the instrument. | [
"Returns",
"present",
"and",
"licensed",
"modes",
"for",
"the",
"instrument",
"."
] | def _available_modes(self) -> Tuple[str, ...]:
available_modes = self.ask(":INSTrument:CATalog?")
av_modes = available_modes[1:-1].split(',')
modes: Tuple[str, ...] = ()
for i, mode in enumerate(av_modes):
if i == 0:
modes = modes + (mode.split(' ')[0], )
... | [
"def",
"_available_modes",
"(",
"self",
")",
"->",
"Tuple",
"[",
"str",
",",
"...",
"]",
":",
"available_modes",
"=",
"self",
".",
"ask",
"(",
"\":INSTrument:CATalog?\"",
")",
"av_modes",
"=",
"available_modes",
"[",
"1",
":",
"-",
"1",
"]",
".",
"split"... | Returns present and licensed modes for the instrument. | [
"Returns",
"present",
"and",
"licensed",
"modes",
"for",
"the",
"instrument",
"."
] | [
"\"\"\"\n Returns present and licensed modes for the instrument.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _available_meas | Tuple[str, ...] | def _available_meas(self) -> Tuple[str, ...]:
"""
Gives available measurement with a given mode for the instrument
"""
available_meas = self.ask(":CONFigure:CATalog?")
av_meas = available_meas[1:-1].split(',')
measurements: Tuple[str, ...] = ()
for i, meas in enum... |
Gives available measurement with a given mode for the instrument
| Gives available measurement with a given mode for the instrument | [
"Gives",
"available",
"measurement",
"with",
"a",
"given",
"mode",
"for",
"the",
"instrument"
] | def _available_meas(self) -> Tuple[str, ...]:
available_meas = self.ask(":CONFigure:CATalog?")
av_meas = available_meas[1:-1].split(',')
measurements: Tuple[str, ...] = ()
for i, meas in enumerate(av_meas):
if i == 0:
measurements = measurements + (meas, )
... | [
"def",
"_available_meas",
"(",
"self",
")",
"->",
"Tuple",
"[",
"str",
",",
"...",
"]",
":",
"available_meas",
"=",
"self",
".",
"ask",
"(",
"\":CONFigure:CATalog?\"",
")",
"av_meas",
"=",
"available_meas",
"[",
"1",
":",
"-",
"1",
"]",
".",
"split",
"... | Gives available measurement with a given mode for the instrument | [
"Gives",
"available",
"measurement",
"with",
"a",
"given",
"mode",
"for",
"the",
"instrument"
] | [
"\"\"\"\n Gives available measurement with a given mode for the instrument\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
52198acdf629482d922a6438c15b4f2f7ca56b57 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/N9030B.py | [
"MIT"
] | Python | _enable_cont_meas | None | def _enable_cont_meas(self, val: str) -> None:
"""
Sets continuous measurement to ON or OFF.
"""
self.write(f":INITiate:CONTinuous {val}") |
Sets continuous measurement to ON or OFF.
| Sets continuous measurement to ON or OFF. | [
"Sets",
"continuous",
"measurement",
"to",
"ON",
"or",
"OFF",
"."
] | def _enable_cont_meas(self, val: str) -> None:
self.write(f":INITiate:CONTinuous {val}") | [
"def",
"_enable_cont_meas",
"(",
"self",
",",
"val",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"write",
"(",
"f\":INITiate:CONTinuous {val}\"",
")"
] | Sets continuous measurement to ON or OFF. | [
"Sets",
"continuous",
"measurement",
"to",
"ON",
"or",
"OFF",
"."
] | [
"\"\"\"\n Sets continuous measurement to ON or OFF.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "val",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "val",
"type": "str",
"docstring": null,
"docstring_tokens": [... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | open | null | def open(self, filename, mode, encoding=None):
"""
Mimic the interface of the built in open context manager.
Args:
filename (str): path relative to base_location.
mode (str): 'r' (read), 'w' (write), or 'a' (append).
Other open modes are not supported be... |
Mimic the interface of the built in open context manager.
Args:
filename (str): path relative to base_location.
mode (str): 'r' (read), 'w' (write), or 'a' (append).
Other open modes are not supported because we don't want
to force all IO manage... | Mimic the interface of the built in open context manager. | [
"Mimic",
"the",
"interface",
"of",
"the",
"built",
"in",
"open",
"context",
"manager",
"."
] | def open(self, filename, mode, encoding=None):
if mode not in ALLOWED_OPEN_MODES:
raise ValueError(f'mode {mode} not allowed in IO managers')
filepath = self.to_path(filename)
dirpath = os.path.dirname(filepath)
if not os.path.exists(dirpath):
os.makedirs(dirpath)... | [
"def",
"open",
"(",
"self",
",",
"filename",
",",
"mode",
",",
"encoding",
"=",
"None",
")",
":",
"if",
"mode",
"not",
"in",
"ALLOWED_OPEN_MODES",
":",
"raise",
"ValueError",
"(",
"f'mode {mode} not allowed in IO managers'",
")",
"filepath",
"=",
"self",
".",
... | Mimic the interface of the built in open context manager. | [
"Mimic",
"the",
"interface",
"of",
"the",
"built",
"in",
"open",
"context",
"manager",
"."
] | [
"\"\"\"\n Mimic the interface of the built in open context manager.\n\n Args:\n filename (str): path relative to base_location.\n\n mode (str): 'r' (read), 'w' (write), or 'a' (append).\n Other open modes are not supported because we don't want\n to ... | [
{
"param": "self",
"type": null
},
{
"param": "filename",
"type": null
},
{
"param": "mode",
"type": null
},
{
"param": "encoding",
"type": null
}
] | {
"returns": [
{
"docstring": "context manager yielding the open file",
"docstring_tokens": [
"context",
"manager",
"yielding",
"the",
"open",
"file"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | to_path | <not_specific> | def to_path(self, location):
"""
Convert a location string into a path on the local file system.
For DiskIO this just fixes slashes and prepends the base location,
doing nothing active with the file. But for other io managers that
refer to remote storage, this method may actuall... |
Convert a location string into a path on the local file system.
For DiskIO this just fixes slashes and prepends the base location,
doing nothing active with the file. But for other io managers that
refer to remote storage, this method may actually fetch the file and
put it at a... | Convert a location string into a path on the local file system.
For DiskIO this just fixes slashes and prepends the base location,
doing nothing active with the file. But for other io managers that
refer to remote storage, this method may actually fetch the file and
put it at a temporary local path. | [
"Convert",
"a",
"location",
"string",
"into",
"a",
"path",
"on",
"the",
"local",
"file",
"system",
".",
"For",
"DiskIO",
"this",
"just",
"fixes",
"slashes",
"and",
"prepends",
"the",
"base",
"location",
"doing",
"nothing",
"active",
"with",
"the",
"file",
... | def to_path(self, location):
location = self._normalize_slashes(location)
if self.base_location:
return os.path.join(self.base_location, location)
else:
return location | [
"def",
"to_path",
"(",
"self",
",",
"location",
")",
":",
"location",
"=",
"self",
".",
"_normalize_slashes",
"(",
"location",
")",
"if",
"self",
".",
"base_location",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"base_location",
",",... | Convert a location string into a path on the local file system. | [
"Convert",
"a",
"location",
"string",
"into",
"a",
"path",
"on",
"the",
"local",
"file",
"system",
"."
] | [
"\"\"\"\n Convert a location string into a path on the local file system.\n\n For DiskIO this just fixes slashes and prepends the base location,\n doing nothing active with the file. But for other io managers that\n refer to remote storage, this method may actually fetch the file and\n ... | [
{
"param": "self",
"type": null
},
{
"param": "location",
"type": null
}
] | {
"returns": [
{
"docstring": "The path on disk to which this location maps.",
"docstring_tokens": [
"The",
"path",
"on",
"disk",
"to",
"which",
"this",
"location",
"maps",
"."
],
"type": "str"
}
],
"ra... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | to_location | <not_specific> | def to_location(self, path):
"""
Convert a local filesystem path into a location string.
Args:
path (str): a path on the local file system.
Returns:
str: the location string corresponding to this path.
"""
if self.base_location:
retur... |
Convert a local filesystem path into a location string.
Args:
path (str): a path on the local file system.
Returns:
str: the location string corresponding to this path.
| Convert a local filesystem path into a location string. | [
"Convert",
"a",
"local",
"filesystem",
"path",
"into",
"a",
"location",
"string",
"."
] | def to_location(self, path):
if self.base_location:
return os.path.join(self.base_location, path)
else:
return path | [
"def",
"to_location",
"(",
"self",
",",
"path",
")",
":",
"if",
"self",
".",
"base_location",
":",
"return",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"base_location",
",",
"path",
")",
"else",
":",
"return",
"path"
] | Convert a local filesystem path into a location string. | [
"Convert",
"a",
"local",
"filesystem",
"path",
"into",
"a",
"location",
"string",
"."
] | [
"\"\"\"\n Convert a local filesystem path into a location string.\n\n Args:\n path (str): a path on the local file system.\n\n Returns:\n str: the location string corresponding to this path.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "path",
"type": null
}
] | {
"returns": [
{
"docstring": "the location string corresponding to this path.",
"docstring_tokens": [
"the",
"location",
"string",
"corresponding",
"to",
"this",
"path",
"."
],
"type": "str"
}
],
"raises": [],
"para... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | list | <not_specific> | def list(self, location, maxdepth=1, include_dirs=False):
"""
Return all files that match location.
This is either files whose names match up to an arbitrary extension,
or any files within an exactly matching directory name.
Args:
location (str): the location to mat... |
Return all files that match location.
This is either files whose names match up to an arbitrary extension,
or any files within an exactly matching directory name.
Args:
location (str): the location to match.
May contain the usual path wildcards * and ?
... | Return all files that match location.
This is either files whose names match up to an arbitrary extension,
or any files within an exactly matching directory name. | [
"Return",
"all",
"files",
"that",
"match",
"location",
".",
"This",
"is",
"either",
"files",
"whose",
"names",
"match",
"up",
"to",
"an",
"arbitrary",
"extension",
"or",
"any",
"files",
"within",
"an",
"exactly",
"matching",
"directory",
"name",
"."
] | def list(self, location, maxdepth=1, include_dirs=False):
location = self._normalize_slashes(location)
search_dir, pattern = os.path.split(location)
path = self.to_path(search_dir)
if not os.path.isdir(path):
return []
matches = [fn for fn in os.listdir(path) if fnmat... | [
"def",
"list",
"(",
"self",
",",
"location",
",",
"maxdepth",
"=",
"1",
",",
"include_dirs",
"=",
"False",
")",
":",
"location",
"=",
"self",
".",
"_normalize_slashes",
"(",
"location",
")",
"search_dir",
",",
"pattern",
"=",
"os",
".",
"path",
".",
"s... | Return all files that match location. | [
"Return",
"all",
"files",
"that",
"match",
"location",
"."
] | [
"\"\"\"\n Return all files that match location.\n\n This is either files whose names match up to an arbitrary extension,\n or any files within an exactly matching directory name.\n\n Args:\n location (str): the location to match.\n May contain the usual path wil... | [
{
"param": "self",
"type": null
},
{
"param": "location",
"type": null
},
{
"param": "maxdepth",
"type": null
},
{
"param": "include_dirs",
"type": null
}
] | {
"returns": [
{
"docstring": "A list of matching files and/or directories, as locations\nrelative to our base_location.",
"docstring_tokens": [
"A",
"list",
"of",
"matching",
"files",
"and",
"/",
"or",
"directories",
"as"... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | remove | null | def remove(self, filename):
"""Delete a file or folder and prune the directory tree."""
path = self.to_path(filename)
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
filepath = os.path.split(path)[0]
try:
os.removedir... | Delete a file or folder and prune the directory tree. | Delete a file or folder and prune the directory tree. | [
"Delete",
"a",
"file",
"or",
"folder",
"and",
"prune",
"the",
"directory",
"tree",
"."
] | def remove(self, filename):
path = self.to_path(filename)
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
filepath = os.path.split(path)[0]
try:
os.removedirs(filepath)
except OSError:
pass | [
"def",
"remove",
"(",
"self",
",",
"filename",
")",
":",
"path",
"=",
"self",
".",
"to_path",
"(",
"filename",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"path",
")",
":",
"shutil",
".",
"rmtree",
"(",
"path",
")",
"else",
":",
"os",
".",
... | Delete a file or folder and prune the directory tree. | [
"Delete",
"a",
"file",
"or",
"folder",
"and",
"prune",
"the",
"directory",
"tree",
"."
] | [
"\"\"\"Delete a file or folder and prune the directory tree.\"\"\"",
"# directory was not empty - good that we're not removing it!"
] | [
{
"param": "self",
"type": null
},
{
"param": "filename",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "filename",
"type": null,
"docstring": null,
"docstring_tokens... |
a8cec4eedb409772b4b541c9fe7226dbba69111e | jakeogh/Qcodes | qcodes/data/io.py | [
"MIT"
] | Python | remove_all | null | def remove_all(self, location):
"""
Delete all files/directories in the dataset at this location.
Afterward prunes the directory tree.
"""
for fn in self.list(location):
self.remove(fn) |
Delete all files/directories in the dataset at this location.
Afterward prunes the directory tree.
| Delete all files/directories in the dataset at this location.
Afterward prunes the directory tree. | [
"Delete",
"all",
"files",
"/",
"directories",
"in",
"the",
"dataset",
"at",
"this",
"location",
".",
"Afterward",
"prunes",
"the",
"directory",
"tree",
"."
] | def remove_all(self, location):
for fn in self.list(location):
self.remove(fn) | [
"def",
"remove_all",
"(",
"self",
",",
"location",
")",
":",
"for",
"fn",
"in",
"self",
".",
"list",
"(",
"location",
")",
":",
"self",
".",
"remove",
"(",
"fn",
")"
] | Delete all files/directories in the dataset at this location. | [
"Delete",
"all",
"files",
"/",
"directories",
"in",
"the",
"dataset",
"at",
"this",
"location",
"."
] | [
"\"\"\"\n Delete all files/directories in the dataset at this location.\n\n Afterward prunes the directory tree.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "location",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "location",
"type": null,
"docstring": null,
"docstring_tokens... |
9c16b696e9b8cdbed24cdf8c46d8b7f21edfa17d | jakeogh/Qcodes | qcodes/tests/common.py | [
"MIT"
] | Python | retry_until_does_not_throw | Callable[..., Any] | def retry_until_does_not_throw(
exception_class_to_expect: Type[Exception] = AssertionError,
tries: int = 5,
delay: float = 0.1
) -> Callable[..., Any]:
"""
Call the decorated function given number of times with given delay between
the calls until it does not throw an exception of a ... |
Call the decorated function given number of times with given delay between
the calls until it does not throw an exception of a given class.
If the function throws an exception of a different class, it gets propagated
outside (i.e. the function is not called anymore).
Usage:
>> x = False ... | Call the decorated function given number of times with given delay between
the calls until it does not throw an exception of a given class.
If the function throws an exception of a different class, it gets propagated
outside .
exception_class_to_expect
Only in case of this exception the function will be called agai... | [
"Call",
"the",
"decorated",
"function",
"given",
"number",
"of",
"times",
"with",
"given",
"delay",
"between",
"the",
"calls",
"until",
"it",
"does",
"not",
"throw",
"an",
"exception",
"of",
"a",
"given",
"class",
".",
"If",
"the",
"function",
"throws",
"a... | def retry_until_does_not_throw(
exception_class_to_expect: Type[Exception] = AssertionError,
tries: int = 5,
delay: float = 0.1
) -> Callable[..., Any]:
def retry_until_passes_decorator(func: Callable[..., Any]):
@wraps(func)
def func_retry(*args, **kwargs):
tries... | [
"def",
"retry_until_does_not_throw",
"(",
"exception_class_to_expect",
":",
"Type",
"[",
"Exception",
"]",
"=",
"AssertionError",
",",
"tries",
":",
"int",
"=",
"5",
",",
"delay",
":",
"float",
"=",
"0.1",
")",
"->",
"Callable",
"[",
"...",
",",
"Any",
"]"... | Call the decorated function given number of times with given delay between
the calls until it does not throw an exception of a given class. | [
"Call",
"the",
"decorated",
"function",
"given",
"number",
"of",
"times",
"with",
"given",
"delay",
"between",
"the",
"calls",
"until",
"it",
"does",
"not",
"throw",
"an",
"exception",
"of",
"a",
"given",
"class",
"."
] | [
"\"\"\"\n Call the decorated function given number of times with given delay between\n the calls until it does not throw an exception of a given class.\n\n If the function throws an exception of a different class, it gets propagated\n outside (i.e. the function is not called anymore).\n\n Usage:\n ... | [
{
"param": "exception_class_to_expect",
"type": "Type[Exception]"
},
{
"param": "tries",
"type": "int"
},
{
"param": "delay",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "exception_class_to_expect",
"type": "Type[Exception]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tries",
"type": "int",
"docstring... |
9c16b696e9b8cdbed24cdf8c46d8b7f21edfa17d | jakeogh/Qcodes | qcodes/tests/common.py | [
"MIT"
] | Python | error_caused_by | bool | def error_caused_by(excinfo: 'ExceptionInfo[Any]', cause: str) -> bool:
"""
Helper function to figure out whether an exception was caused by another
exception with the message provided.
Args:
excinfo: the output of with pytest.raises() as excinfo
cause: the error message or a substring ... |
Helper function to figure out whether an exception was caused by another
exception with the message provided.
Args:
excinfo: the output of with pytest.raises() as excinfo
cause: the error message or a substring of it
| Helper function to figure out whether an exception was caused by another
exception with the message provided. | [
"Helper",
"function",
"to",
"figure",
"out",
"whether",
"an",
"exception",
"was",
"caused",
"by",
"another",
"exception",
"with",
"the",
"message",
"provided",
"."
] | def error_caused_by(excinfo: 'ExceptionInfo[Any]', cause: str) -> bool:
exc_repr = excinfo.getrepr()
assert isinstance(exc_repr, ExceptionChainRepr)
chain = exc_repr.chain
error_location = chain[0][1]
root_traceback = chain[0][0]
if error_location is not None:
return cause in str(error_l... | [
"def",
"error_caused_by",
"(",
"excinfo",
":",
"'ExceptionInfo[Any]'",
",",
"cause",
":",
"str",
")",
"->",
"bool",
":",
"exc_repr",
"=",
"excinfo",
".",
"getrepr",
"(",
")",
"assert",
"isinstance",
"(",
"exc_repr",
",",
"ExceptionChainRepr",
")",
"chain",
"... | Helper function to figure out whether an exception was caused by another
exception with the message provided. | [
"Helper",
"function",
"to",
"figure",
"out",
"whether",
"an",
"exception",
"was",
"caused",
"by",
"another",
"exception",
"with",
"the",
"message",
"provided",
"."
] | [
"\"\"\"\n Helper function to figure out whether an exception was caused by another\n exception with the message provided.\n\n Args:\n excinfo: the output of with pytest.raises() as excinfo\n cause: the error message or a substring of it\n \"\"\"",
"# first element of the chain is info ab... | [
{
"param": "excinfo",
"type": "'ExceptionInfo[Any]'"
},
{
"param": "cause",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "excinfo",
"type": "'ExceptionInfo[Any]'",
"docstring": "the output of with pytest.raises() as excinfo",
"docstring_tokens": [
"the",
"output",
"of",
"with",
"pytest",
".",
... |
9c16b696e9b8cdbed24cdf8c46d8b7f21edfa17d | jakeogh/Qcodes | qcodes/tests/common.py | [
"MIT"
] | Python | default_config | null | def default_config(user_config: Optional[str] = None):
"""
Context manager to temporarily establish default config settings.
This is achieved by overwriting the config paths of the user-,
environment-, and current directory-config files with the path of the
config file in the qcodes repository.
... |
Context manager to temporarily establish default config settings.
This is achieved by overwriting the config paths of the user-,
environment-, and current directory-config files with the path of the
config file in the qcodes repository.
Additionally the current config object `qcodes.config` gets co... | Context manager to temporarily establish default config settings.
This is achieved by overwriting the config paths of the user-,
environment-, and current directory-config files with the path of the
config file in the qcodes repository.
Additionally the current config object `qcodes.config` gets copied and
reestablishe... | [
"Context",
"manager",
"to",
"temporarily",
"establish",
"default",
"config",
"settings",
".",
"This",
"is",
"achieved",
"by",
"overwriting",
"the",
"config",
"paths",
"of",
"the",
"user",
"-",
"environment",
"-",
"and",
"current",
"directory",
"-",
"config",
"... | def default_config(user_config: Optional[str] = None):
home_file_name = Config.home_file_name
schema_home_file_name = Config.schema_home_file_name
env_file_name = Config.env_file_name
schema_env_file_name = Config.schema_env_file_name
cwd_file_name = Config.cwd_file_name
schema_cwd_file_name = C... | [
"def",
"default_config",
"(",
"user_config",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
":",
"home_file_name",
"=",
"Config",
".",
"home_file_name",
"schema_home_file_name",
"=",
"Config",
".",
"schema_home_file_name",
"env_file_name",
"=",
"Config",
".",... | Context manager to temporarily establish default config settings. | [
"Context",
"manager",
"to",
"temporarily",
"establish",
"default",
"config",
"settings",
"."
] | [
"\"\"\"\n Context manager to temporarily establish default config settings.\n This is achieved by overwriting the config paths of the user-,\n environment-, and current directory-config files with the path of the\n config file in the qcodes repository.\n Additionally the current config object `qcodes... | [
{
"param": "user_config",
"type": "Optional[str]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "user_config",
"type": "Optional[str]",
"docstring": "represents the user config file content.",
"docstring_tokens": [
"represents",
"the",
"user",
"config",
"file",
"content",
... |
9c16b696e9b8cdbed24cdf8c46d8b7f21edfa17d | jakeogh/Qcodes | qcodes/tests/common.py | [
"MIT"
] | Python | reset_config_on_exit | null | def reset_config_on_exit():
"""
Context manager to clean any modefication of the in memory config on exit
"""
default_config_obj: Optional[DotDict] = copy.deepcopy(
qcodes.config.current_config
)
try:
yield
finally:
qcodes.config.current_config = default_config_obj |
Context manager to clean any modefication of the in memory config on exit
| Context manager to clean any modefication of the in memory config on exit | [
"Context",
"manager",
"to",
"clean",
"any",
"modefication",
"of",
"the",
"in",
"memory",
"config",
"on",
"exit"
] | def reset_config_on_exit():
default_config_obj: Optional[DotDict] = copy.deepcopy(
qcodes.config.current_config
)
try:
yield
finally:
qcodes.config.current_config = default_config_obj | [
"def",
"reset_config_on_exit",
"(",
")",
":",
"default_config_obj",
":",
"Optional",
"[",
"DotDict",
"]",
"=",
"copy",
".",
"deepcopy",
"(",
"qcodes",
".",
"config",
".",
"current_config",
")",
"try",
":",
"yield",
"finally",
":",
"qcodes",
".",
"config",
... | Context manager to clean any modefication of the in memory config on exit | [
"Context",
"manager",
"to",
"clean",
"any",
"modefication",
"of",
"the",
"in",
"memory",
"config",
"on",
"exit"
] | [
"\"\"\"\n Context manager to clean any modefication of the in memory config on exit\n\n \"\"\""
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
410dd6b92c2f176e11f439269fafd119bfaba9f2 | jakeogh/Qcodes | qcodes/tests/drivers/test_MercuryiPS.py | [
"MIT"
] | Python | spherical_limits | <not_specific> | def spherical_limits(x, y, z):
"""
Checks that the field is inside a sphere of radius 2
"""
return np.sqrt(x**2 + y**2 + z**2) <= 2 |
Checks that the field is inside a sphere of radius 2
| Checks that the field is inside a sphere of radius 2 | [
"Checks",
"that",
"the",
"field",
"is",
"inside",
"a",
"sphere",
"of",
"radius",
"2"
] | def spherical_limits(x, y, z):
return np.sqrt(x**2 + y**2 + z**2) <= 2 | [
"def",
"spherical_limits",
"(",
"x",
",",
"y",
",",
"z",
")",
":",
"return",
"np",
".",
"sqrt",
"(",
"x",
"**",
"2",
"+",
"y",
"**",
"2",
"+",
"z",
"**",
"2",
")",
"<=",
"2"
] | Checks that the field is inside a sphere of radius 2 | [
"Checks",
"that",
"the",
"field",
"is",
"inside",
"a",
"sphere",
"of",
"radius",
"2"
] | [
"\"\"\"\n Checks that the field is inside a sphere of radius 2\n \"\"\""
] | [
{
"param": "x",
"type": null
},
{
"param": "y",
"type": null
},
{
"param": "z",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "x",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
410dd6b92c2f176e11f439269fafd119bfaba9f2 | jakeogh/Qcodes | qcodes/tests/drivers/test_MercuryiPS.py | [
"MIT"
] | Python | cylindrical_limits | <not_specific> | def cylindrical_limits(x, y, z):
"""
Checks that the field is inside a particular cylinder
"""
rho_check = np.sqrt(x**2 + y**2) <= 2
z_check = z < 3 and z > -1
return rho_check and z_check |
Checks that the field is inside a particular cylinder
| Checks that the field is inside a particular cylinder | [
"Checks",
"that",
"the",
"field",
"is",
"inside",
"a",
"particular",
"cylinder"
] | def cylindrical_limits(x, y, z):
rho_check = np.sqrt(x**2 + y**2) <= 2
z_check = z < 3 and z > -1
return rho_check and z_check | [
"def",
"cylindrical_limits",
"(",
"x",
",",
"y",
",",
"z",
")",
":",
"rho_check",
"=",
"np",
".",
"sqrt",
"(",
"x",
"**",
"2",
"+",
"y",
"**",
"2",
")",
"<=",
"2",
"z_check",
"=",
"z",
"<",
"3",
"and",
"z",
">",
"-",
"1",
"return",
"rho_check... | Checks that the field is inside a particular cylinder | [
"Checks",
"that",
"the",
"field",
"is",
"inside",
"a",
"particular",
"cylinder"
] | [
"\"\"\"\n Checks that the field is inside a particular cylinder\n \"\"\""
] | [
{
"param": "x",
"type": null
},
{
"param": "y",
"type": null
},
{
"param": "z",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "x",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y",
"type": null,
"docstring": null,
"docstring_tokens": [],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.