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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | bsv | 'MessageBuilder' | def bsv(self,
chnum: Union[constants.ChNr, int],
v_range: Union[constants.VOutputRange, int],
start: float,
stop: float,
i_comp: Optional[float] = None
) -> 'MessageBuilder':
"""
The BSV command sets the voltage search source for th... |
The BSV command sets the voltage search source for the binary search
measurement (MM15). After search stops, the search channel forces the
value specified by the BSM command. This command clears the BSI,
BSSI, and BSSV command settings. This command setting is cleared by
the BSI... | The BSV command sets the voltage search source for the binary search
measurement (MM15). After search stops, the search channel forces the
value specified by the BSM command. This command clears the BSI,
BSSI, and BSSV command settings. This command setting is cleared by
the BSI command.
Execution conditions: If the o... | [
"The",
"BSV",
"command",
"sets",
"the",
"voltage",
"search",
"source",
"for",
"the",
"binary",
"search",
"measurement",
"(",
"MM15",
")",
".",
"After",
"search",
"stops",
"the",
"search",
"channel",
"forces",
"the",
"value",
"specified",
"by",
"the",
"BSM",
... | def bsv(self,
chnum: Union[constants.ChNr, int],
v_range: Union[constants.VOutputRange, int],
start: float,
stop: float,
i_comp: Optional[float] = None
) -> 'MessageBuilder':
cmd = f'BSV {chnum},{v_range},{start},{stop}'
if i_comp i... | [
"def",
"bsv",
"(",
"self",
",",
"chnum",
":",
"Union",
"[",
"constants",
".",
"ChNr",
",",
"int",
"]",
",",
"v_range",
":",
"Union",
"[",
"constants",
".",
"VOutputRange",
",",
"int",
"]",
",",
"start",
":",
"float",
",",
"stop",
":",
"float",
",",... | The BSV command sets the voltage search source for the binary search
measurement (MM15). | [
"The",
"BSV",
"command",
"sets",
"the",
"voltage",
"search",
"source",
"for",
"the",
"binary",
"search",
"measurement",
"(",
"MM15",
")",
"."
] | [
"\"\"\"\n The BSV command sets the voltage search source for the binary search\n measurement (MM15). After search stops, the search channel forces the\n value specified by the BSM command. This command clears the BSI,\n BSSI, and BSSV command settings. This command setting is cleared by\... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Union[constants.ChNr, int]"
},
{
"param": "v_range",
"type": "Union[constants.VOutputRange, int]"
},
{
"param": "start",
"type": "float"
},
{
"param": "stop",
"type": "float"
},
{
"param":... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Union[constants.ChNr, int]",
"docstring": "SMU sea... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | ca | 'MessageBuilder' | def ca(self, slot: Optional[Union[constants.SlotNr, int]] = None
) -> 'MessageBuilder':
"""
This command performs the self-calibration.
The ``*OPC?`` command should be entered after this command to confirm
the completion of the self-calibration. Module condition after this
... |
This command performs the self-calibration.
The ``*OPC?`` command should be entered after this command to confirm
the completion of the self-calibration. Module condition after this
command is the same as the condition by the CL command.
Execution conditions: No channel must b... | This command performs the self-calibration.
The ``*OPC?`` command should be entered after this command to confirm
the completion of the self-calibration. Module condition after this
command is the same as the condition by the CL command.
Execution conditions: No channel must be in the high voltage state (
forcing more... | [
"This",
"command",
"performs",
"the",
"self",
"-",
"calibration",
".",
"The",
"`",
"`",
"*",
"OPC?",
"`",
"`",
"command",
"should",
"be",
"entered",
"after",
"this",
"command",
"to",
"confirm",
"the",
"completion",
"of",
"the",
"self",
"-",
"calibration",
... | def ca(self, slot: Optional[Union[constants.SlotNr, int]] = None
) -> 'MessageBuilder':
cmd = 'CA'
if slot is not None:
cmd += f' {slot}'
self._msg.append(cmd)
return self | [
"def",
"ca",
"(",
"self",
",",
"slot",
":",
"Optional",
"[",
"Union",
"[",
"constants",
".",
"SlotNr",
",",
"int",
"]",
"]",
"=",
"None",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"'CA'",
"if",
"slot",
"is",
"not",
"None",
":",
"cmd",
"+=",
... | This command performs the self-calibration. | [
"This",
"command",
"performs",
"the",
"self",
"-",
"calibration",
"."
] | [
"\"\"\"\n This command performs the self-calibration.\n\n The ``*OPC?`` command should be entered after this command to confirm\n the completion of the self-calibration. Module condition after this\n command is the same as the condition by the CL command.\n\n Execution conditions:... | [
{
"param": "self",
"type": null
},
{
"param": "slot",
"type": "Optional[Union[constants.SlotNr, int]]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slot",
"type": "Optional[Union[constants.SlotNr, int]]",
"docstring... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | cal_query | 'MessageBuilder' | def cal_query(self, slot: Optional[Union[constants.SlotNr, int]] = None
) -> 'MessageBuilder':
"""
This query command performs the self-calibration, and returns the
results. After this command, read the results soon. Module condition
after this command is the same as th... |
This query command performs the self-calibration, and returns the
results. After this command, read the results soon. Module condition
after this command is the same as the condition by the CL command.
Execution Conditions: No channel must be in the high voltage state
(forcing ... | This query command performs the self-calibration, and returns the
results. After this command, read the results soon. Module condition
after this command is the same as the condition by the CL command.
Execution Conditions: No channel must be in the high voltage state
(forcing more than the allowable voltage for the i... | [
"This",
"query",
"command",
"performs",
"the",
"self",
"-",
"calibration",
"and",
"returns",
"the",
"results",
".",
"After",
"this",
"command",
"read",
"the",
"results",
"soon",
".",
"Module",
"condition",
"after",
"this",
"command",
"is",
"the",
"same",
"as... | def cal_query(self, slot: Optional[Union[constants.SlotNr, int]] = None
) -> 'MessageBuilder':
cmd = '*CAL?'
if slot is not None:
cmd += f' {slot}'
self._msg.append(cmd)
return self | [
"def",
"cal_query",
"(",
"self",
",",
"slot",
":",
"Optional",
"[",
"Union",
"[",
"constants",
".",
"SlotNr",
",",
"int",
"]",
"]",
"=",
"None",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"'*CAL?'",
"if",
"slot",
"is",
"not",
"None",
":",
"cmd",... | This query command performs the self-calibration, and returns the
results. | [
"This",
"query",
"command",
"performs",
"the",
"self",
"-",
"calibration",
"and",
"returns",
"the",
"results",
"."
] | [
"\"\"\"\n This query command performs the self-calibration, and returns the\n results. After this command, read the results soon. Module condition\n after this command is the same as the condition by the CL command.\n\n Execution Conditions: No channel must be in the high voltage state\n... | [
{
"param": "self",
"type": null
},
{
"param": "slot",
"type": "Optional[Union[constants.SlotNr, int]]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slot",
"type": "Optional[Union[constants.SlotNr, int]]",
"docstring... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | clcorr | 'MessageBuilder' | def clcorr(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.CLCORR.Mode, int]
) -> 'MessageBuilder':
"""
This query command disables the open/short/load correction function
and clears the frequency list for the correction data measuremen... |
This query command disables the open/short/load correction function
and clears the frequency list for the correction data measurement.
The correction data will be invalid after this command.
Args:
chnum: SMU search source channel number. Integer expression. 1
... | This query command disables the open/short/load correction function
and clears the frequency list for the correction data measurement.
The correction data will be invalid after this command. | [
"This",
"query",
"command",
"disables",
"the",
"open",
"/",
"short",
"/",
"load",
"correction",
"function",
"and",
"clears",
"the",
"frequency",
"list",
"for",
"the",
"correction",
"data",
"measurement",
".",
"The",
"correction",
"data",
"will",
"be",
"invalid... | def clcorr(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.CLCORR.Mode, int]
) -> 'MessageBuilder':
cmd = f'CLCORR {chnum},{mode}'
self._msg.append(cmd)
return self | [
"def",
"clcorr",
"(",
"self",
",",
"chnum",
":",
"Union",
"[",
"constants",
".",
"ChNr",
",",
"int",
"]",
",",
"mode",
":",
"Union",
"[",
"constants",
".",
"CLCORR",
".",
"Mode",
",",
"int",
"]",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"f'C... | This query command disables the open/short/load correction function
and clears the frequency list for the correction data measurement. | [
"This",
"query",
"command",
"disables",
"the",
"open",
"/",
"short",
"/",
"load",
"correction",
"function",
"and",
"clears",
"the",
"frequency",
"list",
"for",
"the",
"correction",
"data",
"measurement",
"."
] | [
"\"\"\"\n This query command disables the open/short/load correction function\n and clears the frequency list for the correction data measurement.\n The correction data will be invalid after this command.\n\n Args:\n chnum: SMU search source channel number. Integer expression.... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Union[constants.ChNr, int]"
},
{
"param": "mode",
"type": "Union[constants.CLCORR.Mode, int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Union[constants.ChNr, int]",
"docstring": "SMU sea... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | dcv | 'MessageBuilder' | def dcv(self, chnum: Union[constants.ChNr, int], voltage: float
) -> 'MessageBuilder':
"""
This command forces DC bias (voltage, up to +- 25 V) from the MFCMU.
When the SCUU (SMU CMU unify unit) is connected, output up to +- 100 V
is available by using the SMU that can be con... |
This command forces DC bias (voltage, up to +- 25 V) from the MFCMU.
When the SCUU (SMU CMU unify unit) is connected, output up to +- 100 V
is available by using the SMU that can be connected to the
Force1/Sense1 terminals.
Execution conditions: The CN/CNX command has been exec... | This command forces DC bias (voltage, up to +- 25 V) from the MFCMU.
When the SCUU (SMU CMU unify unit) is connected, output up to +- 100 V
is available by using the SMU that can be connected to the
Force1/Sense1 terminals.
Execution conditions: The CN/CNX command has been executed for the
specified channel.
If you w... | [
"This",
"command",
"forces",
"DC",
"bias",
"(",
"voltage",
"up",
"to",
"+",
"-",
"25",
"V",
")",
"from",
"the",
"MFCMU",
".",
"When",
"the",
"SCUU",
"(",
"SMU",
"CMU",
"unify",
"unit",
")",
"is",
"connected",
"output",
"up",
"to",
"+",
"-",
"100",
... | def dcv(self, chnum: Union[constants.ChNr, int], voltage: float
) -> 'MessageBuilder':
cmd = f'DCV {chnum},{voltage}'
self._msg.append(cmd)
return self | [
"def",
"dcv",
"(",
"self",
",",
"chnum",
":",
"Union",
"[",
"constants",
".",
"ChNr",
",",
"int",
"]",
",",
"voltage",
":",
"float",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"f'DCV {chnum},{voltage}'",
"self",
".",
"_msg",
".",
"append",
"(",
"c... | This command forces DC bias (voltage, up to +- 25 V) from the MFCMU. | [
"This",
"command",
"forces",
"DC",
"bias",
"(",
"voltage",
"up",
"to",
"+",
"-",
"25",
"V",
")",
"from",
"the",
"MFCMU",
"."
] | [
"\"\"\"\n This command forces DC bias (voltage, up to +- 25 V) from the MFCMU.\n When the SCUU (SMU CMU unify unit) is connected, output up to +- 100 V\n is available by using the SMU that can be connected to the\n Force1/Sense1 terminals.\n\n Execution conditions: The CN/CNX comm... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Union[constants.ChNr, int]"
},
{
"param": "voltage",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Union[constants.ChNr, int]",
"docstring": "MFCMU c... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | mt | 'MessageBuilder' | def mt(self,
h_bias: float,
interval: float,
number: int,
h_base: Optional[float] = None
) -> 'MessageBuilder':
"""
This command sets the timing parameters of the sampling measurement
mode (:attr:`.MM.Mode.SAMPLING`, ``10``).
Refer ... |
This command sets the timing parameters of the sampling measurement
mode (:attr:`.MM.Mode.SAMPLING`, ``10``).
Refer to the programming guide for more information about the ``MT``
command, especially for notes on sampling operation and about setting
interval < 0.002 s.
... |
Refer to the programming guide for more information about the ``MT``
command, especially for notes on sampling operation and about setting
interval < 0.002 s. | [
"Refer",
"to",
"the",
"programming",
"guide",
"for",
"more",
"information",
"about",
"the",
"`",
"`",
"MT",
"`",
"`",
"command",
"especially",
"for",
"notes",
"on",
"sampling",
"operation",
"and",
"about",
"setting",
"interval",
"<",
"0",
".",
"002",
"s",
... | def mt(self,
h_bias: float,
interval: float,
number: int,
h_base: Optional[float] = None
) -> 'MessageBuilder':
cmd = f'MT {h_bias},{interval},{number}'
if h_base is not None:
cmd += f',{h_base}'
self._msg.append(cmd)
ret... | [
"def",
"mt",
"(",
"self",
",",
"h_bias",
":",
"float",
",",
"interval",
":",
"float",
",",
"number",
":",
"int",
",",
"h_base",
":",
"Optional",
"[",
"float",
"]",
"=",
"None",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"f'MT {h_bias},{interval},{nu... | This command sets the timing parameters of the sampling measurement
mode (:attr:`.MM.Mode.SAMPLING`, ``10``). | [
"This",
"command",
"sets",
"the",
"timing",
"parameters",
"of",
"the",
"sampling",
"measurement",
"mode",
"(",
":",
"attr",
":",
"`",
".",
"MM",
".",
"Mode",
".",
"SAMPLING",
"`",
"`",
"`",
"10",
"`",
"`",
")",
"."
] | [
"\"\"\"\n This command sets the timing parameters of the sampling measurement\n mode (:attr:`.MM.Mode.SAMPLING`, ``10``).\n\n Refer to the programming guide for more information about the ``MT``\n command, especially for notes on sampling operation and about setting\n interval < 0... | [
{
"param": "self",
"type": null
},
{
"param": "h_bias",
"type": "float"
},
{
"param": "interval",
"type": "float"
},
{
"param": "number",
"type": "int"
},
{
"param": "h_base",
"type": "Optional[float]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "h_bias",
"type": "float",
"docstring": "Time since the bias value o... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | tmacv | 'MessageBuilder' | def tmacv(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.RangingMode, int],
meas_range: Optional[Union[constants.TMACV.Range, str]] = None
) -> 'MessageBuilder':
"""
This command monitors the MFCMU AC voltage output signal level,
... |
This command monitors the MFCMU AC voltage output signal level,
and returns the measurement data.
Args:
chnum: MFCMU channel number. Integer expression. 1 to 10 or
101 to 1001. See Table 4-1 on page 16.
mode: Ranging mode.
Integer expres... | This command monitors the MFCMU AC voltage output signal level,
and returns the measurement data. | [
"This",
"command",
"monitors",
"the",
"MFCMU",
"AC",
"voltage",
"output",
"signal",
"level",
"and",
"returns",
"the",
"measurement",
"data",
"."
] | def tmacv(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.RangingMode, int],
meas_range: Optional[Union[constants.TMACV.Range, str]] = None
) -> 'MessageBuilder':
cmd = f'TMACV {chnum},{mode}'
if meas_range is not None:
c... | [
"def",
"tmacv",
"(",
"self",
",",
"chnum",
":",
"Union",
"[",
"constants",
".",
"ChNr",
",",
"int",
"]",
",",
"mode",
":",
"Union",
"[",
"constants",
".",
"RangingMode",
",",
"int",
"]",
",",
"meas_range",
":",
"Optional",
"[",
"Union",
"[",
"constan... | This command monitors the MFCMU AC voltage output signal level,
and returns the measurement data. | [
"This",
"command",
"monitors",
"the",
"MFCMU",
"AC",
"voltage",
"output",
"signal",
"level",
"and",
"returns",
"the",
"measurement",
"data",
"."
] | [
"\"\"\"\n This command monitors the MFCMU AC voltage output signal level,\n and returns the measurement data.\n\n Args:\n chnum: MFCMU channel number. Integer expression. 1 to 10 or\n 101 to 1001. See Table 4-1 on page 16.\n\n mode: Ranging mode.\n ... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Union[constants.ChNr, int]"
},
{
"param": "mode",
"type": "Union[constants.RangingMode, int]"
},
{
"param": "meas_range",
"type": "Optional[Union[constants.TMACV.Range, str]]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Union[constants.ChNr, int]",
"docstring": "MFCMU c... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | tsq | 'MessageBuilder' | def tsq(self) -> 'MessageBuilder':
"""
The TSQ command returns the time data from when the TSR command is
sent until this command is sent. The time data will be put in the
data output buffer as same as the measurement data.
This command is effective for all measurement modes, reg... |
The TSQ command returns the time data from when the TSR command is
sent until this command is sent. The time data will be put in the
data output buffer as same as the measurement data.
This command is effective for all measurement modes, regardless of
the TSC setting.
Th... | The TSQ command returns the time data from when the TSR command is
sent until this command is sent. The time data will be put in the
data output buffer as same as the measurement data.
This command is effective for all measurement modes, regardless of
the TSC setting.
This command is not effective for the 4 byte binary... | [
"The",
"TSQ",
"command",
"returns",
"the",
"time",
"data",
"from",
"when",
"the",
"TSR",
"command",
"is",
"sent",
"until",
"this",
"command",
"is",
"sent",
".",
"The",
"time",
"data",
"will",
"be",
"put",
"in",
"the",
"data",
"output",
"buffer",
"as",
... | def tsq(self) -> 'MessageBuilder':
cmd = 'TSQ'
self._msg.append(cmd)
return self | [
"def",
"tsq",
"(",
"self",
")",
"->",
"'MessageBuilder'",
":",
"cmd",
"=",
"'TSQ'",
"self",
".",
"_msg",
".",
"append",
"(",
"cmd",
")",
"return",
"self"
] | The TSQ command returns the time data from when the TSR command is
sent until this command is sent. | [
"The",
"TSQ",
"command",
"returns",
"the",
"time",
"data",
"from",
"when",
"the",
"TSR",
"command",
"is",
"sent",
"until",
"this",
"command",
"is",
"sent",
"."
] | [
"\"\"\"\n The TSQ command returns the time data from when the TSR command is\n sent until this command is sent. The time data will be put in the\n data output buffer as same as the measurement data.\n This command is effective for all measurement modes, regardless of\n the TSC set... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | wdcv | 'MessageBuilder' | def wdcv(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.SweepMode, int],
start: float,
stop: float,
step: float,
i_comp: Optional[float] = None
) -> 'MessageBuilder':
"""
This command sets the DC b... |
This command sets the DC bias sweep source used for the CV (DC bias)
sweep measurement (MM18). The sweep source will be MFCMU or SMU.
Execution Conditions: The CN/CNX command has been executed for the
specified channel. If you want to apply DC voltage over +/- 25 V using
the SCU... | This command sets the DC bias sweep source used for the CV (DC bias)
sweep measurement (MM18). The sweep source will be MFCMU or SMU.
Execution Conditions: The CN/CNX command has been executed for the
specified channel. If you want to apply DC voltage over +/- 25 V using
the SCUU, the SCUU must be connected correctly. ... | [
"This",
"command",
"sets",
"the",
"DC",
"bias",
"sweep",
"source",
"used",
"for",
"the",
"CV",
"(",
"DC",
"bias",
")",
"sweep",
"measurement",
"(",
"MM18",
")",
".",
"The",
"sweep",
"source",
"will",
"be",
"MFCMU",
"or",
"SMU",
".",
"Execution",
"Condi... | def wdcv(self,
chnum: Union[constants.ChNr, int],
mode: Union[constants.SweepMode, int],
start: float,
stop: float,
step: float,
i_comp: Optional[float] = None
) -> 'MessageBuilder':
cmd = f'WDCV {chnum},{mode},{start},{s... | [
"def",
"wdcv",
"(",
"self",
",",
"chnum",
":",
"Union",
"[",
"constants",
".",
"ChNr",
",",
"int",
"]",
",",
"mode",
":",
"Union",
"[",
"constants",
".",
"SweepMode",
",",
"int",
"]",
",",
"start",
":",
"float",
",",
"stop",
":",
"float",
",",
"s... | This command sets the DC bias sweep source used for the CV (DC bias)
sweep measurement (MM18). | [
"This",
"command",
"sets",
"the",
"DC",
"bias",
"sweep",
"source",
"used",
"for",
"the",
"CV",
"(",
"DC",
"bias",
")",
"sweep",
"measurement",
"(",
"MM18",
")",
"."
] | [
"\"\"\"\n This command sets the DC bias sweep source used for the CV (DC bias)\n sweep measurement (MM18). The sweep source will be MFCMU or SMU.\n Execution Conditions: The CN/CNX command has been executed for the\n specified channel. If you want to apply DC voltage over +/- 25 V using\... | [
{
"param": "self",
"type": null
},
{
"param": "chnum",
"type": "Union[constants.ChNr, int]"
},
{
"param": "mode",
"type": "Union[constants.SweepMode, int]"
},
{
"param": "start",
"type": "float"
},
{
"param": "stop",
"type": "float"
},
{
"param": "step... | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "chnum",
"type": "Union[constants.ChNr, int]",
"docstring": null,
... |
5ca186241de23e50263904bdf08349f5c8eddcce | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysightb1500/message_builder.py | [
"MIT"
] | Python | wmdcv | 'MessageBuilder' | def wmdcv(self,
abort: Union[bool, constants.Abort],
post: Optional[Union[constants.WMDCV.Post, int]] = None
) -> 'MessageBuilder':
"""
This command enables or disables the automatic abort function for
the CV (AC level) sweep measurement. The automatic a... |
This command enables or disables the automatic abort function for
the CV (AC level) sweep measurement. The automatic abort
function stops the measurement when one of the following conditions
occurs.
- NULL loop unbalance condition
- IV amplifier saturation condi... | This command enables or disables the automatic abort function for
the CV (AC level) sweep measurement. The automatic abort
function stops the measurement when one of the following conditions
occurs.
NULL loop unbalance condition
IV amplifier saturation condition
Overflow on the AD converter
This command also sets the... | [
"This",
"command",
"enables",
"or",
"disables",
"the",
"automatic",
"abort",
"function",
"for",
"the",
"CV",
"(",
"AC",
"level",
")",
"sweep",
"measurement",
".",
"The",
"automatic",
"abort",
"function",
"stops",
"the",
"measurement",
"when",
"one",
"of",
"t... | def wmdcv(self,
abort: Union[bool, constants.Abort],
post: Optional[Union[constants.WMDCV.Post, int]] = None
) -> 'MessageBuilder':
if isinstance(abort, bool):
_abort = constants.Abort.ENABLED if abort \
else constants.Abort.DISABLED
... | [
"def",
"wmdcv",
"(",
"self",
",",
"abort",
":",
"Union",
"[",
"bool",
",",
"constants",
".",
"Abort",
"]",
",",
"post",
":",
"Optional",
"[",
"Union",
"[",
"constants",
".",
"WMDCV",
".",
"Post",
",",
"int",
"]",
"]",
"=",
"None",
")",
"->",
"'Me... | This command enables or disables the automatic abort function for
the CV (AC level) sweep measurement. | [
"This",
"command",
"enables",
"or",
"disables",
"the",
"automatic",
"abort",
"function",
"for",
"the",
"CV",
"(",
"AC",
"level",
")",
"sweep",
"measurement",
"."
] | [
"\"\"\"\n This command enables or disables the automatic abort function for\n the CV (AC level) sweep measurement. The automatic abort\n function stops the measurement when one of the following conditions\n occurs.\n\n - NULL loop unbalance condition\n - IV amplifie... | [
{
"param": "self",
"type": null
},
{
"param": "abort",
"type": "Union[bool, constants.Abort]"
},
{
"param": "post",
"type": "Optional[Union[constants.WMDCV.Post, int]]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "abort",
"type": "Union[bool, constants.Abort]",
"docstring": "Autom... |
bcb3f97a4f711abe50abaac437a96d471c7e38e0 | jakeogh/Qcodes | qcodes/instrument_drivers/AlazarTech/ats_api.py | [
"MIT"
] | Python | read_register_ | int | def read_register_(self, handle: int, offset: int) -> int:
"""
Read a value from a given offset in the Alazar card's register.
A more convenient version of :meth:`read_register` method
(``AlazarReadRegister``).
Args:
handle: Handle of the board of interest
... |
Read a value from a given offset in the Alazar card's register.
A more convenient version of :meth:`read_register` method
(``AlazarReadRegister``).
Args:
handle: Handle of the board of interest
offset: Offset into the memory to read from
Returns:
... | Read a value from a given offset in the Alazar card's register. | [
"Read",
"a",
"value",
"from",
"a",
"given",
"offset",
"in",
"the",
"Alazar",
"card",
"'",
"s",
"register",
"."
] | def read_register_(self, handle: int, offset: int) -> int:
output = ctypes.c_uint32(0)
self.read_register(
handle,
offset,
ctypes.byref(output),
REGISTER_ACCESS_PASSWORD
)
return output.value | [
"def",
"read_register_",
"(",
"self",
",",
"handle",
":",
"int",
",",
"offset",
":",
"int",
")",
"->",
"int",
":",
"output",
"=",
"ctypes",
".",
"c_uint32",
"(",
"0",
")",
"self",
".",
"read_register",
"(",
"handle",
",",
"offset",
",",
"ctypes",
"."... | Read a value from a given offset in the Alazar card's register. | [
"Read",
"a",
"value",
"from",
"a",
"given",
"offset",
"in",
"the",
"Alazar",
"card",
"'",
"s",
"register",
"."
] | [
"\"\"\"\n Read a value from a given offset in the Alazar card's register.\n\n A more convenient version of :meth:`read_register` method\n (``AlazarReadRegister``).\n\n Args:\n handle: Handle of the board of interest\n offset: Offset into the memory to read from\n\n ... | [
{
"param": "self",
"type": null
},
{
"param": "handle",
"type": "int"
},
{
"param": "offset",
"type": "int"
}
] | {
"returns": [
{
"docstring": "The value read as an integer",
"docstring_tokens": [
"The",
"value",
"read",
"as",
"an",
"integer"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
... |
bcb3f97a4f711abe50abaac437a96d471c7e38e0 | jakeogh/Qcodes | qcodes/instrument_drivers/AlazarTech/ats_api.py | [
"MIT"
] | Python | write_register_ | None | def write_register_(self, handle: int, offset: int, value: int) -> None:
"""
Write a value to a given offset in the Alazar card's register.
A more convenient version of :meth:`write_register` method
(``AlazarWriteRegister``).
Args:
handle: Handle of the board of int... |
Write a value to a given offset in the Alazar card's register.
A more convenient version of :meth:`write_register` method
(``AlazarWriteRegister``).
Args:
handle: Handle of the board of interest
offset: The offset in memory to write to
value: The va... | Write a value to a given offset in the Alazar card's register. | [
"Write",
"a",
"value",
"to",
"a",
"given",
"offset",
"in",
"the",
"Alazar",
"card",
"'",
"s",
"register",
"."
] | def write_register_(self, handle: int, offset: int, value: int) -> None:
self.write_register(
handle, offset, value, REGISTER_ACCESS_PASSWORD) | [
"def",
"write_register_",
"(",
"self",
",",
"handle",
":",
"int",
",",
"offset",
":",
"int",
",",
"value",
":",
"int",
")",
"->",
"None",
":",
"self",
".",
"write_register",
"(",
"handle",
",",
"offset",
",",
"value",
",",
"REGISTER_ACCESS_PASSWORD",
")"... | Write a value to a given offset in the Alazar card's register. | [
"Write",
"a",
"value",
"to",
"a",
"given",
"offset",
"in",
"the",
"Alazar",
"card",
"'",
"s",
"register",
"."
] | [
"\"\"\"\n Write a value to a given offset in the Alazar card's register.\n\n A more convenient version of :meth:`write_register` method\n (``AlazarWriteRegister``).\n\n Args:\n handle: Handle of the board of interest\n offset: The offset in memory to write to\n ... | [
{
"param": "self",
"type": null
},
{
"param": "handle",
"type": "int"
},
{
"param": "offset",
"type": "int"
},
{
"param": "value",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "handle",
"type": "int",
"docstring": "Handle of the board of intere... |
e40e2f64c144c4b8f89e3e1c58402d4d6b435f09 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/private/error_handling.py | [
"MIT"
] | Python | flush_error_queue | None | def flush_error_queue(self, verbose: bool=True) -> None:
"""
Clear the instrument error queue, and prints it.
Args:
verbose: If true, the error messages are printed.
Default: True.
"""
self.log.debug('Flushing error queue...')
err_code, err_... |
Clear the instrument error queue, and prints it.
Args:
verbose: If true, the error messages are printed.
Default: True.
| Clear the instrument error queue, and prints it. | [
"Clear",
"the",
"instrument",
"error",
"queue",
"and",
"prints",
"it",
"."
] | def flush_error_queue(self, verbose: bool=True) -> None:
self.log.debug('Flushing error queue...')
err_code, err_message = self.error()
self.log.debug(f' {err_code}, {err_message}')
if verbose:
print(err_code, err_message)
while err_code != 0:
err_code,... | [
"def",
"flush_error_queue",
"(",
"self",
",",
"verbose",
":",
"bool",
"=",
"True",
")",
"->",
"None",
":",
"self",
".",
"log",
".",
"debug",
"(",
"'Flushing error queue...'",
")",
"err_code",
",",
"err_message",
"=",
"self",
".",
"error",
"(",
")",
"self... | Clear the instrument error queue, and prints it. | [
"Clear",
"the",
"instrument",
"error",
"queue",
"and",
"prints",
"it",
"."
] | [
"\"\"\"\n Clear the instrument error queue, and prints it.\n\n Args:\n verbose: If true, the error messages are printed.\n Default: True.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "verbose",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "verbose",
"type": "bool",
"docstring": "If true, the error messages... |
9a4b9353963d2d074487daf7e1a3aea8b5ec2cea | jakeogh/Qcodes | qcodes/utils/deprecate.py | [
"MIT"
] | Python | deprecate | Callable[..., Any] | def deprecate(
reason: Optional[str] = None,
alternative: Optional[str] = None
) -> Callable[..., Any]:
"""
A utility function to decorate deprecated functions and classes.
Args:
reason: The reason of deprecation.
alternative: The alternative function or class to put in use ... |
A utility function to decorate deprecated functions and classes.
Args:
reason: The reason of deprecation.
alternative: The alternative function or class to put in use instead of
the deprecated one.
| A utility function to decorate deprecated functions and classes. | [
"A",
"utility",
"function",
"to",
"decorate",
"deprecated",
"functions",
"and",
"classes",
"."
] | def deprecate(
reason: Optional[str] = None,
alternative: Optional[str] = None
) -> Callable[..., Any]:
@wrapt.decorator
def decorate_callable(func: Callable[..., Any],
instance: object, args: Any, kwargs: Any) -> Any:
t, n = (('class', instance.__class__.__na... | [
"def",
"deprecate",
"(",
"reason",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
"alternative",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Callable",
"[",
"...",
",",
"Any",
"]",
":",
"@",
"wrapt",
".",
"decorator",
"def",
"de... | A utility function to decorate deprecated functions and classes. | [
"A",
"utility",
"function",
"to",
"decorate",
"deprecated",
"functions",
"and",
"classes",
"."
] | [
"\"\"\"\n A utility function to decorate deprecated functions and classes.\n\n Args:\n reason: The reason of deprecation.\n alternative: The alternative function or class to put in use instead of\n the deprecated one.\n\n \"\"\"",
"# type: ignore[misc]",
"# pylint: disable=no-v... | [
{
"param": "reason",
"type": "Optional[str]"
},
{
"param": "alternative",
"type": "Optional[str]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "reason",
"type": "Optional[str]",
"docstring": "The reason of deprecation.",
"docstring_tokens": [
"The",
"reason",
"of",
"deprecation",
"."
],
"default": null,
"is_opt... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _appropriate_kwargs | Any | def _appropriate_kwargs(plottype: str,
colorbar_present: bool,
**kwargs: Any) -> Any:
"""
NB: Only to be used inside :func"`plot_dataset`.
Context manager to temporarily mutate the plotting kwargs to be appropriate
for a specific plottype. This is helpful... |
NB: Only to be used inside :func"`plot_dataset`.
Context manager to temporarily mutate the plotting kwargs to be appropriate
for a specific plottype. This is helpful since :func:`plot_dataset` may have
to generate different kinds of plots (e.g. heatmaps and line plots) and
the user may want to spe... | Only to be used inside :func"`plot_dataset`.
Context manager to temporarily mutate the plotting kwargs to be appropriate
for a specific plottype. This is helpful since :func:`plot_dataset` may have
to generate different kinds of plots and
the user may want to specify kwargs only relevant to some of them
. Those kwargs... | [
"Only",
"to",
"be",
"used",
"inside",
":",
"func",
"\"",
"`",
"plot_dataset",
"`",
".",
"Context",
"manager",
"to",
"temporarily",
"mutate",
"the",
"plotting",
"kwargs",
"to",
"be",
"appropriate",
"for",
"a",
"specific",
"plottype",
".",
"This",
"is",
"hel... | def _appropriate_kwargs(plottype: str,
colorbar_present: bool,
**kwargs: Any) -> Any:
def linehandler(**kwargs: Any) -> Any:
kwargs.pop('cmap', None)
return kwargs
def heatmaphandler(**kwargs: Any) -> Any:
if not(colorbar_present) and 'cmap... | [
"def",
"_appropriate_kwargs",
"(",
"plottype",
":",
"str",
",",
"colorbar_present",
":",
"bool",
",",
"**",
"kwargs",
":",
"Any",
")",
"->",
"Any",
":",
"def",
"linehandler",
"(",
"**",
"kwargs",
":",
"Any",
")",
"->",
"Any",
":",
"kwargs",
".",
"pop",... | NB: Only to be used inside :func"`plot_dataset`. | [
"NB",
":",
"Only",
"to",
"be",
"used",
"inside",
":",
"func",
"\"",
"`",
"plot_dataset",
"`",
"."
] | [
"\"\"\"\n NB: Only to be used inside :func\"`plot_dataset`.\n\n Context manager to temporarily mutate the plotting kwargs to be appropriate\n for a specific plottype. This is helpful since :func:`plot_dataset` may have\n to generate different kinds of plots (e.g. heatmaps and line plots) and\n the us... | [
{
"param": "plottype",
"type": "str"
},
{
"param": "colorbar_present",
"type": "bool"
},
{
"param": "kwargs",
"type": "Any"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "plottype",
"type": "str",
"docstring": "The plot type for which the kwargs should be adjusted",
"docstring_tokens": [
"The",
"plot",
"type",
"for",
"which",
"the",
"kwarg... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | plot_dataset | AxesTupleList | def plot_dataset(
dataset: DataSetProtocol,
axes: Optional[Union[matplotlib.axes.Axes, Sequence[matplotlib.axes.Axes]]] = None,
colorbars: Optional[
Union[matplotlib.colorbar.Colorbar, Sequence[matplotlib.colorbar.Colorbar]]
] = None,
rescale_axes: bool = True,
auto_color_scale: Optional... |
Construct all plots for a given dataset
Implemented so far:
* 1D line and scatter plots
* 2D plots on filled out rectangular grids
* 2D scatterplots (fallback)
The function can optionally be supplied with a matplotlib axes or a list
of axes that will be used for plotting. The use... | Construct all plots for a given dataset
Implemented so far:
1D line and scatter plots
2D plots on filled out rectangular grids
2D scatterplots (fallback)
The function can optionally be supplied with a matplotlib axes or a list
of axes that will be used for plotting. The user should ensure that the
number of axes match... | [
"Construct",
"all",
"plots",
"for",
"a",
"given",
"dataset",
"Implemented",
"so",
"far",
":",
"1D",
"line",
"and",
"scatter",
"plots",
"2D",
"plots",
"on",
"filled",
"out",
"rectangular",
"grids",
"2D",
"scatterplots",
"(",
"fallback",
")",
"The",
"function"... | def plot_dataset(
dataset: DataSetProtocol,
axes: Optional[Union[matplotlib.axes.Axes, Sequence[matplotlib.axes.Axes]]] = None,
colorbars: Optional[
Union[matplotlib.colorbar.Colorbar, Sequence[matplotlib.colorbar.Colorbar]]
] = None,
rescale_axes: bool = True,
auto_color_scale: Optional... | [
"def",
"plot_dataset",
"(",
"dataset",
":",
"DataSetProtocol",
",",
"axes",
":",
"Optional",
"[",
"Union",
"[",
"matplotlib",
".",
"axes",
".",
"Axes",
",",
"Sequence",
"[",
"matplotlib",
".",
"axes",
".",
"Axes",
"]",
"]",
"]",
"=",
"None",
",",
"colo... | Construct all plots for a given dataset
Implemented so far:
1D line and scatter plots
2D plots on filled out rectangular grids
2D scatterplots (fallback) | [
"Construct",
"all",
"plots",
"for",
"a",
"given",
"dataset",
"Implemented",
"so",
"far",
":",
"1D",
"line",
"and",
"scatter",
"plots",
"2D",
"plots",
"on",
"filled",
"out",
"rectangular",
"grids",
"2D",
"scatterplots",
"(",
"fallback",
")"
] | [
"\"\"\"\n Construct all plots for a given dataset\n\n Implemented so far:\n * 1D line and scatter plots\n * 2D plots on filled out rectangular grids\n * 2D scatterplots (fallback)\n\n The function can optionally be supplied with a matplotlib axes or a list\n of axes that will be used f... | [
{
"param": "dataset",
"type": "DataSetProtocol"
},
{
"param": "axes",
"type": "Optional[Union[matplotlib.axes.Axes, Sequence[matplotlib.axes.Axes]]]"
},
{
"param": "colorbars",
"type": "Optional[\n Union[matplotlib.colorbar.Colorbar, Sequence[matplotlib.colorbar.Colorbar]]\n ... | {
"returns": [
{
"docstring": "A list of axes and a list of colorbars of the same length. The\ncolorbar axes may be `None` if no colorbar is created",
"docstring_tokens": [
"A",
"list",
"of",
"axes",
"and",
"a",
"list",
"of",
"col... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _complex_to_real_preparser | NamedData | def _complex_to_real_preparser(
alldata: Sequence[Sequence[DSPlotData]], conversion: str, degrees: bool = False
) -> NamedData:
"""
Convert complex-valued parameters to two real-valued parameters, either
real and imaginary part or phase and magnitude part
Args:
alldata: The data to convert,... |
Convert complex-valued parameters to two real-valued parameters, either
real and imaginary part or phase and magnitude part
Args:
alldata: The data to convert, should be the output of `_get_data_from_ds`
conversion: the conversion method, either "real_and_imag" or
"mag_and_phas... | Convert complex-valued parameters to two real-valued parameters, either
real and imaginary part or phase and magnitude part | [
"Convert",
"complex",
"-",
"valued",
"parameters",
"to",
"two",
"real",
"-",
"valued",
"parameters",
"either",
"real",
"and",
"imaginary",
"part",
"or",
"phase",
"and",
"magnitude",
"part"
] | def _complex_to_real_preparser(
alldata: Sequence[Sequence[DSPlotData]], conversion: str, degrees: bool = False
) -> NamedData:
if conversion not in ['real_and_imag', 'mag_and_phase']:
raise ValueError(f'Invalid conversion given. Received {conversion}, '
'but can only accept "re... | [
"def",
"_complex_to_real_preparser",
"(",
"alldata",
":",
"Sequence",
"[",
"Sequence",
"[",
"DSPlotData",
"]",
"]",
",",
"conversion",
":",
"str",
",",
"degrees",
":",
"bool",
"=",
"False",
")",
"->",
"NamedData",
":",
"if",
"conversion",
"not",
"in",
"[",... | Convert complex-valued parameters to two real-valued parameters, either
real and imaginary part or phase and magnitude part | [
"Convert",
"complex",
"-",
"valued",
"parameters",
"to",
"two",
"real",
"-",
"valued",
"parameters",
"either",
"real",
"and",
"imaginary",
"part",
"or",
"phase",
"and",
"magnitude",
"part"
] | [
"\"\"\"\n Convert complex-valued parameters to two real-valued parameters, either\n real and imaginary part or phase and magnitude part\n\n Args:\n alldata: The data to convert, should be the output of `_get_data_from_ds`\n conversion: the conversion method, either \"real_and_imag\" or\n ... | [
{
"param": "alldata",
"type": "Sequence[Sequence[DSPlotData]]"
},
{
"param": "conversion",
"type": "str"
},
{
"param": "degrees",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "alldata",
"type": "Sequence[Sequence[DSPlotData]]",
"docstring": "The data to convert, should be the output of `_get_data_from_ds`",
"docstring_tokens": [
"The",
"data",
"to",
"convert",
... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _convert_complex_to_real | Tuple[DSPlotData, DSPlotData] | def _convert_complex_to_real(
parameter: DSPlotData, conversion: str, degrees: bool
) -> Tuple[DSPlotData, DSPlotData]:
"""
Do the actual conversion and turn one parameter into two.
Should only be called from within _complex_to_real_preparser.
"""
phase_unit = 'deg' if degrees else 'rad'
c... |
Do the actual conversion and turn one parameter into two.
Should only be called from within _complex_to_real_preparser.
| Do the actual conversion and turn one parameter into two.
Should only be called from within _complex_to_real_preparser. | [
"Do",
"the",
"actual",
"conversion",
"and",
"turn",
"one",
"parameter",
"into",
"two",
".",
"Should",
"only",
"be",
"called",
"from",
"within",
"_complex_to_real_preparser",
"."
] | def _convert_complex_to_real(
parameter: DSPlotData, conversion: str, degrees: bool
) -> Tuple[DSPlotData, DSPlotData]:
phase_unit = 'deg' if degrees else 'rad'
converters = {
'data': {'real_and_imag': lambda x: (np.real(x), np.imag(x)),
'mag_and_phase': lambda x: (np.abs(x),
... | [
"def",
"_convert_complex_to_real",
"(",
"parameter",
":",
"DSPlotData",
",",
"conversion",
":",
"str",
",",
"degrees",
":",
"bool",
")",
"->",
"Tuple",
"[",
"DSPlotData",
",",
"DSPlotData",
"]",
":",
"phase_unit",
"=",
"'deg'",
"if",
"degrees",
"else",
"'rad... | Do the actual conversion and turn one parameter into two. | [
"Do",
"the",
"actual",
"conversion",
"and",
"turn",
"one",
"parameter",
"into",
"two",
"."
] | [
"\"\"\"\n Do the actual conversion and turn one parameter into two.\n Should only be called from within _complex_to_real_preparser.\n \"\"\""
] | [
{
"param": "parameter",
"type": "DSPlotData"
},
{
"param": "conversion",
"type": "str"
},
{
"param": "degrees",
"type": "bool"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "parameter",
"type": "DSPlotData",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "conversion",
"type": "str",
"docstring": null,
"... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | plot_2d_scatterplot | AxesTuple | def plot_2d_scatterplot(x: np.ndarray, y: np.ndarray, z: np.ndarray,
ax: matplotlib.axes.Axes,
colorbar: matplotlib.colorbar.Colorbar = None,
**kwargs: Any) -> AxesTuple:
"""
Make a 2D scatterplot of the data. ``**kwargs`` are passed to mat... |
Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
scatter used for the plotting. By default the data will be rasterized
in any vector plot if more than 5000 points are supplied. This can be
overridden by supplying the `rasterized` kwarg.
Args:
x: The x values
... | Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's
scatter used for the plotting. By default the data will be rasterized
in any vector plot if more than 5000 points are supplied. This can be
overridden by supplying the `rasterized` kwarg. | [
"Make",
"a",
"2D",
"scatterplot",
"of",
"the",
"data",
".",
"`",
"`",
"**",
"kwargs",
"`",
"`",
"are",
"passed",
"to",
"matplotlib",
"'",
"s",
"scatter",
"used",
"for",
"the",
"plotting",
".",
"By",
"default",
"the",
"data",
"will",
"be",
"rasterized",... | def plot_2d_scatterplot(x: np.ndarray, y: np.ndarray, z: np.ndarray,
ax: matplotlib.axes.Axes,
colorbar: matplotlib.colorbar.Colorbar = None,
**kwargs: Any) -> AxesTuple:
if 'rasterized' in kwargs.keys():
rasterized = kwargs.pop('raster... | [
"def",
"plot_2d_scatterplot",
"(",
"x",
":",
"np",
".",
"ndarray",
",",
"y",
":",
"np",
".",
"ndarray",
",",
"z",
":",
"np",
".",
"ndarray",
",",
"ax",
":",
"matplotlib",
".",
"axes",
".",
"Axes",
",",
"colorbar",
":",
"matplotlib",
".",
"colorbar",
... | Make a 2D scatterplot of the data. | [
"Make",
"a",
"2D",
"scatterplot",
"of",
"the",
"data",
"."
] | [
"\"\"\"\n Make a 2D scatterplot of the data. ``**kwargs`` are passed to matplotlib's\n scatter used for the plotting. By default the data will be rasterized\n in any vector plot if more than 5000 points are supplied. This can be\n overridden by supplying the `rasterized` kwarg.\n\n Args:\n x: ... | [
{
"param": "x",
"type": "np.ndarray"
},
{
"param": "y",
"type": "np.ndarray"
},
{
"param": "z",
"type": "np.ndarray"
},
{
"param": "ax",
"type": "matplotlib.axes.Axes"
},
{
"param": "colorbar",
"type": "matplotlib.colorbar.Colorbar"
},
{
"param": "kwar... | {
"returns": [
{
"docstring": "The matplotlib axis handles for plot and colorbar",
"docstring_tokens": [
"The",
"matplotlib",
"axis",
"handles",
"for",
"plot",
"and",
"colorbar"
],
"type": null
}
],
"raises": [],
"pa... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | plot_on_a_plain_grid | AxesTuple | def plot_on_a_plain_grid(x: np.ndarray,
y: np.ndarray,
z: np.ndarray,
ax: matplotlib.axes.Axes,
colorbar: matplotlib.colorbar.Colorbar = None,
**kwargs: Any
) -> AxesTupl... |
Plot a heatmap of z using x and y as axes. Assumes that the data
are rectangular, i.e. that x and y together describe a rectangular
grid. The arrays of x and y need not be sorted in any particular
way, but data must belong together such that z[n] has x[n] and
y[n] as setpoints. The setpoints need ... | Plot a heatmap of z using x and y as axes. Assumes that the data
are rectangular, i.e. that x and y together describe a rectangular
grid. The arrays of x and y need not be sorted in any particular
way, but data must belong together such that z[n] has x[n] and
y[n] as setpoints. The setpoints need not be equidistantly
... | [
"Plot",
"a",
"heatmap",
"of",
"z",
"using",
"x",
"and",
"y",
"as",
"axes",
".",
"Assumes",
"that",
"the",
"data",
"are",
"rectangular",
"i",
".",
"e",
".",
"that",
"x",
"and",
"y",
"together",
"describe",
"a",
"rectangular",
"grid",
".",
"The",
"arra... | def plot_on_a_plain_grid(x: np.ndarray,
y: np.ndarray,
z: np.ndarray,
ax: matplotlib.axes.Axes,
colorbar: matplotlib.colorbar.Colorbar = None,
**kwargs: Any
) -> AxesTupl... | [
"def",
"plot_on_a_plain_grid",
"(",
"x",
":",
"np",
".",
"ndarray",
",",
"y",
":",
"np",
".",
"ndarray",
",",
"z",
":",
"np",
".",
"ndarray",
",",
"ax",
":",
"matplotlib",
".",
"axes",
".",
"Axes",
",",
"colorbar",
":",
"matplotlib",
".",
"colorbar",... | Plot a heatmap of z using x and y as axes. | [
"Plot",
"a",
"heatmap",
"of",
"z",
"using",
"x",
"and",
"y",
"as",
"axes",
"."
] | [
"\"\"\"\n Plot a heatmap of z using x and y as axes. Assumes that the data\n are rectangular, i.e. that x and y together describe a rectangular\n grid. The arrays of x and y need not be sorted in any particular\n way, but data must belong together such that z[n] has x[n] and\n y[n] as setpoints. The... | [
{
"param": "x",
"type": "np.ndarray"
},
{
"param": "y",
"type": "np.ndarray"
},
{
"param": "z",
"type": "np.ndarray"
},
{
"param": "ax",
"type": "matplotlib.axes.Axes"
},
{
"param": "colorbar",
"type": "matplotlib.colorbar.Colorbar"
},
{
"param": "kwar... | {
"returns": [
{
"docstring": "The matplotlib axes handle for plot and colorbar",
"docstring_tokens": [
"The",
"matplotlib",
"axes",
"handle",
"for",
"plot",
"and",
"colorbar"
],
"type": null
}
],
"raises": [],
"para... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _on_rectilinear_grid_except_nan | bool | def _on_rectilinear_grid_except_nan(x_data: np.ndarray, y_data: np.ndarray) -> bool:
"""
check that data is on a rectilinear grid. e.g. all points are the same as the first
row and column with the exception of nans. Those represent points not yet measured.
"""
x_row = x_data[:, ... |
check that data is on a rectilinear grid. e.g. all points are the same as the first
row and column with the exception of nans. Those represent points not yet measured.
| check that data is on a rectilinear grid. | [
"check",
"that",
"data",
"is",
"on",
"a",
"rectilinear",
"grid",
"."
] | def _on_rectilinear_grid_except_nan(x_data: np.ndarray, y_data: np.ndarray) -> bool:
x_row = x_data[:, 0:1]
y_row = y_data[0:1, :]
return (
np.nanmax(np.abs(x_data - x_row)) == 0
and np.nanmax(np.abs(y_data - y_row)) == 0
) | [
"def",
"_on_rectilinear_grid_except_nan",
"(",
"x_data",
":",
"np",
".",
"ndarray",
",",
"y_data",
":",
"np",
".",
"ndarray",
")",
"->",
"bool",
":",
"x_row",
"=",
"x_data",
"[",
":",
",",
"0",
":",
"1",
"]",
"y_row",
"=",
"y_data",
"[",
"0",
":",
... | check that data is on a rectilinear grid. | [
"check",
"that",
"data",
"is",
"on",
"a",
"rectilinear",
"grid",
"."
] | [
"\"\"\"\n check that data is on a rectilinear grid. e.g. all points are the same as the first\n row and column with the exception of nans. Those represent points not yet measured.\n \"\"\""
] | [
{
"param": "x_data",
"type": "np.ndarray"
},
{
"param": "y_data",
"type": "np.ndarray"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "x_data",
"type": "np.ndarray",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "y_data",
"type": "np.ndarray",
"docstring": null,
"... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _scale_formatter | str | def _scale_formatter(tick_value: float, pos: int, factor: float) -> str:
"""
Function for matplotlib.ticker.FuncFormatter that scales the tick values
according to the given `scale` value.
"""
return f"{tick_value*factor:g}" |
Function for matplotlib.ticker.FuncFormatter that scales the tick values
according to the given `scale` value.
| Function for matplotlib.ticker.FuncFormatter that scales the tick values
according to the given `scale` value. | [
"Function",
"for",
"matplotlib",
".",
"ticker",
".",
"FuncFormatter",
"that",
"scales",
"the",
"tick",
"values",
"according",
"to",
"the",
"given",
"`",
"scale",
"`",
"value",
"."
] | def _scale_formatter(tick_value: float, pos: int, factor: float) -> str:
return f"{tick_value*factor:g}" | [
"def",
"_scale_formatter",
"(",
"tick_value",
":",
"float",
",",
"pos",
":",
"int",
",",
"factor",
":",
"float",
")",
"->",
"str",
":",
"return",
"f\"{tick_value*factor:g}\""
] | Function for matplotlib.ticker.FuncFormatter that scales the tick values
according to the given `scale` value. | [
"Function",
"for",
"matplotlib",
".",
"ticker",
".",
"FuncFormatter",
"that",
"scales",
"the",
"tick",
"values",
"according",
"to",
"the",
"given",
"`",
"scale",
"`",
"value",
"."
] | [
"\"\"\"\n Function for matplotlib.ticker.FuncFormatter that scales the tick values\n according to the given `scale` value.\n \"\"\""
] | [
{
"param": "tick_value",
"type": "float"
},
{
"param": "pos",
"type": "int"
},
{
"param": "factor",
"type": "float"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "tick_value",
"type": "float",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pos",
"type": "int",
"docstring": null,
"docstring_t... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _make_rescaled_ticks_and_units | Tuple[matplotlib.ticker.FuncFormatter, str] | def _make_rescaled_ticks_and_units(
data_dict: DSPlotData,
) -> Tuple[matplotlib.ticker.FuncFormatter, str]:
"""
Create a ticks formatter and a new label for the data that is to be used
on the axes where the data is plotted.
For example, if values of data are all "nano" in units of volts "V",
t... |
Create a ticks formatter and a new label for the data that is to be used
on the axes where the data is plotted.
For example, if values of data are all "nano" in units of volts "V",
then the plot might be more readable if the tick formatter would show
values like "1" instead of "0.000000001" while ... | Create a ticks formatter and a new label for the data that is to be used
on the axes where the data is plotted.
The units for which unit prefixes are added can be found in
`qcodes.utils.plotting._UNITS_FOR_RESCALING`. For all other units
an exponential scaling factor is added to the label i.e. | [
"Create",
"a",
"ticks",
"formatter",
"and",
"a",
"new",
"label",
"for",
"the",
"data",
"that",
"is",
"to",
"be",
"used",
"on",
"the",
"axes",
"where",
"the",
"data",
"is",
"plotted",
".",
"The",
"units",
"for",
"which",
"unit",
"prefixes",
"are",
"adde... | def _make_rescaled_ticks_and_units(
data_dict: DSPlotData,
) -> Tuple[matplotlib.ticker.FuncFormatter, str]:
unit = data_dict['unit']
maxval = np.nanmax(np.abs(data_dict['data']))
prefix, selected_scale = find_scale_and_prefix(maxval, unit)
new_unit = prefix + unit
label = _get_label_of_data(dat... | [
"def",
"_make_rescaled_ticks_and_units",
"(",
"data_dict",
":",
"DSPlotData",
",",
")",
"->",
"Tuple",
"[",
"matplotlib",
".",
"ticker",
".",
"FuncFormatter",
",",
"str",
"]",
":",
"unit",
"=",
"data_dict",
"[",
"'unit'",
"]",
"maxval",
"=",
"np",
".",
"na... | Create a ticks formatter and a new label for the data that is to be used
on the axes where the data is plotted. | [
"Create",
"a",
"ticks",
"formatter",
"and",
"a",
"new",
"label",
"for",
"the",
"data",
"that",
"is",
"to",
"be",
"used",
"on",
"the",
"axes",
"where",
"the",
"data",
"is",
"plotted",
"."
] | [
"\"\"\"\n Create a ticks formatter and a new label for the data that is to be used\n on the axes where the data is plotted.\n\n For example, if values of data are all \"nano\" in units of volts \"V\",\n then the plot might be more readable if the tick formatter would show\n values like \"1\" instead ... | [
{
"param": "data_dict",
"type": "DSPlotData"
}
] | {
"returns": [
{
"docstring": "A tuple with the ticks formatter (matlplotlib.ticker.FuncFormatter) and\nthe new label.",
"docstring_tokens": [
"A",
"tuple",
"with",
"the",
"ticks",
"formatter",
"(",
"matlplotlib",
".",
"ti... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _rescale_ticks_and_units | None | def _rescale_ticks_and_units(
ax: matplotlib.axes.Axes,
data: Sequence[DSPlotData],
cax: matplotlib.colorbar.Colorbar = None,
) -> None:
"""
Rescale ticks and units for the provided axes as described in
:func:`~_make_rescaled_ticks_and_units`
"""
# for x axis
if not _is_string_valued... |
Rescale ticks and units for the provided axes as described in
:func:`~_make_rescaled_ticks_and_units`
| Rescale ticks and units for the provided axes as described in | [
"Rescale",
"ticks",
"and",
"units",
"for",
"the",
"provided",
"axes",
"as",
"described",
"in"
] | def _rescale_ticks_and_units(
ax: matplotlib.axes.Axes,
data: Sequence[DSPlotData],
cax: matplotlib.colorbar.Colorbar = None,
) -> None:
if not _is_string_valued_array(data[0]['data']):
x_ticks_formatter, new_x_label = \
_make_rescaled_ticks_and_units(data[0])
ax.xaxis.set_ma... | [
"def",
"_rescale_ticks_and_units",
"(",
"ax",
":",
"matplotlib",
".",
"axes",
".",
"Axes",
",",
"data",
":",
"Sequence",
"[",
"DSPlotData",
"]",
",",
"cax",
":",
"matplotlib",
".",
"colorbar",
".",
"Colorbar",
"=",
"None",
",",
")",
"->",
"None",
":",
... | Rescale ticks and units for the provided axes as described in | [
"Rescale",
"ticks",
"and",
"units",
"for",
"the",
"provided",
"axes",
"as",
"described",
"in"
] | [
"\"\"\"\n Rescale ticks and units for the provided axes as described in\n :func:`~_make_rescaled_ticks_and_units`\n \"\"\"",
"# for x axis",
"# for y axis",
"# for z aka colorbar axis"
] | [
{
"param": "ax",
"type": "matplotlib.axes.Axes"
},
{
"param": "data",
"type": "Sequence[DSPlotData]"
},
{
"param": "cax",
"type": "matplotlib.colorbar.Colorbar"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ax",
"type": "matplotlib.axes.Axes",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "Sequence[DSPlotData]",
"docstring":... |
315c044cb79f01551ea02129350ab01eeaf85850 | jakeogh/Qcodes | qcodes/dataset/plotting.py | [
"MIT"
] | Python | _is_string_valued_array | bool | def _is_string_valued_array(values: np.ndarray) -> bool:
"""
Check if the given 1D numpy array contains categorical data, or, in other
words, if it is string-valued.
Args:
values: A 1D numpy array of values
Returns:
True, if the array contains string; False otherwise
"""
re... |
Check if the given 1D numpy array contains categorical data, or, in other
words, if it is string-valued.
Args:
values: A 1D numpy array of values
Returns:
True, if the array contains string; False otherwise
| Check if the given 1D numpy array contains categorical data, or, in other
words, if it is string-valued. | [
"Check",
"if",
"the",
"given",
"1D",
"numpy",
"array",
"contains",
"categorical",
"data",
"or",
"in",
"other",
"words",
"if",
"it",
"is",
"string",
"-",
"valued",
"."
] | def _is_string_valued_array(values: np.ndarray) -> bool:
return isinstance(values[0], str) | [
"def",
"_is_string_valued_array",
"(",
"values",
":",
"np",
".",
"ndarray",
")",
"->",
"bool",
":",
"return",
"isinstance",
"(",
"values",
"[",
"0",
"]",
",",
"str",
")"
] | Check if the given 1D numpy array contains categorical data, or, in other
words, if it is string-valued. | [
"Check",
"if",
"the",
"given",
"1D",
"numpy",
"array",
"contains",
"categorical",
"data",
"or",
"in",
"other",
"words",
"if",
"it",
"is",
"string",
"-",
"valued",
"."
] | [
"\"\"\"\n Check if the given 1D numpy array contains categorical data, or, in other\n words, if it is string-valued.\n\n Args:\n values: A 1D numpy array of values\n\n Returns:\n True, if the array contains string; False otherwise\n \"\"\""
] | [
{
"param": "values",
"type": "np.ndarray"
}
] | {
"returns": [
{
"docstring": "True, if the array contains string; False otherwise",
"docstring_tokens": [
"True",
"if",
"the",
"array",
"contains",
"string",
";",
"False",
"otherwise"
],
"type": null
}
],
"rai... |
6b23cd2661e8e1dae340f0e453710e528e052de6 | jakeogh/Qcodes | qcodes/utils/installation.py | [
"MIT"
] | Python | register_station_schema_with_vscode | None | def register_station_schema_with_vscode() -> None:
"""This function registeres the qcodes station schema with vscode.
Run this function to add the user generated station schema to the list of
associated schemas for the Red Hat YAML schema extension for vscode.
(https://marketplace.visualstudio.com/item... | This function registeres the qcodes station schema with vscode.
Run this function to add the user generated station schema to the list of
associated schemas for the Red Hat YAML schema extension for vscode.
(https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)
This function will eff... | This function registeres the qcodes station schema with vscode.
Run this function to add the user generated station schema to the list of
associated schemas for the Red Hat YAML schema extension for vscode.
This function will effectively add an entry to `yaml.schemas` in the user
config file of vscode, which is locate... | [
"This",
"function",
"registeres",
"the",
"qcodes",
"station",
"schema",
"with",
"vscode",
".",
"Run",
"this",
"function",
"to",
"add",
"the",
"user",
"generated",
"station",
"schema",
"to",
"the",
"list",
"of",
"associated",
"schemas",
"for",
"the",
"Red",
"... | def register_station_schema_with_vscode() -> None:
if sys.platform != 'win32':
raise RuntimeError(
'This script is only supported on Windows platforms.\n '
'Please consult docstring for more information.')
if not os.path.exists(SCHEMA_PATH):
update_config_schema()
con... | [
"def",
"register_station_schema_with_vscode",
"(",
")",
"->",
"None",
":",
"if",
"sys",
".",
"platform",
"!=",
"'win32'",
":",
"raise",
"RuntimeError",
"(",
"'This script is only supported on Windows platforms.\\n '",
"'Please consult docstring for more information.'",
")",
"... | This function registeres the qcodes station schema with vscode. | [
"This",
"function",
"registeres",
"the",
"qcodes",
"station",
"schema",
"with",
"vscode",
"."
] | [
"\"\"\"This function registeres the qcodes station schema with vscode.\n\n Run this function to add the user generated station schema to the list of\n associated schemas for the Red Hat YAML schema extension for vscode.\n (https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml)\n\n This ... | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | clear | null | def clear(self, subplots=None, figsize=None):
"""
Clears the plot window and removes all subplots and traces
so that the window can be reused.
"""
self.traces = []
self.fig.clf()
self._init_plot(subplots, figsize, num=self.fig.number) |
Clears the plot window and removes all subplots and traces
so that the window can be reused.
| Clears the plot window and removes all subplots and traces
so that the window can be reused. | [
"Clears",
"the",
"plot",
"window",
"and",
"removes",
"all",
"subplots",
"and",
"traces",
"so",
"that",
"the",
"window",
"can",
"be",
"reused",
"."
] | def clear(self, subplots=None, figsize=None):
self.traces = []
self.fig.clf()
self._init_plot(subplots, figsize, num=self.fig.number) | [
"def",
"clear",
"(",
"self",
",",
"subplots",
"=",
"None",
",",
"figsize",
"=",
"None",
")",
":",
"self",
".",
"traces",
"=",
"[",
"]",
"self",
".",
"fig",
".",
"clf",
"(",
")",
"self",
".",
"_init_plot",
"(",
"subplots",
",",
"figsize",
",",
"nu... | Clears the plot window and removes all subplots and traces
so that the window can be reused. | [
"Clears",
"the",
"plot",
"window",
"and",
"removes",
"all",
"subplots",
"and",
"traces",
"so",
"that",
"the",
"window",
"can",
"be",
"reused",
"."
] | [
"\"\"\"\n Clears the plot window and removes all subplots and traces\n so that the window can be reused.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "subplots",
"type": null
},
{
"param": "figsize",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "subplots",
"type": null,
"docstring": null,
"docstring_tokens... |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | add_to_plot | <not_specific> | def add_to_plot(self, use_offset: bool=False, **kwargs):
"""
adds one trace to this MatPlot.
Args:
use_offset: Whether or not ticks can have an offset
**kwargs: with the exceptions given in the notes below
(mostly the data!), these are passed directly to
... |
adds one trace to this MatPlot.
Args:
use_offset: Whether or not ticks can have an offset
**kwargs: with the exceptions given in the notes below
(mostly the data!), these are passed directly to
the matplotlib plotting routine.
Returns:
... | adds one trace to this MatPlot. | [
"adds",
"one",
"trace",
"to",
"this",
"MatPlot",
"."
] | def add_to_plot(self, use_offset: bool=False, **kwargs):
ax = self[kwargs.get('subplot', 1) - 1]
if 'z' in kwargs:
plot_object = self._draw_pcolormesh(ax, **kwargs)
else:
plot_object = self._draw_plot(ax, **kwargs)
ax.ticklabel_format(useOffset=use_offset)
... | [
"def",
"add_to_plot",
"(",
"self",
",",
"use_offset",
":",
"bool",
"=",
"False",
",",
"**",
"kwargs",
")",
":",
"ax",
"=",
"self",
"[",
"kwargs",
".",
"get",
"(",
"'subplot'",
",",
"1",
")",
"-",
"1",
"]",
"if",
"'z'",
"in",
"kwargs",
":",
"plot_... | adds one trace to this MatPlot. | [
"adds",
"one",
"trace",
"to",
"this",
"MatPlot",
"."
] | [
"\"\"\"\n adds one trace to this MatPlot.\n\n Args:\n use_offset: Whether or not ticks can have an offset\n **kwargs: with the exceptions given in the notes below\n (mostly the data!), these are passed directly to\n the matplotlib plotting routine.\n... | [
{
"param": "self",
"type": null
},
{
"param": "use_offset",
"type": "bool"
}
] | {
"returns": [
{
"docstring": "Plot handle for trace",
"docstring_tokens": [
"Plot",
"handle",
"for",
"trace"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docst... |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | default_figsize | <not_specific> | def default_figsize(subplots):
"""
Provides default figsize for given subplots.
Args:
subplots (Tuple[Int, Int]): shape (nrows, ncols) of subplots
Returns:
Tuple[float, float]: (width, height) of default figsize
for given subplot shape
"""
... |
Provides default figsize for given subplots.
Args:
subplots (Tuple[Int, Int]): shape (nrows, ncols) of subplots
Returns:
Tuple[float, float]: (width, height) of default figsize
for given subplot shape
| Provides default figsize for given subplots. | [
"Provides",
"default",
"figsize",
"for",
"given",
"subplots",
"."
] | def default_figsize(subplots):
if not isinstance(subplots, tuple):
raise TypeError(f'Subplots {subplots} must be a tuple')
return (3 + 3 * subplots[1], 1 + 3 * subplots[0]) | [
"def",
"default_figsize",
"(",
"subplots",
")",
":",
"if",
"not",
"isinstance",
"(",
"subplots",
",",
"tuple",
")",
":",
"raise",
"TypeError",
"(",
"f'Subplots {subplots} must be a tuple'",
")",
"return",
"(",
"3",
"+",
"3",
"*",
"subplots",
"[",
"1",
"]",
... | Provides default figsize for given subplots. | [
"Provides",
"default",
"figsize",
"for",
"given",
"subplots",
"."
] | [
"\"\"\"\n Provides default figsize for given subplots.\n Args:\n subplots (Tuple[Int, Int]): shape (nrows, ncols) of subplots\n\n Returns:\n Tuple[float, float]: (width, height) of default figsize\n for given subplot shape\n \"\"\""
] | [
{
"param": "subplots",
"type": null
}
] | {
"returns": [
{
"docstring": "(width, height) of default figsize\nfor given subplot shape",
"docstring_tokens": [
"(",
"width",
"height",
")",
"of",
"default",
"figsize",
"for",
"given",
"subplot",
"shape"
]... |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | update_plot | null | def update_plot(self):
"""
update the plot. The DataSets themselves have already been updated
in update, here we just push the changes to the plot.
"""
# matplotlib doesn't know how to autoscale to a pcolormesh after the
# first draw (relim ignores it...) so we have to do... |
update the plot. The DataSets themselves have already been updated
in update, here we just push the changes to the plot.
| update the plot. The DataSets themselves have already been updated
in update, here we just push the changes to the plot. | [
"update",
"the",
"plot",
".",
"The",
"DataSets",
"themselves",
"have",
"already",
"been",
"updated",
"in",
"update",
"here",
"we",
"just",
"push",
"the",
"changes",
"to",
"the",
"plot",
"."
] | def update_plot(self):
bboxes = dict(zip(self.subplots, [[] for p in self.subplots]))
for trace in self.traces:
config = trace['config']
plot_object = trace['plot_object']
if 'z' in config:
if plot_object:
plot_object.remove()
... | [
"def",
"update_plot",
"(",
"self",
")",
":",
"bboxes",
"=",
"dict",
"(",
"zip",
"(",
"self",
".",
"subplots",
",",
"[",
"[",
"]",
"for",
"p",
"in",
"self",
".",
"subplots",
"]",
")",
")",
"for",
"trace",
"in",
"self",
".",
"traces",
":",
"config"... | update the plot. | [
"update",
"the",
"plot",
"."
] | [
"\"\"\"\n update the plot. The DataSets themselves have already been updated\n in update, here we just push the changes to the plot.\n \"\"\"",
"# matplotlib doesn't know how to autoscale to a pcolormesh after the",
"# first draw (relim ignores it...) so we have to do this ourselves",
"# ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | _make_args_for_pcolormesh | <not_specific> | def _make_args_for_pcolormesh(args_masked, x, y):
"""
Make args for pcolormesh.
pcolormesh accepts as args either
C - a (potentially) masked array
or
x, y, C where x and y are the colour box edge arrays and
are NOT allowed to be masked
"""
if x is... |
Make args for pcolormesh.
pcolormesh accepts as args either
C - a (potentially) masked array
or
x, y, C where x and y are the colour box edge arrays and
are NOT allowed to be masked
| Make args for pcolormesh.
pcolormesh accepts as args either
C - a (potentially) masked array
or
x, y, C where x and y are the colour box edge arrays and
are NOT allowed to be masked | [
"Make",
"args",
"for",
"pcolormesh",
".",
"pcolormesh",
"accepts",
"as",
"args",
"either",
"C",
"-",
"a",
"(",
"potentially",
")",
"masked",
"array",
"or",
"x",
"y",
"C",
"where",
"x",
"and",
"y",
"are",
"the",
"colour",
"box",
"edge",
"arrays",
"and",... | def _make_args_for_pcolormesh(args_masked, x, y):
if x is not None and y is not None:
args = []
for k, arr in enumerate(args_masked[:-1]):
if arr.ndim > 1:
arr = arr[0] if k == 0 else arr[:, 0]
if np.ma.is_masked(arr[1]):
... | [
"def",
"_make_args_for_pcolormesh",
"(",
"args_masked",
",",
"x",
",",
"y",
")",
":",
"if",
"x",
"is",
"not",
"None",
"and",
"y",
"is",
"not",
"None",
":",
"args",
"=",
"[",
"]",
"for",
"k",
",",
"arr",
"in",
"enumerate",
"(",
"args_masked",
"[",
"... | Make args for pcolormesh. | [
"Make",
"args",
"for",
"pcolormesh",
"."
] | [
"\"\"\"\n Make args for pcolormesh.\n pcolormesh accepts as args either\n C - a (potentially) masked array\n or\n x, y, C where x and y are the colour box edge arrays and\n are NOT allowed to be masked\n \"\"\"",
"# If x and y are provided, modify the arrays such t... | [
{
"param": "args_masked",
"type": null
},
{
"param": "x",
"type": null
},
{
"param": "y",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "args_masked",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "x",
"type": null,
"docstring": null,
"docstring_tokens... |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | save | null | def save(self, filename=None):
"""
Save current plot to filename, by default
to the location corresponding to the default
title.
Args:
filename (Optional[str]): Location of the file
"""
default = f"{self.get_default_title()}.png"
filename = fi... |
Save current plot to filename, by default
to the location corresponding to the default
title.
Args:
filename (Optional[str]): Location of the file
| Save current plot to filename, by default
to the location corresponding to the default
title. | [
"Save",
"current",
"plot",
"to",
"filename",
"by",
"default",
"to",
"the",
"location",
"corresponding",
"to",
"the",
"default",
"title",
"."
] | def save(self, filename=None):
default = f"{self.get_default_title()}.png"
filename = filename or default
self.fig.savefig(filename) | [
"def",
"save",
"(",
"self",
",",
"filename",
"=",
"None",
")",
":",
"default",
"=",
"f\"{self.get_default_title()}.png\"",
"filename",
"=",
"filename",
"or",
"default",
"self",
".",
"fig",
".",
"savefig",
"(",
"filename",
")"
] | Save current plot to filename, by default
to the location corresponding to the default
title. | [
"Save",
"current",
"plot",
"to",
"filename",
"by",
"default",
"to",
"the",
"location",
"corresponding",
"to",
"the",
"default",
"title",
"."
] | [
"\"\"\"\n Save current plot to filename, by default\n to the location corresponding to the default\n title.\n\n Args:\n filename (Optional[str]): Location of the file\n \"\"\""
] | [
{
"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": "Location of the file",
... |
c8ebea3adf8de9068f911d8b610e6135dacb9d0b | jakeogh/Qcodes | qcodes/plots/qcmatplotlib.py | [
"MIT"
] | Python | tight_layout | null | def tight_layout(self):
"""
Perform a tight layout on the figure. A bit of additional spacing at
the top is also added for the title.
"""
self.fig.tight_layout(rect=[0, 0, 1, 0.95]) |
Perform a tight layout on the figure. A bit of additional spacing at
the top is also added for the title.
| Perform a tight layout on the figure. A bit of additional spacing at
the top is also added for the title. | [
"Perform",
"a",
"tight",
"layout",
"on",
"the",
"figure",
".",
"A",
"bit",
"of",
"additional",
"spacing",
"at",
"the",
"top",
"is",
"also",
"added",
"for",
"the",
"title",
"."
] | def tight_layout(self):
self.fig.tight_layout(rect=[0, 0, 1, 0.95]) | [
"def",
"tight_layout",
"(",
"self",
")",
":",
"self",
".",
"fig",
".",
"tight_layout",
"(",
"rect",
"=",
"[",
"0",
",",
"0",
",",
"1",
",",
"0.95",
"]",
")"
] | Perform a tight layout on the figure. | [
"Perform",
"a",
"tight",
"layout",
"on",
"the",
"figure",
"."
] | [
"\"\"\"\n Perform a tight layout on the figure. A bit of additional spacing at\n the top is also added for the title.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
085b761c6037527dddd08126327284d8320878ac | jakeogh/Qcodes | qcodes/instrument_drivers/AlazarTech/dll_wrapper.py | [
"MIT"
] | Python | _sync_dll_call | Any | def _sync_dll_call(self, c_name: str, *args: Any) -> Any:
"""Call given function from the DLL library on the given arguments"""
c_func = getattr(self._dll, c_name)
future = self._executor.submit(
_api_call_task,
self._lock,
c_func,
partial(_mark_pa... | Call given function from the DLL library on the given arguments | Call given function from the DLL library on the given arguments | [
"Call",
"given",
"function",
"from",
"the",
"DLL",
"library",
"on",
"the",
"given",
"arguments"
] | def _sync_dll_call(self, c_name: str, *args: Any) -> Any:
c_func = getattr(self._dll, c_name)
future = self._executor.submit(
_api_call_task,
self._lock,
c_func,
partial(_mark_params_as_updated, *args),
*_normalize_params(*args)
)
... | [
"def",
"_sync_dll_call",
"(",
"self",
",",
"c_name",
":",
"str",
",",
"*",
"args",
":",
"Any",
")",
"->",
"Any",
":",
"c_func",
"=",
"getattr",
"(",
"self",
".",
"_dll",
",",
"c_name",
")",
"future",
"=",
"self",
".",
"_executor",
".",
"submit",
"(... | Call given function from the DLL library on the given arguments | [
"Call",
"given",
"function",
"from",
"the",
"DLL",
"library",
"on",
"the",
"given",
"arguments"
] | [
"\"\"\"Call given function from the DLL library on the given arguments\"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "c_name",
"type": "str"
},
{
"param": "args",
"type": "Any"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "c_name",
"type": "str",
"docstring": null,
"docstring_tokens"... |
db6b789317c4d9093044526cd9b0ed5706a44852 | jakeogh/Qcodes | qcodes/data/gnuplot_format.py | [
"MIT"
] | Python | read_one_file | <not_specific> | def read_one_file(self, data_set, f, ids_read):
"""
Called by Formatter.read to bring one data file into
a DataSet. Setpoint data may be duplicated across multiple files,
but each measured DataArray must only map to one file.
args:
data_set: the DataSet we are readin... |
Called by Formatter.read to bring one data file into
a DataSet. Setpoint data may be duplicated across multiple files,
but each measured DataArray must only map to one file.
args:
data_set: the DataSet we are reading into
f: a file-like object to read from
... | Called by Formatter.read to bring one data file into
a DataSet. Setpoint data may be duplicated across multiple files,
but each measured DataArray must only map to one file.
the DataSet we are reading into
f: a file-like object to read from
ids_read: a `set` of array_ids that we have already read.
when you read an arr... | [
"Called",
"by",
"Formatter",
".",
"read",
"to",
"bring",
"one",
"data",
"file",
"into",
"a",
"DataSet",
".",
"Setpoint",
"data",
"may",
"be",
"duplicated",
"across",
"multiple",
"files",
"but",
"each",
"measured",
"DataArray",
"must",
"only",
"map",
"to",
... | def read_one_file(self, data_set, f, ids_read):
if not f.name.endswith(self.extension):
return
arrays = data_set.arrays
ids = self._read_comment_line(f).split()
labels = self._get_labels(self._read_comment_line(f))
shape = tuple(map(int, self._read_comment_line(f).spl... | [
"def",
"read_one_file",
"(",
"self",
",",
"data_set",
",",
"f",
",",
"ids_read",
")",
":",
"if",
"not",
"f",
".",
"name",
".",
"endswith",
"(",
"self",
".",
"extension",
")",
":",
"return",
"arrays",
"=",
"data_set",
".",
"arrays",
"ids",
"=",
"self"... | Called by Formatter.read to bring one data file into
a DataSet. | [
"Called",
"by",
"Formatter",
".",
"read",
"to",
"bring",
"one",
"data",
"file",
"into",
"a",
"DataSet",
"."
] | [
"\"\"\"\n Called by Formatter.read to bring one data file into\n a DataSet. Setpoint data may be duplicated across multiple files,\n but each measured DataArray must only map to one file.\n\n args:\n data_set: the DataSet we are reading into\n f: a file-like object ... | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": null
},
{
"param": "f",
"type": null
},
{
"param": "ids_read",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_set",
"type": null,
"docstring": null,
"docstring_tokens... |
db6b789317c4d9093044526cd9b0ed5706a44852 | jakeogh/Qcodes | qcodes/data/gnuplot_format.py | [
"MIT"
] | Python | write | null | def write(self, # type: ignore[override]
data_set: 'DataSet',
io_manager, location, force_write=False,
write_metadata=True, only_complete=True,
filename=None):
"""
Write updates in this DataSet to storage.
Will choose append if possible, ... |
Write updates in this DataSet to storage.
Will choose append if possible, overwrite if not.
Args:
data_set: the data we're storing
io_manager (io_manager): the base location to write to
location (str): the file location within io_manager
only_co... | Write updates in this DataSet to storage.
Will choose append if possible, overwrite if not. | [
"Write",
"updates",
"in",
"this",
"DataSet",
"to",
"storage",
".",
"Will",
"choose",
"append",
"if",
"possible",
"overwrite",
"if",
"not",
"."
] | def write(self,
data_set: 'DataSet',
io_manager, location, force_write=False,
write_metadata=True, only_complete=True,
filename=None):
arrays = data_set.arrays
groups = self.group_arrays(arrays)
existing_files = set(io_manager.list(locati... | [
"def",
"write",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
",",
"io_manager",
",",
"location",
",",
"force_write",
"=",
"False",
",",
"write_metadata",
"=",
"True",
",",
"only_complete",
"=",
"True",
",",
"filename",
"=",
"None",
")",
":",
"arrays",
... | Write updates in this DataSet to storage. | [
"Write",
"updates",
"in",
"this",
"DataSet",
"to",
"storage",
"."
] | [
"# type: ignore[override]",
"\"\"\"\n Write updates in this DataSet to storage.\n\n Will choose append if possible, overwrite if not.\n\n Args:\n data_set: the data we're storing\n io_manager (io_manager): the base location to write to\n location (str): the fi... | [
{
"param": "self",
"type": null
},
{
"param": "data_set",
"type": "'DataSet'"
},
{
"param": "io_manager",
"type": null
},
{
"param": "location",
"type": null
},
{
"param": "force_write",
"type": null
},
{
"param": "write_metadata",
"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're storin... |
db6b789317c4d9093044526cd9b0ed5706a44852 | jakeogh/Qcodes | qcodes/data/gnuplot_format.py | [
"MIT"
] | Python | write_metadata | null | def write_metadata(self, data_set: 'DataSet', io_manager, location,
read_first=True, **kwargs):
"""
Write all metadata in this DataSet to storage.
Args:
data_set: the data we're storing
io_manager (io_manager): the base location to write to
... |
Write all metadata in this DataSet to storage.
Args:
data_set: the data we're storing
io_manager (io_manager): the base location to write to
location (str): the file location within io_manager
read_first (Optional[bool]): read previously saved metadat... | Write all metadata in this DataSet to storage. | [
"Write",
"all",
"metadata",
"in",
"this",
"DataSet",
"to",
"storage",
"."
] | def write_metadata(self, data_set: 'DataSet', io_manager, location,
read_first=True, **kwargs):
if read_first:
memory_metadata = data_set.metadata
data_set.metadata = {}
self.read_metadata(data_set)
deep_update(data_set.metadata, memory_meta... | [
"def",
"write_metadata",
"(",
"self",
",",
"data_set",
":",
"'DataSet'",
",",
"io_manager",
",",
"location",
",",
"read_first",
"=",
"True",
",",
"**",
"kwargs",
")",
":",
"if",
"read_first",
":",
"memory_metadata",
"=",
"data_set",
".",
"metadata",
"data_se... | Write all metadata in this DataSet to storage. | [
"Write",
"all",
"metadata",
"in",
"this",
"DataSet",
"to",
"storage",
"."
] | [
"\"\"\"\n Write all metadata in this DataSet to storage.\n\n Args:\n data_set: the data we're storing\n\n io_manager (io_manager): the base location to write to\n\n location (str): the file location within io_manager\n\n read_first (Optional[bool]): read pre... | [
{
"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're storin... |
baa8b697303c29c93fa24d92134193c3c4ef50ab | jakeogh/Qcodes | qcodes/dataset/guid_helpers.py | [
"MIT"
] | Python | guids_from_dbs | Tuple[Dict[Path, List[str]], Dict[str, Path]] | def guids_from_dbs(
db_paths: Iterable[Path],
) -> Tuple[Dict[Path, List[str]], Dict[str, Path]]:
"""
Extract all guids from the supplied database paths.
Args:
db_paths: Path or str or directory where to search
Returns:
Tuple of Dictionary mapping paths to lists of guids as strings... |
Extract all guids from the supplied database paths.
Args:
db_paths: Path or str or directory where to search
Returns:
Tuple of Dictionary mapping paths to lists of guids as strings
and Dictionary mapping guids to db paths.
| Extract all guids from the supplied database paths. | [
"Extract",
"all",
"guids",
"from",
"the",
"supplied",
"database",
"paths",
"."
] | def guids_from_dbs(
db_paths: Iterable[Path],
) -> Tuple[Dict[Path, List[str]], Dict[str, Path]]:
dbdict = {}
for p in db_paths:
try:
conn = connect(str(p))
dbdict[p] = get_guids_from_run_spec(conn)
except (RuntimeError, DatabaseError) as e:
print(e)
... | [
"def",
"guids_from_dbs",
"(",
"db_paths",
":",
"Iterable",
"[",
"Path",
"]",
",",
")",
"->",
"Tuple",
"[",
"Dict",
"[",
"Path",
",",
"List",
"[",
"str",
"]",
"]",
",",
"Dict",
"[",
"str",
",",
"Path",
"]",
"]",
":",
"dbdict",
"=",
"{",
"}",
"fo... | Extract all guids from the supplied database paths. | [
"Extract",
"all",
"guids",
"from",
"the",
"supplied",
"database",
"paths",
"."
] | [
"\"\"\"\n Extract all guids from the supplied database paths.\n\n Args:\n db_paths: Path or str or directory where to search\n\n Returns:\n Tuple of Dictionary mapping paths to lists of guids as strings\n and Dictionary mapping guids to db paths.\n \"\"\""
] | [
{
"param": "db_paths",
"type": "Iterable[Path]"
}
] | {
"returns": [
{
"docstring": "Tuple of Dictionary mapping paths to lists of guids as strings\nand Dictionary mapping guids to db paths.",
"docstring_tokens": [
"Tuple",
"of",
"Dictionary",
"mapping",
"paths",
"to",
"lists",
"of",
... |
baa8b697303c29c93fa24d92134193c3c4ef50ab | jakeogh/Qcodes | qcodes/dataset/guid_helpers.py | [
"MIT"
] | Python | guids_from_dir | Tuple[Dict[Path, List[str]], Dict[str, Path]] | def guids_from_dir(
basepath: Union[Path, str]
) -> Tuple[Dict[Path, List[str]], Dict[str, Path]]:
"""
Recursively find all db files under basepath and extract guids.
Args:
basepath: Path or str or directory where to search
Returns:
Tuple of Dictionary mapping paths to lists of gui... |
Recursively find all db files under basepath and extract guids.
Args:
basepath: Path or str or directory where to search
Returns:
Tuple of Dictionary mapping paths to lists of guids as strings
and Dictionary mapping guids to db paths.
| Recursively find all db files under basepath and extract guids. | [
"Recursively",
"find",
"all",
"db",
"files",
"under",
"basepath",
"and",
"extract",
"guids",
"."
] | def guids_from_dir(
basepath: Union[Path, str]
) -> Tuple[Dict[Path, List[str]], Dict[str, Path]]:
return guids_from_dbs(Path(basepath).glob("**/*.db")) | [
"def",
"guids_from_dir",
"(",
"basepath",
":",
"Union",
"[",
"Path",
",",
"str",
"]",
")",
"->",
"Tuple",
"[",
"Dict",
"[",
"Path",
",",
"List",
"[",
"str",
"]",
"]",
",",
"Dict",
"[",
"str",
",",
"Path",
"]",
"]",
":",
"return",
"guids_from_dbs",
... | Recursively find all db files under basepath and extract guids. | [
"Recursively",
"find",
"all",
"db",
"files",
"under",
"basepath",
"and",
"extract",
"guids",
"."
] | [
"\"\"\"\n Recursively find all db files under basepath and extract guids.\n\n Args:\n basepath: Path or str or directory where to search\n\n Returns:\n Tuple of Dictionary mapping paths to lists of guids as strings\n and Dictionary mapping guids to db paths.\n \"\"\""
] | [
{
"param": "basepath",
"type": "Union[Path, str]"
}
] | {
"returns": [
{
"docstring": "Tuple of Dictionary mapping paths to lists of guids as strings\nand Dictionary mapping guids to db paths.",
"docstring_tokens": [
"Tuple",
"of",
"Dictionary",
"mapping",
"paths",
"to",
"lists",
"of",
... |
baa8b697303c29c93fa24d92134193c3c4ef50ab | jakeogh/Qcodes | qcodes/dataset/guid_helpers.py | [
"MIT"
] | Python | guids_from_list_str | Optional[Tuple[str, ...]] | def guids_from_list_str(s: str) -> Optional[Tuple[str, ...]]:
"""
Get tuple of guids from a python/json string representation of a list.
Extracts the guids from a string representation of a list, tuple,
or set of guids or a single guid.
Args:
s: input string
Returns:
Extracted... |
Get tuple of guids from a python/json string representation of a list.
Extracts the guids from a string representation of a list, tuple,
or set of guids or a single guid.
Args:
s: input string
Returns:
Extracted guids as a tuple of strings.
If a provided string does not m... | Get tuple of guids from a python/json string representation of a list.
Extracts the guids from a string representation of a list, tuple,
or set of guids or a single guid. | [
"Get",
"tuple",
"of",
"guids",
"from",
"a",
"python",
"/",
"json",
"string",
"representation",
"of",
"a",
"list",
".",
"Extracts",
"the",
"guids",
"from",
"a",
"string",
"representation",
"of",
"a",
"list",
"tuple",
"or",
"set",
"of",
"guids",
"or",
"a",... | def guids_from_list_str(s: str) -> Optional[Tuple[str, ...]]:
if s == "":
return tuple()
try:
validate_guid_format(s)
return (s,)
except ValueError:
pass
try:
parsed_expression = ast.parse(s, mode='eval')
except SyntaxError:
return None
if not hasa... | [
"def",
"guids_from_list_str",
"(",
"s",
":",
"str",
")",
"->",
"Optional",
"[",
"Tuple",
"[",
"str",
",",
"...",
"]",
"]",
":",
"if",
"s",
"==",
"\"\"",
":",
"return",
"tuple",
"(",
")",
"try",
":",
"validate_guid_format",
"(",
"s",
")",
"return",
... | Get tuple of guids from a python/json string representation of a list. | [
"Get",
"tuple",
"of",
"guids",
"from",
"a",
"python",
"/",
"json",
"string",
"representation",
"of",
"a",
"list",
"."
] | [
"\"\"\"\n Get tuple of guids from a python/json string representation of a list.\n\n Extracts the guids from a string representation of a list, tuple,\n or set of guids or a single guid.\n\n Args:\n s: input string\n\n Returns:\n Extracted guids as a tuple of strings.\n If a prov... | [
{
"param": "s",
"type": "str"
}
] | {
"returns": [
{
"docstring": "Extracted guids as a tuple of strings.\nIf a provided string does not match the format, `None` will be returned.\nFor an empty list/tuple/set or empty string an empty tuple is returned.",
"docstring_tokens": [
"Extracted",
"guids",
"as",
"... |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | clear | null | def clear(self):
"""
Clears the plot window and removes all subplots and traces
so that the window can be reused.
"""
# any derived class should implement this
raise NotImplementedError
# typically traces and subplots should be cleared as well as the
# fig... |
Clears the plot window and removes all subplots and traces
so that the window can be reused.
| Clears the plot window and removes all subplots and traces
so that the window can be reused. | [
"Clears",
"the",
"plot",
"window",
"and",
"removes",
"all",
"subplots",
"and",
"traces",
"so",
"that",
"the",
"window",
"can",
"be",
"reused",
"."
] | def clear(self):
raise NotImplementedError
self.traces = []
self.subplots = [] | [
"def",
"clear",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"self",
".",
"traces",
"=",
"[",
"]",
"self",
".",
"subplots",
"=",
"[",
"]"
] | Clears the plot window and removes all subplots and traces
so that the window can be reused. | [
"Clears",
"the",
"plot",
"window",
"and",
"removes",
"all",
"subplots",
"and",
"traces",
"so",
"that",
"the",
"window",
"can",
"be",
"reused",
"."
] | [
"\"\"\"\n Clears the plot window and removes all subplots and traces\n so that the window can be reused.\n \"\"\"",
"# any derived class should implement this",
"# typically traces and subplots should be cleared as well as the",
"# figure window for the particular backend",
"# TODO(giul... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | replace | null | def replace(self, *args, updater=None, **kwargs):
"""
Clear all content and add new trace.
Args:
args: optional way to provide x/y/z data without keywords
If the last one is 1D, may be `y` or `x`, `y`
If the last one is 2D, may be `z` or `x`, `y`, `z`... |
Clear all content and add new trace.
Args:
args: optional way to provide x/y/z data without keywords
If the last one is 1D, may be `y` or `x`, `y`
If the last one is 2D, may be `z` or `x`, `y`, `z`
updater: a callable (with no args) that updates... | Clear all content and add new trace. | [
"Clear",
"all",
"content",
"and",
"add",
"new",
"trace",
"."
] | def replace(self, *args, updater=None, **kwargs):
self.clear()
self.add(*args, updater=updater, **kwargs) | [
"def",
"replace",
"(",
"self",
",",
"*",
"args",
",",
"updater",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"self",
".",
"clear",
"(",
")",
"self",
".",
"add",
"(",
"*",
"args",
",",
"updater",
"=",
"updater",
",",
"**",
"kwargs",
")"
] | Clear all content and add new trace. | [
"Clear",
"all",
"content",
"and",
"add",
"new",
"trace",
"."
] | [
"\"\"\"\n Clear all content and add new trace.\n\n Args:\n args: optional way to provide x/y/z data without keywords\n If the last one is 1D, may be `y` or `x`, `y`\n If the last one is 2D, may be `z` or `x`, `y`, `z`\n\n updater: a callable (with no... | [
{
"param": "self",
"type": null
},
{
"param": "updater",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "updater",
"type": null,
"docstring": "a callable (with no args) tha... |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | add | <not_specific> | def add(self, *args, updater=None, **kwargs):
"""
Add one trace to this plot.
Args:
args: optional way to provide x/y/z data without keywords
If the last one is 1D, may be `y` or `x`, `y`
If the last one is 2D, may be `z` or `x`, `y`, `z`
... |
Add one trace to this plot.
Args:
args: optional way to provide x/y/z data without keywords
If the last one is 1D, may be `y` or `x`, `y`
If the last one is 2D, may be `z` or `x`, `y`, `z`
updater: a callable (with no args) that updates the data... | Add one trace to this plot. | [
"Add",
"one",
"trace",
"to",
"this",
"plot",
"."
] | def add(self, *args, updater=None, **kwargs):
self.expand_trace(args, kwargs)
plot_object = self.add_to_plot(**kwargs)
self.add_updater(updater, kwargs)
return plot_object | [
"def",
"add",
"(",
"self",
",",
"*",
"args",
",",
"updater",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"self",
".",
"expand_trace",
"(",
"args",
",",
"kwargs",
")",
"plot_object",
"=",
"self",
".",
"add_to_plot",
"(",
"**",
"kwargs",
")",
"self",
... | Add one trace to this plot. | [
"Add",
"one",
"trace",
"to",
"this",
"plot",
"."
] | [
"\"\"\"\n Add one trace to this plot.\n\n Args:\n args: optional way to provide x/y/z data without keywords\n If the last one is 1D, may be `y` or `x`, `y`\n If the last one is 2D, may be `z` or `x`, `y`, `z`\n\n updater: a callable (with no args) th... | [
{
"param": "self",
"type": null
},
{
"param": "updater",
"type": null
}
] | {
"returns": [
{
"docstring": "Plot handle for trace",
"docstring_tokens": [
"Plot",
"handle",
"for",
"trace"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docst... |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | add_to_plot | null | def add_to_plot(self, **kwargs):
"""
Add a trace the plot itself (typically called by self.add,
which incorporates args into kwargs, so the subclass doesn't
need to worry about this). Data will be in `x`, `y`, and optionally
`z`.
Should be implemented by a subclass, and ... |
Add a trace the plot itself (typically called by self.add,
which incorporates args into kwargs, so the subclass doesn't
need to worry about this). Data will be in `x`, `y`, and optionally
`z`.
Should be implemented by a subclass, and each call should append
a dictionary... | Add a trace the plot itself (typically called by self.add,
which incorporates args into kwargs, so the subclass doesn't
need to worry about this).
Should be implemented by a subclass, and each call should append
a dictionary to self.traces, containing at least {'config': kwargs} | [
"Add",
"a",
"trace",
"the",
"plot",
"itself",
"(",
"typically",
"called",
"by",
"self",
".",
"add",
"which",
"incorporates",
"args",
"into",
"kwargs",
"so",
"the",
"subclass",
"doesn",
"'",
"t",
"need",
"to",
"worry",
"about",
"this",
")",
".",
"Should",... | def add_to_plot(self, **kwargs):
raise NotImplementedError | [
"def",
"add_to_plot",
"(",
"self",
",",
"**",
"kwargs",
")",
":",
"raise",
"NotImplementedError"
] | Add a trace the plot itself (typically called by self.add,
which incorporates args into kwargs, so the subclass doesn't
need to worry about this). | [
"Add",
"a",
"trace",
"the",
"plot",
"itself",
"(",
"typically",
"called",
"by",
"self",
".",
"add",
"which",
"incorporates",
"args",
"into",
"kwargs",
"so",
"the",
"subclass",
"doesn",
"'",
"t",
"need",
"to",
"worry",
"about",
"this",
")",
"."
] | [
"\"\"\"\n Add a trace the plot itself (typically called by self.add,\n which incorporates args into kwargs, so the subclass doesn't\n need to worry about this). Data will be in `x`, `y`, and optionally\n `z`.\n\n Should be implemented by a subclass, and each call should append\n ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | add_updater | null | def add_updater(self, updater, plot_config):
"""
Add an updater to the plot.
Args:
updater (Callable): callable (with no args) that updates the data in this trace
if omitted, we will look for DataSets referenced in this data, and
call their sync metho... |
Add an updater to the plot.
Args:
updater (Callable): callable (with no args) that updates the data in this trace
if omitted, we will look for DataSets referenced in this data, and
call their sync methods.
plot_config (dict): this is a dictionary... | Add an updater to the plot. | [
"Add",
"an",
"updater",
"to",
"the",
"plot",
"."
] | def add_updater(self, updater, plot_config):
if updater is not None:
self.data_updaters.add(updater)
else:
for key in self.data_keys:
data_array = plot_config.get(key, '')
if hasattr(data_array, 'data_set'):
if data_array.data_s... | [
"def",
"add_updater",
"(",
"self",
",",
"updater",
",",
"plot_config",
")",
":",
"if",
"updater",
"is",
"not",
"None",
":",
"self",
".",
"data_updaters",
".",
"add",
"(",
"updater",
")",
"else",
":",
"for",
"key",
"in",
"self",
".",
"data_keys",
":",
... | Add an updater to the plot. | [
"Add",
"an",
"updater",
"to",
"the",
"plot",
"."
] | [
"\"\"\"\n Add an updater to the plot.\n\n Args:\n updater (Callable): callable (with no args) that updates the data in this trace\n if omitted, we will look for DataSets referenced in this data, and\n call their sync methods.\n plot_config (dict): th... | [
{
"param": "self",
"type": null
},
{
"param": "updater",
"type": null
},
{
"param": "plot_config",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "updater",
"type": null,
"docstring": "callable (with no args) that ... |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | expand_trace | null | def expand_trace(args, kwargs):
"""
Complete the x, y (and possibly z) data definition for a trace.
Also modifies kwargs in place so that all the data needed to fully
specify the trace is present (ie either x and y or x and y and z)
Both ``__init__`` (for the first trace) and t... |
Complete the x, y (and possibly z) data definition for a trace.
Also modifies kwargs in place so that all the data needed to fully
specify the trace is present (ie either x and y or x and y and z)
Both ``__init__`` (for the first trace) and the ``add`` method support
multiple ... | Complete the x, y (and possibly z) data definition for a trace.
Also modifies kwargs in place so that all the data needed to fully
specify the trace is present
This method takes any of those forms and converts them into a complete
set of kwargs, containing all of the explicit or implied data to be used
in plotting... | [
"Complete",
"the",
"x",
"y",
"(",
"and",
"possibly",
"z",
")",
"data",
"definition",
"for",
"a",
"trace",
".",
"Also",
"modifies",
"kwargs",
"in",
"place",
"so",
"that",
"all",
"the",
"data",
"needed",
"to",
"fully",
"specify",
"the",
"trace",
"is",
"p... | def expand_trace(args, kwargs):
if args:
if hasattr(args[-1][0], '__len__'):
axletters = 'xyz'
ndim = 2
else:
axletters = 'xy'
ndim = 1
if len(args) not in (1, len(axletters)):
raise ValueError('{... | [
"def",
"expand_trace",
"(",
"args",
",",
"kwargs",
")",
":",
"if",
"args",
":",
"if",
"hasattr",
"(",
"args",
"[",
"-",
"1",
"]",
"[",
"0",
"]",
",",
"'__len__'",
")",
":",
"axletters",
"=",
"'xyz'",
"ndim",
"=",
"2",
"else",
":",
"axletters",
"=... | Complete the x, y (and possibly z) data definition for a trace. | [
"Complete",
"the",
"x",
"y",
"(",
"and",
"possibly",
"z",
")",
"data",
"definition",
"for",
"a",
"trace",
"."
] | [
"\"\"\"\n Complete the x, y (and possibly z) data definition for a trace.\n\n Also modifies kwargs in place so that all the data needed to fully\n specify the trace is present (ie either x and y or x and y and z)\n\n Both ``__init__`` (for the first trace) and the ``add`` method support\... | [
{
"param": "args",
"type": null
},
{
"param": "kwargs",
"type": null
}
] | {
"returns": [],
"raises": [
{
"docstring": "if the shape of the data does not match that of args",
"docstring_tokens": [
"if",
"the",
"shape",
"of",
"the",
"data",
"does",
"not",
"match",
"that",
"of",
"... |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | update | null | def update(self):
"""
Update the data in this plot, using the updaters given with
MatPlot.add() or in the included DataSets, then include this in
the plot.
This is a wrapper routine that the update widget calls,
inside this we call self.update() which should be subclasse... |
Update the data in this plot, using the updaters given with
MatPlot.add() or in the included DataSets, then include this in
the plot.
This is a wrapper routine that the update widget calls,
inside this we call self.update() which should be subclassed
| Update the data in this plot, using the updaters given with
MatPlot.add() or in the included DataSets, then include this in
the plot.
This is a wrapper routine that the update widget calls,
inside this we call self.update() which should be subclassed | [
"Update",
"the",
"data",
"in",
"this",
"plot",
"using",
"the",
"updaters",
"given",
"with",
"MatPlot",
".",
"add",
"()",
"or",
"in",
"the",
"included",
"DataSets",
"then",
"include",
"this",
"in",
"the",
"plot",
".",
"This",
"is",
"a",
"wrapper",
"routin... | def update(self):
any_updates = False
for updater in self.data_updaters:
updates = updater()
if updates is not False:
any_updates = True
self.update_plot()
if any_updates is False:
self.halt() | [
"def",
"update",
"(",
"self",
")",
":",
"any_updates",
"=",
"False",
"for",
"updater",
"in",
"self",
".",
"data_updaters",
":",
"updates",
"=",
"updater",
"(",
")",
"if",
"updates",
"is",
"not",
"False",
":",
"any_updates",
"=",
"True",
"self",
".",
"u... | Update the data in this plot, using the updaters given with
MatPlot.add() or in the included DataSets, then include this in
the plot. | [
"Update",
"the",
"data",
"in",
"this",
"plot",
"using",
"the",
"updaters",
"given",
"with",
"MatPlot",
".",
"add",
"()",
"or",
"in",
"the",
"included",
"DataSets",
"then",
"include",
"this",
"in",
"the",
"plot",
"."
] | [
"\"\"\"\n Update the data in this plot, using the updaters given with\n MatPlot.add() or in the included DataSets, then include this in\n the plot.\n\n This is a wrapper routine that the update widget calls,\n inside this we call self.update() which should be subclassed\n \... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | update_plot | null | def update_plot(self):
"""
Update the plot itself (typically called by self.update).
Should be implemented by a subclass
"""
raise NotImplementedError |
Update the plot itself (typically called by self.update).
Should be implemented by a subclass
| Update the plot itself (typically called by self.update).
Should be implemented by a subclass | [
"Update",
"the",
"plot",
"itself",
"(",
"typically",
"called",
"by",
"self",
".",
"update",
")",
".",
"Should",
"be",
"implemented",
"by",
"a",
"subclass"
] | def update_plot(self):
raise NotImplementedError | [
"def",
"update_plot",
"(",
"self",
")",
":",
"raise",
"NotImplementedError"
] | Update the plot itself (typically called by self.update). | [
"Update",
"the",
"plot",
"itself",
"(",
"typically",
"called",
"by",
"self",
".",
"update",
")",
"."
] | [
"\"\"\"\n Update the plot itself (typically called by self.update).\n Should be implemented by a subclass\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
838379880b4adab42024fed2981ff65f8746140c | jakeogh/Qcodes | qcodes/plots/base.py | [
"MIT"
] | Python | halt | null | def halt(self):
"""
Stop automatic updates to this plot, by canceling its update widget
"""
if hasattr(self, 'update_widget'):
self.update_widget.halt() |
Stop automatic updates to this plot, by canceling its update widget
| Stop automatic updates to this plot, by canceling its update widget | [
"Stop",
"automatic",
"updates",
"to",
"this",
"plot",
"by",
"canceling",
"its",
"update",
"widget"
] | def halt(self):
if hasattr(self, 'update_widget'):
self.update_widget.halt() | [
"def",
"halt",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
",",
"'update_widget'",
")",
":",
"self",
".",
"update_widget",
".",
"halt",
"(",
")"
] | Stop automatic updates to this plot, by canceling its update widget | [
"Stop",
"automatic",
"updates",
"to",
"this",
"plot",
"by",
"canceling",
"its",
"update",
"widget"
] | [
"\"\"\"\n Stop automatic updates to this plot, by canceling its update widget\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
5085011e1b0cc1eb5a5020208751fd263564338e | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_6500.py | [
"MIT"
] | Python | _parse_output_string | str | def _parse_output_string(string_value: str) -> str:
""" Parses and cleans string output of the multimeter. Removes the surrounding
whitespace, newline characters and quotes from the parsed data. Some results
are converted for readablitity (e.g. mov changes to moving).
Args:
string_value... | Parses and cleans string output of the multimeter. Removes the surrounding
whitespace, newline characters and quotes from the parsed data. Some results
are converted for readablitity (e.g. mov changes to moving).
Args:
string_value: The data returned from the multimeter reading commands.
... | Parses and cleans string output of the multimeter. Removes the surrounding
whitespace, newline characters and quotes from the parsed data. Some results
are converted for readablitity . | [
"Parses",
"and",
"cleans",
"string",
"output",
"of",
"the",
"multimeter",
".",
"Removes",
"the",
"surrounding",
"whitespace",
"newline",
"characters",
"and",
"quotes",
"from",
"the",
"parsed",
"data",
".",
"Some",
"results",
"are",
"converted",
"for",
"readablit... | def _parse_output_string(string_value: str) -> str:
s = string_value.strip().lower()
if (s[0] == s[-1]) and s.startswith(("'", '"')):
s = s[1:-1]
conversions = {'mov': 'moving', 'rep': 'repeat'}
if s in conversions.keys():
s = conversions[s]
return s | [
"def",
"_parse_output_string",
"(",
"string_value",
":",
"str",
")",
"->",
"str",
":",
"s",
"=",
"string_value",
".",
"strip",
"(",
")",
".",
"lower",
"(",
")",
"if",
"(",
"s",
"[",
"0",
"]",
"==",
"s",
"[",
"-",
"1",
"]",
")",
"and",
"s",
".",... | Parses and cleans string output of the multimeter. | [
"Parses",
"and",
"cleans",
"string",
"output",
"of",
"the",
"multimeter",
"."
] | [
"\"\"\" Parses and cleans string output of the multimeter. Removes the surrounding\n whitespace, newline characters and quotes from the parsed data. Some results\n are converted for readablitity (e.g. mov changes to moving).\n\n Args:\n string_value: The data returned from the multimeter rea... | [
{
"param": "string_value",
"type": "str"
}
] | {
"returns": [
{
"docstring": "The cleaned-up output of the multimeter.",
"docstring_tokens": [
"The",
"cleaned",
"-",
"up",
"output",
"of",
"the",
"multimeter",
"."
],
"type": null
}
],
"raises": [],
"params... |
5085011e1b0cc1eb5a5020208751fd263564338e | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_6500.py | [
"MIT"
] | Python | _parse_output_bool | bool | def _parse_output_bool(numeric_value: float) -> bool:
""" Parses and converts the value to boolean type. True is 1.
Args:
numeric_value: The numerical value to convert.
Returns:
The boolean representation of the numeric value.
"""
return bool(numeric_value) | Parses and converts the value to boolean type. True is 1.
Args:
numeric_value: The numerical value to convert.
Returns:
The boolean representation of the numeric value.
| Parses and converts the value to boolean type. True is 1. | [
"Parses",
"and",
"converts",
"the",
"value",
"to",
"boolean",
"type",
".",
"True",
"is",
"1",
"."
] | def _parse_output_bool(numeric_value: float) -> bool:
return bool(numeric_value) | [
"def",
"_parse_output_bool",
"(",
"numeric_value",
":",
"float",
")",
"->",
"bool",
":",
"return",
"bool",
"(",
"numeric_value",
")"
] | Parses and converts the value to boolean type. | [
"Parses",
"and",
"converts",
"the",
"value",
"to",
"boolean",
"type",
"."
] | [
"\"\"\" Parses and converts the value to boolean type. True is 1.\n\n Args:\n numeric_value: The numerical value to convert.\n\n Returns:\n The boolean representation of the numeric value.\n \"\"\""
] | [
{
"param": "numeric_value",
"type": "float"
}
] | {
"returns": [
{
"docstring": "The boolean representation of the numeric value.",
"docstring_tokens": [
"The",
"boolean",
"representation",
"of",
"the",
"numeric",
"value",
"."
],
"type": null
}
],
"raises": [],
"par... |
5085011e1b0cc1eb5a5020208751fd263564338e | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_6500.py | [
"MIT"
] | Python | _get_mode_param | T | def _get_mode_param(self, parameter: str, parser: Callable[[str], T]) -> T:
""" Reads the current mode of the multimeter and ask for the given parameter.
Args:
parameter: The asked parameter after getting the current mode.
parser: A function that parses the input buffer read.
... | Reads the current mode of the multimeter and ask for the given parameter.
Args:
parameter: The asked parameter after getting the current mode.
parser: A function that parses the input buffer read.
Returns:
Any: the parsed ask command. The parser determines the retu... | Reads the current mode of the multimeter and ask for the given parameter. | [
"Reads",
"the",
"current",
"mode",
"of",
"the",
"multimeter",
"and",
"ask",
"for",
"the",
"given",
"parameter",
"."
] | def _get_mode_param(self, parameter: str, parser: Callable[[str], T]) -> T:
mode = _parse_output_string(self._mode_map[self.mode()])
cmd = f'{mode}:{parameter}?'
return parser(self.ask(cmd)) | [
"def",
"_get_mode_param",
"(",
"self",
",",
"parameter",
":",
"str",
",",
"parser",
":",
"Callable",
"[",
"[",
"str",
"]",
",",
"T",
"]",
")",
"->",
"T",
":",
"mode",
"=",
"_parse_output_string",
"(",
"self",
".",
"_mode_map",
"[",
"self",
".",
"mode... | Reads the current mode of the multimeter and ask for the given parameter. | [
"Reads",
"the",
"current",
"mode",
"of",
"the",
"multimeter",
"and",
"ask",
"for",
"the",
"given",
"parameter",
"."
] | [
"\"\"\" Reads the current mode of the multimeter and ask for the given parameter.\n\n Args:\n parameter: The asked parameter after getting the current mode.\n parser: A function that parses the input buffer read.\n\n Returns:\n Any: the parsed ask command. The parser d... | [
{
"param": "self",
"type": null
},
{
"param": "parameter",
"type": "str"
},
{
"param": "parser",
"type": "Callable[[str], T]"
}
] | {
"returns": [
{
"docstring": "the parsed ask command. The parser determines the return data-type.",
"docstring_tokens": [
"the",
"parsed",
"ask",
"command",
".",
"The",
"parser",
"determines",
"the",
"return",
"da... |
5085011e1b0cc1eb5a5020208751fd263564338e | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_6500.py | [
"MIT"
] | Python | _set_mode_param | None | def _set_mode_param(self, parameter: str, value: Union[str, float, bool]) -> None:
""" Gets the current mode of the multimeter and sets the given parameter.
Args:
parameter: The set parameter after getting the current mode.
value: Value to set
"""
if isinstance(v... | Gets the current mode of the multimeter and sets the given parameter.
Args:
parameter: The set parameter after getting the current mode.
value: Value to set
| Gets the current mode of the multimeter and sets the given parameter. | [
"Gets",
"the",
"current",
"mode",
"of",
"the",
"multimeter",
"and",
"sets",
"the",
"given",
"parameter",
"."
] | def _set_mode_param(self, parameter: str, value: Union[str, float, bool]) -> None:
if isinstance(value, bool):
value = int(value)
mode = _parse_output_string(self._mode_map[self.mode()])
cmd = f'{mode}:{parameter} {value}'
self.write(cmd) | [
"def",
"_set_mode_param",
"(",
"self",
",",
"parameter",
":",
"str",
",",
"value",
":",
"Union",
"[",
"str",
",",
"float",
",",
"bool",
"]",
")",
"->",
"None",
":",
"if",
"isinstance",
"(",
"value",
",",
"bool",
")",
":",
"value",
"=",
"int",
"(",
... | Gets the current mode of the multimeter and sets the given parameter. | [
"Gets",
"the",
"current",
"mode",
"of",
"the",
"multimeter",
"and",
"sets",
"the",
"given",
"parameter",
"."
] | [
"\"\"\" Gets the current mode of the multimeter and sets the given parameter.\n\n Args:\n parameter: The set parameter after getting the current mode.\n value: Value to set\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "parameter",
"type": "str"
},
{
"param": "value",
"type": "Union[str, float, bool]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "parameter",
"type": "str",
"docstring": "The set parameter after ge... |
4cce1cbdf712610a28415539e685af51ac9d69e6 | jakeogh/Qcodes | qcodes/instrument/ip_to_visa.py | [
"MIT"
] | Python | close | None | def close(self) -> None:
"""Disconnect and irreversibly tear down the instrument."""
# VisaInstrument close
if getattr(self, 'visa_handle', None):
self.visa_handle.close()
# Instrument close
if hasattr(self, 'connection') and hasattr(self.connection, 'close'):
... | Disconnect and irreversibly tear down the instrument. | Disconnect and irreversibly tear down the instrument. | [
"Disconnect",
"and",
"irreversibly",
"tear",
"down",
"the",
"instrument",
"."
] | def close(self) -> None:
if getattr(self, 'visa_handle', None):
self.visa_handle.close()
if hasattr(self, 'connection') and hasattr(self.connection, 'close'):
self.connection.close()
strip_attrs(self, whitelist=['name'])
self.remove_instance(self) | [
"def",
"close",
"(",
"self",
")",
"->",
"None",
":",
"if",
"getattr",
"(",
"self",
",",
"'visa_handle'",
",",
"None",
")",
":",
"self",
".",
"visa_handle",
".",
"close",
"(",
")",
"if",
"hasattr",
"(",
"self",
",",
"'connection'",
")",
"and",
"hasatt... | Disconnect and irreversibly tear down the instrument. | [
"Disconnect",
"and",
"irreversibly",
"tear",
"down",
"the",
"instrument",
"."
] | [
"\"\"\"Disconnect and irreversibly tear down the instrument.\"\"\"",
"# VisaInstrument close",
"# Instrument close"
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
0de37e5b6fa4b6be1c17c48a7063c8608fb03830 | jakeogh/Qcodes | qcodes/dataset/data_export.py | [
"MIT"
] | Python | flatten_1D_data_for_plot | np.ndarray | def flatten_1D_data_for_plot(rawdata: Union[Sequence[Sequence[Any]],
np.ndarray]) -> np.ndarray:
"""
Cast the return value of the database query to
a 1D numpy array
Args:
rawdata: The return of the get_values function
Returns:
A one-dimen... |
Cast the return value of the database query to
a 1D numpy array
Args:
rawdata: The return of the get_values function
Returns:
A one-dimensional numpy array
| Cast the return value of the database query to
a 1D numpy array | [
"Cast",
"the",
"return",
"value",
"of",
"the",
"database",
"query",
"to",
"a",
"1D",
"numpy",
"array"
] | def flatten_1D_data_for_plot(rawdata: Union[Sequence[Sequence[Any]],
np.ndarray]) -> np.ndarray:
dataarray = np.array(rawdata).flatten()
return dataarray | [
"def",
"flatten_1D_data_for_plot",
"(",
"rawdata",
":",
"Union",
"[",
"Sequence",
"[",
"Sequence",
"[",
"Any",
"]",
"]",
",",
"np",
".",
"ndarray",
"]",
")",
"->",
"np",
".",
"ndarray",
":",
"dataarray",
"=",
"np",
".",
"array",
"(",
"rawdata",
")",
... | Cast the return value of the database query to
a 1D numpy array | [
"Cast",
"the",
"return",
"value",
"of",
"the",
"database",
"query",
"to",
"a",
"1D",
"numpy",
"array"
] | [
"\"\"\"\n Cast the return value of the database query to\n a 1D numpy array\n\n Args:\n rawdata: The return of the get_values function\n\n Returns:\n A one-dimensional numpy array\n\n \"\"\""
] | [
{
"param": "rawdata",
"type": "Union[Sequence[Sequence[Any]],\n np.ndarray]"
}
] | {
"returns": [
{
"docstring": "A one-dimensional numpy array",
"docstring_tokens": [
"A",
"one",
"-",
"dimensional",
"numpy",
"array"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "rawdata",
"type": ... |
0de37e5b6fa4b6be1c17c48a7063c8608fb03830 | jakeogh/Qcodes | qcodes/dataset/data_export.py | [
"MIT"
] | Python | _rows_from_datapoints | np.ndarray | def _rows_from_datapoints(inputsetpoints: np.ndarray) -> np.ndarray:
"""
Cast the (potentially) unordered setpoints into rows
of sorted, unique setpoint values. Because of the way they are ordered,
these rows do not necessarily correspond to actual rows of the scan,
but they can nonetheless be used ... |
Cast the (potentially) unordered setpoints into rows
of sorted, unique setpoint values. Because of the way they are ordered,
these rows do not necessarily correspond to actual rows of the scan,
but they can nonetheless be used to identify certain scan types
Args:
setpoints: The raw setpoin... | Cast the (potentially) unordered setpoints into rows
of sorted, unique setpoint values. Because of the way they are ordered,
these rows do not necessarily correspond to actual rows of the scan,
but they can nonetheless be used to identify certain scan types | [
"Cast",
"the",
"(",
"potentially",
")",
"unordered",
"setpoints",
"into",
"rows",
"of",
"sorted",
"unique",
"setpoint",
"values",
".",
"Because",
"of",
"the",
"way",
"they",
"are",
"ordered",
"these",
"rows",
"do",
"not",
"necessarily",
"correspond",
"to",
"... | def _rows_from_datapoints(inputsetpoints: np.ndarray) -> np.ndarray:
rows = []
setpoints = inputsetpoints.copy()
temp, inds, count = np.unique(setpoints, return_index=True,
return_counts=True)
num_repeats_array = np.unique(count)
if len(num_repeats_array) == 1 and c... | [
"def",
"_rows_from_datapoints",
"(",
"inputsetpoints",
":",
"np",
".",
"ndarray",
")",
"->",
"np",
".",
"ndarray",
":",
"rows",
"=",
"[",
"]",
"setpoints",
"=",
"inputsetpoints",
".",
"copy",
"(",
")",
"temp",
",",
"inds",
",",
"count",
"=",
"np",
".",... | Cast the (potentially) unordered setpoints into rows
of sorted, unique setpoint values. | [
"Cast",
"the",
"(",
"potentially",
")",
"unordered",
"setpoints",
"into",
"rows",
"of",
"sorted",
"unique",
"setpoint",
"values",
"."
] | [
"\"\"\"\n Cast the (potentially) unordered setpoints into rows\n of sorted, unique setpoint values. Because of the way they are ordered,\n these rows do not necessarily correspond to actual rows of the scan,\n but they can nonetheless be used to identify certain scan types\n\n Args:\n setpoint... | [
{
"param": "inputsetpoints",
"type": "np.ndarray"
}
] | {
"returns": [
{
"docstring": "A ndarray of the rows",
"docstring_tokens": [
"A",
"ndarray",
"of",
"the",
"rows"
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "inputsetpoints",
"type": "np.ndarray",
"d... |
0de37e5b6fa4b6be1c17c48a7063c8608fb03830 | jakeogh/Qcodes | qcodes/dataset/data_export.py | [
"MIT"
] | Python | _all_in_group_or_subgroup | bool | def _all_in_group_or_subgroup(rows: np.ndarray) -> bool:
"""
Detects whether the setpoints correspond to two groups of
of identical rows, one being contained in the other.
This is the test for whether the setpoints correspond to a
rectangular sweep. It allows for a single rectangular hole
in th... |
Detects whether the setpoints correspond to two groups of
of identical rows, one being contained in the other.
This is the test for whether the setpoints correspond to a
rectangular sweep. It allows for a single rectangular hole
in the setpoint grid, thus allowing for an interrupted sweep.
Not... | Detects whether the setpoints correspond to two groups of
of identical rows, one being contained in the other.
This is the test for whether the setpoints correspond to a
rectangular sweep. It allows for a single rectangular hole
in the setpoint grid, thus allowing for an interrupted sweep.
Note that each axis needs NO... | [
"Detects",
"whether",
"the",
"setpoints",
"correspond",
"to",
"two",
"groups",
"of",
"of",
"identical",
"rows",
"one",
"being",
"contained",
"in",
"the",
"other",
".",
"This",
"is",
"the",
"test",
"for",
"whether",
"the",
"setpoints",
"correspond",
"to",
"a"... | def _all_in_group_or_subgroup(rows: np.ndarray) -> bool:
groups = 1
comp_to = rows[0]
aigos = True
switchindex = 0
for rowind, row in enumerate(rows[1:]):
if np.array_equal(row, comp_to):
continue
else:
groups += 1
comp_to = row
switchi... | [
"def",
"_all_in_group_or_subgroup",
"(",
"rows",
":",
"np",
".",
"ndarray",
")",
"->",
"bool",
":",
"groups",
"=",
"1",
"comp_to",
"=",
"rows",
"[",
"0",
"]",
"aigos",
"=",
"True",
"switchindex",
"=",
"0",
"for",
"rowind",
",",
"row",
"in",
"enumerate"... | Detects whether the setpoints correspond to two groups of
of identical rows, one being contained in the other. | [
"Detects",
"whether",
"the",
"setpoints",
"correspond",
"to",
"two",
"groups",
"of",
"of",
"identical",
"rows",
"one",
"being",
"contained",
"in",
"the",
"other",
"."
] | [
"\"\"\"\n Detects whether the setpoints correspond to two groups of\n of identical rows, one being contained in the other.\n\n This is the test for whether the setpoints correspond to a\n rectangular sweep. It allows for a single rectangular hole\n in the setpoint grid, thus allowing for an interrupt... | [
{
"param": "rows",
"type": "np.ndarray"
}
] | {
"returns": [
{
"docstring": "A boolean indicating whether the setpoints meet the\ncriterion",
"docstring_tokens": [
"A",
"boolean",
"indicating",
"whether",
"the",
"setpoints",
"meet",
"the",
"criterion"
],
"type": n... |
0de37e5b6fa4b6be1c17c48a7063c8608fb03830 | jakeogh/Qcodes | qcodes/dataset/data_export.py | [
"MIT"
] | Python | _strings_as_ints | np.ndarray | def _strings_as_ints(inputarray: np.ndarray) -> np.ndarray:
"""
Return an integer-valued array version of a string-valued array. Maps, e.g.
array(['a', 'b', 'c', 'a', 'c']) to array([0, 1, 2, 0, 2]). Useful for
numerical setpoint analysis
Args:
inputarray: A 1D array of strings
"""
... |
Return an integer-valued array version of a string-valued array. Maps, e.g.
array(['a', 'b', 'c', 'a', 'c']) to array([0, 1, 2, 0, 2]). Useful for
numerical setpoint analysis
Args:
inputarray: A 1D array of strings
| Return an integer-valued array version of a string-valued array. | [
"Return",
"an",
"integer",
"-",
"valued",
"array",
"version",
"of",
"a",
"string",
"-",
"valued",
"array",
"."
] | def _strings_as_ints(inputarray: np.ndarray) -> np.ndarray:
newdata = np.zeros(len(inputarray))
for n, word in enumerate(np.unique(inputarray)):
newdata += ((inputarray == word).astype(int)*n)
return newdata | [
"def",
"_strings_as_ints",
"(",
"inputarray",
":",
"np",
".",
"ndarray",
")",
"->",
"np",
".",
"ndarray",
":",
"newdata",
"=",
"np",
".",
"zeros",
"(",
"len",
"(",
"inputarray",
")",
")",
"for",
"n",
",",
"word",
"in",
"enumerate",
"(",
"np",
".",
... | Return an integer-valued array version of a string-valued array. | [
"Return",
"an",
"integer",
"-",
"valued",
"array",
"version",
"of",
"a",
"string",
"-",
"valued",
"array",
"."
] | [
"\"\"\"\n Return an integer-valued array version of a string-valued array. Maps, e.g.\n array(['a', 'b', 'c', 'a', 'c']) to array([0, 1, 2, 0, 2]). Useful for\n numerical setpoint analysis\n\n Args:\n inputarray: A 1D array of strings\n \"\"\""
] | [
{
"param": "inputarray",
"type": "np.ndarray"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "inputarray",
"type": "np.ndarray",
"docstring": "A 1D array of strings",
"docstring_tokens": [
"A",
"1D",
"array",
"of",
"strings"
],
"default": null,
"is_optional": nu... |
0de37e5b6fa4b6be1c17c48a7063c8608fb03830 | jakeogh/Qcodes | qcodes/dataset/data_export.py | [
"MIT"
] | Python | datatype_from_setpoints_2d | str | def datatype_from_setpoints_2d(xpoints: np.ndarray,
ypoints: np.ndarray
) -> str:
"""
For a 2D plot, figure out what kind of visualisation we can use
to display the data.
Plot types are:
* '2D_point' - all setpoint are the same in each d... |
For a 2D plot, figure out what kind of visualisation we can use
to display the data.
Plot types are:
* '2D_point' - all setpoint are the same in each direction; one point
* '2D_grid' - colormap plot for data that is on a grid
* '2D_equidistant' - colormap plot for data that is on equidistant g... | For a 2D plot, figure out what kind of visualisation we can use
to display the data.
| [
"For",
"a",
"2D",
"plot",
"figure",
"out",
"what",
"kind",
"of",
"visualisation",
"we",
"can",
"use",
"to",
"display",
"the",
"data",
"."
] | def datatype_from_setpoints_2d(xpoints: np.ndarray,
ypoints: np.ndarray
) -> str:
if isinstance(xpoints[0], str):
xpoints = _strings_as_ints(xpoints)
if isinstance(ypoints[0], str):
ypoints = _strings_as_ints(ypoints)
x_all_the_sa... | [
"def",
"datatype_from_setpoints_2d",
"(",
"xpoints",
":",
"np",
".",
"ndarray",
",",
"ypoints",
":",
"np",
".",
"ndarray",
")",
"->",
"str",
":",
"if",
"isinstance",
"(",
"xpoints",
"[",
"0",
"]",
",",
"str",
")",
":",
"xpoints",
"=",
"_strings_as_ints",... | For a 2D plot, figure out what kind of visualisation we can use
to display the data. | [
"For",
"a",
"2D",
"plot",
"figure",
"out",
"what",
"kind",
"of",
"visualisation",
"we",
"can",
"use",
"to",
"display",
"the",
"data",
"."
] | [
"\"\"\"\n For a 2D plot, figure out what kind of visualisation we can use\n to display the data.\n\n Plot types are:\n * '2D_point' - all setpoint are the same in each direction; one point\n * '2D_grid' - colormap plot for data that is on a grid\n * '2D_equidistant' - colormap plot for data that i... | [
{
"param": "xpoints",
"type": "np.ndarray"
},
{
"param": "ypoints",
"type": "np.ndarray"
}
] | {
"returns": [
{
"docstring": "A string with the name of the determined plot type",
"docstring_tokens": [
"A",
"string",
"with",
"the",
"name",
"of",
"the",
"determined",
"plot",
"type"
],
"type": null
}
... |
e4c20878dd8b33dd426c0c6109900a17325eeb1d | jakeogh/Qcodes | qcodes/sphinx_extensions/parse_parameter_attr.py | [
"MIT"
] | Python | qcodes_parameter_attr_getter | Any | def qcodes_parameter_attr_getter(
object_to_document_attr_on: Type[object], name: str, *default: Any
) -> Any:
"""
Try to extract an attribute as a proxy object with a repr containing the code
if the class the attribute is bound to is a subclass of ``InstrumentBase``
and the attribute is not private... |
Try to extract an attribute as a proxy object with a repr containing the code
if the class the attribute is bound to is a subclass of ``InstrumentBase``
and the attribute is not private.
Args:
object_to_document_attr_on: The type (not instance of the object to detect the
attribute ... | Try to extract an attribute as a proxy object with a repr containing the code
if the class the attribute is bound to is a subclass of ``InstrumentBase``
and the attribute is not private. | [
"Try",
"to",
"extract",
"an",
"attribute",
"as",
"a",
"proxy",
"object",
"with",
"a",
"repr",
"containing",
"the",
"code",
"if",
"the",
"class",
"the",
"attribute",
"is",
"bound",
"to",
"is",
"a",
"subclass",
"of",
"`",
"`",
"InstrumentBase",
"`",
"`",
... | def qcodes_parameter_attr_getter(
object_to_document_attr_on: Type[object], name: str, *default: Any
) -> Any:
if (
inspect.isclass(object_to_document_attr_on)
and issubclass(object_to_document_attr_on, InstrumentBase)
and not name.startswith("_")
):
try:
attr = s... | [
"def",
"qcodes_parameter_attr_getter",
"(",
"object_to_document_attr_on",
":",
"Type",
"[",
"object",
"]",
",",
"name",
":",
"str",
",",
"*",
"default",
":",
"Any",
")",
"->",
"Any",
":",
"if",
"(",
"inspect",
".",
"isclass",
"(",
"object_to_document_attr_on",... | Try to extract an attribute as a proxy object with a repr containing the code
if the class the attribute is bound to is a subclass of ``InstrumentBase``
and the attribute is not private. | [
"Try",
"to",
"extract",
"an",
"attribute",
"as",
"a",
"proxy",
"object",
"with",
"a",
"repr",
"containing",
"the",
"code",
"if",
"the",
"class",
"the",
"attribute",
"is",
"bound",
"to",
"is",
"a",
"subclass",
"of",
"`",
"`",
"InstrumentBase",
"`",
"`",
... | [
"\"\"\"\n Try to extract an attribute as a proxy object with a repr containing the code\n if the class the attribute is bound to is a subclass of ``InstrumentBase``\n and the attribute is not private.\n\n Args:\n object_to_document_attr_on: The type (not instance of the object to detect the\n ... | [
{
"param": "object_to_document_attr_on",
"type": "Type[object]"
},
{
"param": "name",
"type": "str"
},
{
"param": "default",
"type": "Any"
}
] | {
"returns": [
{
"docstring": "Attribute looked up, proxy object containing the code of the attribute as a\nrepr or a default object.",
"docstring_tokens": [
"Attribute",
"looked",
"up",
"proxy",
"object",
"containing",
"the",
"code",
... |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | post_execution_status_poll | Callable[..., T] | def post_execution_status_poll(func: Callable[..., T]) -> Callable[..., T]:
"""
Generates a decorator that clears the instrument's status registers
before executing the actual call and reads the status register after the
function call to determine whether an error occurs.
Args:
func: functi... |
Generates a decorator that clears the instrument's status registers
before executing the actual call and reads the status register after the
function call to determine whether an error occurs.
Args:
func: function to wrap
| Generates a decorator that clears the instrument's status registers
before executing the actual call and reads the status register after the
function call to determine whether an error occurs. | [
"Generates",
"a",
"decorator",
"that",
"clears",
"the",
"instrument",
"'",
"s",
"status",
"registers",
"before",
"executing",
"the",
"actual",
"call",
"and",
"reads",
"the",
"status",
"register",
"after",
"the",
"function",
"call",
"to",
"determine",
"whether",
... | def post_execution_status_poll(func: Callable[..., T]) -> Callable[..., T]:
@wraps(func)
def wrapper(self: "Keysight34980A", *args: Any, **kwargs: Any) -> T:
self.clear_status()
retval = func(self, *args, **kwargs)
stb = self.get_status()
if stb:
warnings.warn(f"Instr... | [
"def",
"post_execution_status_poll",
"(",
"func",
":",
"Callable",
"[",
"...",
",",
"T",
"]",
")",
"->",
"Callable",
"[",
"...",
",",
"T",
"]",
":",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"self",
":",
"\"Keysight34980A\"",
",",
"*",
"... | Generates a decorator that clears the instrument's status registers
before executing the actual call and reads the status register after the
function call to determine whether an error occurs. | [
"Generates",
"a",
"decorator",
"that",
"clears",
"the",
"instrument",
"'",
"s",
"status",
"registers",
"before",
"executing",
"the",
"actual",
"call",
"and",
"reads",
"the",
"status",
"register",
"after",
"the",
"function",
"call",
"to",
"determine",
"whether",
... | [
"\"\"\"\n Generates a decorator that clears the instrument's status registers\n before executing the actual call and reads the status register after the\n function call to determine whether an error occurs.\n\n Args:\n func: function to wrap\n \"\"\""
] | [
{
"param": "func",
"type": "Callable[..., T]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "func",
"type": "Callable[..., T]",
"docstring": "function to wrap",
"docstring_tokens": [
"function",
"to",
"wrap"
],
"default": null,
"is_optional": null
}
],
"outlier_params"... |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | clear_status | None | def clear_status(self) -> None:
"""
Clears status register and error queue of the instrument.
"""
super().write('*CLS') |
Clears status register and error queue of the instrument.
| Clears status register and error queue of the instrument. | [
"Clears",
"status",
"register",
"and",
"error",
"queue",
"of",
"the",
"instrument",
"."
] | def clear_status(self) -> None:
super().write('*CLS') | [
"def",
"clear_status",
"(",
"self",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"write",
"(",
"'*CLS'",
")"
] | Clears status register and error queue of the instrument. | [
"Clears",
"status",
"register",
"and",
"error",
"queue",
"of",
"the",
"instrument",
"."
] | [
"\"\"\"\n Clears status register and error queue of 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": []
} |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | reset | None | def reset(self) -> None:
"""
Performs an instrument reset.
Does not reset error queue!
"""
super().write('*RST') |
Performs an instrument reset.
Does not reset error queue!
| Performs an instrument reset.
Does not reset error queue! | [
"Performs",
"an",
"instrument",
"reset",
".",
"Does",
"not",
"reset",
"error",
"queue!"
] | def reset(self) -> None:
super().write('*RST') | [
"def",
"reset",
"(",
"self",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"write",
"(",
"'*RST'",
")"
] | Performs an instrument reset. | [
"Performs",
"an",
"instrument",
"reset",
"."
] | [
"\"\"\"\n Performs an instrument reset.\n 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": []
} |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | scan_slots | None | def scan_slots(self) -> None:
"""
Scan the occupied slots and make an object for each switch matrix
module installed
"""
for slot in self.system_slots_info.keys():
model_string = self.system_slots_info[slot]['model']
for model in KEYSIGHT_MODELS:
... |
Scan the occupied slots and make an object for each switch matrix
module installed
| Scan the occupied slots and make an object for each switch matrix
module installed | [
"Scan",
"the",
"occupied",
"slots",
"and",
"make",
"an",
"object",
"for",
"each",
"switch",
"matrix",
"module",
"installed"
] | def scan_slots(self) -> None:
for slot in self.system_slots_info.keys():
model_string = self.system_slots_info[slot]['model']
for model in KEYSIGHT_MODELS:
if model in model_string:
sub_module_name = f'slot_{slot}_{model}'
sub_modul... | [
"def",
"scan_slots",
"(",
"self",
")",
"->",
"None",
":",
"for",
"slot",
"in",
"self",
".",
"system_slots_info",
".",
"keys",
"(",
")",
":",
"model_string",
"=",
"self",
".",
"system_slots_info",
"[",
"slot",
"]",
"[",
"'model'",
"]",
"for",
"model",
"... | Scan the occupied slots and make an object for each switch matrix
module installed | [
"Scan",
"the",
"occupied",
"slots",
"and",
"make",
"an",
"object",
"for",
"each",
"switch",
"matrix",
"module",
"installed"
] | [
"\"\"\"\n Scan the occupied slots and make an object for each switch matrix\n module installed\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | _system_slots_info | Dict[int, Dict[str, str]] | def _system_slots_info(self) -> Dict[int, Dict[str, str]]:
"""
the command SYST:CTYP? returns the following:
Agilent Technologies,<Model Number>,<Serial Number>,<Firmware Rev>
where <Model Number> is '0' if there is no module connected to the
given slot
Returns:
... |
the command SYST:CTYP? returns the following:
Agilent Technologies,<Model Number>,<Serial Number>,<Firmware Rev>
where <Model Number> is '0' if there is no module connected to the
given slot
Returns:
a dictionary, with slot numbers as the keys, and vendor/model/
... | the command SYST:CTYP. returns the following:
Agilent Technologies,,,
where is '0' if there is no module connected to the
given slot | [
"the",
"command",
"SYST",
":",
"CTYP",
".",
"returns",
"the",
"following",
":",
"Agilent",
"Technologies",
"where",
"is",
"'",
"0",
"'",
"if",
"there",
"is",
"no",
"module",
"connected",
"to",
"the",
"given",
"slot"
] | def _system_slots_info(self) -> Dict[int, Dict[str, str]]:
slots_dict = {}
keys = ['vendor', 'model', 'serial', 'firmware']
for i in range(1, self._total_slot+1):
identity = self.ask(f'SYST:CTYP? {i}').strip('"').split(',')
if identity[1] != '0':
slots_dic... | [
"def",
"_system_slots_info",
"(",
"self",
")",
"->",
"Dict",
"[",
"int",
",",
"Dict",
"[",
"str",
",",
"str",
"]",
"]",
":",
"slots_dict",
"=",
"{",
"}",
"keys",
"=",
"[",
"'vendor'",
",",
"'model'",
",",
"'serial'",
",",
"'firmware'",
"]",
"for",
... | the command SYST:CTYP? | [
"the",
"command",
"SYST",
":",
"CTYP?"
] | [
"\"\"\"\n the command SYST:CTYP? returns the following:\n Agilent Technologies,<Model Number>,<Serial Number>,<Firmware Rev>\n where <Model Number> is '0' if there is no module connected to the\n given slot\n\n Returns:\n a dictionary, with slot numbers as the keys, and... | [
{
"param": "self",
"type": null
}
] | {
"returns": [
{
"docstring": "a dictionary, with slot numbers as the keys, and vendor/model\nserial/firmware dictionaries as the values",
"docstring_tokens": [
"a",
"dictionary",
"with",
"slot",
"numbers",
"as",
"the",
"keys",
"a... |
d9eeee3478dba7f1aa7fe16c645011506ba40fc7 | jakeogh/Qcodes | qcodes/instrument_drivers/Keysight/keysight_34980a.py | [
"MIT"
] | Python | disconnect_all | None | def disconnect_all(self, slot: Optional[int] = None) -> None:
"""
to open/disconnect all connections on select module
Args:
slot: slot number, between 1 and 8 (self._total_slot),
default value is None, which means all slots
"""
cmd = 'ROUT:OPEN:AL... |
to open/disconnect all connections on select module
Args:
slot: slot number, between 1 and 8 (self._total_slot),
default value is None, which means all slots
| to open/disconnect all connections on select module | [
"to",
"open",
"/",
"disconnect",
"all",
"connections",
"on",
"select",
"module"
] | def disconnect_all(self, slot: Optional[int] = None) -> None:
cmd = 'ROUT:OPEN:ALL'
if slot is None:
self.write(cmd)
else:
vals.Ints(min_value=1, max_value=self._total_slot).validate(slot)
self.write(f'ROUT:OPEN:ALL {slot}') | [
"def",
"disconnect_all",
"(",
"self",
",",
"slot",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
")",
"->",
"None",
":",
"cmd",
"=",
"'ROUT:OPEN:ALL'",
"if",
"slot",
"is",
"None",
":",
"self",
".",
"write",
"(",
"cmd",
")",
"else",
":",
"vals",
".... | to open/disconnect all connections on select module | [
"to",
"open",
"/",
"disconnect",
"all",
"connections",
"on",
"select",
"module"
] | [
"\"\"\"\n to open/disconnect all connections on select module\n\n Args:\n slot: slot number, between 1 and 8 (self._total_slot),\n default value is None, which means all slots\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "slot",
"type": "Optional[int]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slot",
"type": "Optional[int]",
"docstring": "slot number, between ... |
cf5721109aafbf6f1f70b9edf723863701ab5a85 | jakeogh/Qcodes | qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py | [
"MIT"
] | Python | write_raw | None | def write_raw(self, cmd: str) -> None:
"""
Send a string command to the human interface device
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_string` method.
... |
Send a string command to the human interface device
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_string` method.
Args:
cmd: a command to send in a ... | Send a string command to the human interface device
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_string` method. | [
"Send",
"a",
"string",
"command",
"to",
"the",
"human",
"interface",
"device",
"The",
"given",
"command",
"is",
"processed",
"by",
"`",
"_pack_string",
"`",
"method",
"to",
"return",
"a",
"byte",
"sequence",
"that",
"is",
"going",
"to",
"be",
"actually",
"... | def write_raw(self, cmd: str) -> None:
data = self._pack_string(cmd)
result = self._device.send_output_report(data)
if not result:
raise RuntimeError(f"Communication with device failed for command "
f"{cmd}") | [
"def",
"write_raw",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"None",
":",
"data",
"=",
"self",
".",
"_pack_string",
"(",
"cmd",
")",
"result",
"=",
"self",
".",
"_device",
".",
"send_output_report",
"(",
"data",
")",
"if",
"not",
"result",
":"... | Send a string command to the human interface device
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device. | [
"Send",
"a",
"string",
"command",
"to",
"the",
"human",
"interface",
"device",
"The",
"given",
"command",
"is",
"processed",
"by",
"`",
"_pack_string",
"`",
"method",
"to",
"return",
"a",
"byte",
"sequence",
"that",
"is",
"going",
"to",
"be",
"actually",
"... | [
"\"\"\"\n Send a string command to the human interface device\n\n The given command is processed by `_pack_string` method to return a\n byte sequence that is going to be actually sent to the device.\n Subclasses must implement `_pack_string` method.\n\n Args:\n cmd: a co... | [
{
"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": "a command to send in a form of a... |
cf5721109aafbf6f1f70b9edf723863701ab5a85 | jakeogh/Qcodes | qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py | [
"MIT"
] | Python | ask_raw | str | def ask_raw(self, cmd: str) -> str:
"""
Send a string command to the human interface device and wait for a reply
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_st... |
Send a string command to the human interface device and wait for a reply
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_string` method.
The byte sequence of th... | Send a string command to the human interface device and wait for a reply
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device.
Subclasses must implement `_pack_string` method.
The byte sequence of the reply is processed by `_unpack_string`
m... | [
"Send",
"a",
"string",
"command",
"to",
"the",
"human",
"interface",
"device",
"and",
"wait",
"for",
"a",
"reply",
"The",
"given",
"command",
"is",
"processed",
"by",
"`",
"_pack_string",
"`",
"method",
"to",
"return",
"a",
"byte",
"sequence",
"that",
"is"... | def ask_raw(self, cmd: str) -> str:
self.write_raw(cmd)
number_of_tries = int(self._tries_per_second * self._timeout)
response = None
for _ in range(number_of_tries):
time.sleep(1 / self._tries_per_second)
response = self._get_data_buffer()
if response... | [
"def",
"ask_raw",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"str",
":",
"self",
".",
"write_raw",
"(",
"cmd",
")",
"number_of_tries",
"=",
"int",
"(",
"self",
".",
"_tries_per_second",
"*",
"self",
".",
"_timeout",
")",
"response",
"=",
"None",
... | Send a string command to the human interface device and wait for a reply
The given command is processed by `_pack_string` method to return a
byte sequence that is going to be actually sent to the device. | [
"Send",
"a",
"string",
"command",
"to",
"the",
"human",
"interface",
"device",
"and",
"wait",
"for",
"a",
"reply",
"The",
"given",
"command",
"is",
"processed",
"by",
"`",
"_pack_string",
"`",
"method",
"to",
"return",
"a",
"byte",
"sequence",
"that",
"is"... | [
"\"\"\"\n Send a string command to the human interface device and wait for a reply\n\n The given command is processed by `_pack_string` method to return a\n byte sequence that is going to be actually sent to the device.\n Subclasses must implement `_pack_string` method.\n\n The b... | [
{
"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": "a command to send in a form of a... |
cf5721109aafbf6f1f70b9edf723863701ab5a85 | jakeogh/Qcodes | qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py | [
"MIT"
] | Python | enumerate_devices | List[str] | def enumerate_devices(cls) -> List[str]:
"""
This method returns the 'instance_id's of all connected devices for
with the given product and vendor IDs.
"""
cls._check_hid_import()
devs = hid.HidDeviceFilter(
porduct_id=cls.product_id,
vendor_id=cl... |
This method returns the 'instance_id's of all connected devices for
with the given product and vendor IDs.
| This method returns the 'instance_id's of all connected devices for
with the given product and vendor IDs. | [
"This",
"method",
"returns",
"the",
"'",
"instance_id",
"'",
"s",
"of",
"all",
"connected",
"devices",
"for",
"with",
"the",
"given",
"product",
"and",
"vendor",
"IDs",
"."
] | def enumerate_devices(cls) -> List[str]:
cls._check_hid_import()
devs = hid.HidDeviceFilter(
porduct_id=cls.product_id,
vendor_id=cls.vendor_id
).get_devices()
return [dev.instance_id for dev in devs] | [
"def",
"enumerate_devices",
"(",
"cls",
")",
"->",
"List",
"[",
"str",
"]",
":",
"cls",
".",
"_check_hid_import",
"(",
")",
"devs",
"=",
"hid",
".",
"HidDeviceFilter",
"(",
"porduct_id",
"=",
"cls",
".",
"product_id",
",",
"vendor_id",
"=",
"cls",
".",
... | This method returns the 'instance_id's of all connected devices for
with the given product and vendor IDs. | [
"This",
"method",
"returns",
"the",
"'",
"instance_id",
"'",
"s",
"of",
"all",
"connected",
"devices",
"for",
"with",
"the",
"given",
"product",
"and",
"vendor",
"IDs",
"."
] | [
"\"\"\"\n This method returns the 'instance_id's of all connected devices for\n with the given product and vendor IDs.\n \"\"\""
] | [
{
"param": "cls",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "cls",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cf5721109aafbf6f1f70b9edf723863701ab5a85 | jakeogh/Qcodes | qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py | [
"MIT"
] | Python | _pack_string | bytes | def _pack_string(self, cmd: str) -> bytes:
"""
Pack a string to a binary format such that it can be sent to the HID.
Args:
cmd: a SCPI command to send
"""
str_len = len(cmd)
# "-1" is here because we need to compensate for the first byte in
# the pac... |
Pack a string to a binary format such that it can be sent to the HID.
Args:
cmd: a SCPI command to send
| Pack a string to a binary format such that it can be sent to the HID. | [
"Pack",
"a",
"string",
"to",
"a",
"binary",
"format",
"such",
"that",
"it",
"can",
"be",
"sent",
"to",
"the",
"HID",
"."
] | def _pack_string(self, cmd: str) -> bytes:
str_len = len(cmd)
pad_len = self.packet_size - str_len - 1
if pad_len < 0:
raise ValueError(f"Length of data exceeds {self.packet_size} B")
packed_data = struct.pack(
f"BB{str_len}s{pad_len}x",
self._usb_endp... | [
"def",
"_pack_string",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"bytes",
":",
"str_len",
"=",
"len",
"(",
"cmd",
")",
"pad_len",
"=",
"self",
".",
"packet_size",
"-",
"str_len",
"-",
"1",
"if",
"pad_len",
"<",
"0",
":",
"raise",
"ValueError",
... | Pack a string to a binary format such that it can be sent to the HID. | [
"Pack",
"a",
"string",
"to",
"a",
"binary",
"format",
"such",
"that",
"it",
"can",
"be",
"sent",
"to",
"the",
"HID",
"."
] | [
"\"\"\"\n Pack a string to a binary format such that it can be sent to the HID.\n\n Args:\n cmd: a SCPI command to send\n \"\"\"",
"# \"-1\" is here because we need to compensate for the first byte in",
"# the packet which is always the usb interrupt code of the command",
"# (i... | [
{
"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": "a SCPI command to send",
"... |
cf5721109aafbf6f1f70b9edf723863701ab5a85 | jakeogh/Qcodes | qcodes/instrument_drivers/Minicircuits/USBHIDMixin.py | [
"MIT"
] | Python | _unpack_string | str | def _unpack_string(self, response: bytes) ->str:
"""
Unpack data received from the instrument into a string
Note that this method is not specific to SCPI-only responses.
Args:
response: a raw byte sequence response from the instrument
"""
_, _, reply_data = ... |
Unpack data received from the instrument into a string
Note that this method is not specific to SCPI-only responses.
Args:
response: a raw byte sequence response from the instrument
| Unpack data received from the instrument into a string
Note that this method is not specific to SCPI-only responses. | [
"Unpack",
"data",
"received",
"from",
"the",
"instrument",
"into",
"a",
"string",
"Note",
"that",
"this",
"method",
"is",
"not",
"specific",
"to",
"SCPI",
"-",
"only",
"responses",
"."
] | def _unpack_string(self, response: bytes) ->str:
_, _, reply_data = struct.unpack(
f"BB{self.packet_size - 1}s",
bytes(response)
)
span = reply_data.find(self._end_of_message)
return reply_data[:span].decode("ascii") | [
"def",
"_unpack_string",
"(",
"self",
",",
"response",
":",
"bytes",
")",
"->",
"str",
":",
"_",
",",
"_",
",",
"reply_data",
"=",
"struct",
".",
"unpack",
"(",
"f\"BB{self.packet_size - 1}s\"",
",",
"bytes",
"(",
"response",
")",
")",
"span",
"=",
"repl... | Unpack data received from the instrument into a string
Note that this method is not specific to SCPI-only responses. | [
"Unpack",
"data",
"received",
"from",
"the",
"instrument",
"into",
"a",
"string",
"Note",
"that",
"this",
"method",
"is",
"not",
"specific",
"to",
"SCPI",
"-",
"only",
"responses",
"."
] | [
"\"\"\"\n Unpack data received from the instrument into a string\n\n Note that this method is not specific to SCPI-only responses.\n\n Args:\n response: a raw byte sequence response from the instrument\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "response",
"type": "bytes"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "response",
"type": "bytes",
"docstring": "a raw byte sequence respo... |
cf7c1b15949540ce6f10a03d1a4a0010eebaa69c | jakeogh/Qcodes | qcodes/tests/legacy/test_qcmatplotlib_functions.py | [
"MIT"
] | Python | make_simulated_xyz | Tuple[np.ndarray,
np.ndarray,
np.ndarray] | def make_simulated_xyz(xrange: np.ndarray,
yrange: np.ndarray,
step: int,
interrupt_at: int=0) -> Tuple[np.ndarray,
np.ndarray,
np.ndarray]:
... |
Make x, y, and z np.arrays like a Loop measurement would. In particular
get the positions of nans right.
Args:
xrange: a 1D array with inner loop set values
yrange: a 1D array with outer loop set values
step: is the outer loop (y) step, describes how far we are in the
mea... | Make x, y, and z np.arrays like a Loop measurement would. In particular
get the positions of nans right. | [
"Make",
"x",
"y",
"and",
"z",
"np",
".",
"arrays",
"like",
"a",
"Loop",
"measurement",
"would",
".",
"In",
"particular",
"get",
"the",
"positions",
"of",
"nans",
"right",
"."
] | def make_simulated_xyz(xrange: np.ndarray,
yrange: np.ndarray,
step: int,
interrupt_at: int=0) -> Tuple[np.ndarray,
np.ndarray,
np.ndarray]:
... | [
"def",
"make_simulated_xyz",
"(",
"xrange",
":",
"np",
".",
"ndarray",
",",
"yrange",
":",
"np",
".",
"ndarray",
",",
"step",
":",
"int",
",",
"interrupt_at",
":",
"int",
"=",
"0",
")",
"->",
"Tuple",
"[",
"np",
".",
"ndarray",
",",
"np",
".",
"nda... | Make x, y, and z np.arrays like a Loop measurement would. | [
"Make",
"x",
"y",
"and",
"z",
"np",
".",
"arrays",
"like",
"a",
"Loop",
"measurement",
"would",
"."
] | [
"\"\"\"\n Make x, y, and z np.arrays like a Loop measurement would. In particular\n get the positions of nans right.\n\n Args:\n xrange: a 1D array with inner loop set values\n yrange: a 1D array with outer loop set values\n step: is the outer loop (y) step, describes how far we are in... | [
{
"param": "xrange",
"type": "np.ndarray"
},
{
"param": "yrange",
"type": "np.ndarray"
},
{
"param": "step",
"type": "int"
},
{
"param": "interrupt_at",
"type": "int"
}
] | {
"returns": [
{
"docstring": "(x, y, z) where z is random noise",
"docstring_tokens": [
"(",
"x",
"y",
"z",
")",
"where",
"z",
"is",
"random",
"noise"
],
"type": null
}
],
"raises": [],
"params": [
... |
cfc318f2dbb2e9fa2e91e18abffdd4d2e01990b1 | jakeogh/Qcodes | qcodes/instrument/visa.py | [
"MIT"
] | Python | device_clear | None | def device_clear(self) -> None:
"""Clear the buffers of the device"""
# Serial instruments have a separate flush method to clear
# their buffers which behaves differently to clear. This is
# particularly important for instruments which do not support
# SCPI commands.
# ... | Clear the buffers of the device | Clear the buffers of the device | [
"Clear",
"the",
"buffers",
"of",
"the",
"device"
] | def device_clear(self) -> None:
if self.visabackend == 'sim':
return
flush_operation = (
vi_const.BufferOperation.discard_read_buffer_no_io |
vi_const.BufferOperation.discard_write_buffer
)
if isinstance(self.visa_handle, pyvisa.resources.Seria... | [
"def",
"device_clear",
"(",
"self",
")",
"->",
"None",
":",
"if",
"self",
".",
"visabackend",
"==",
"'sim'",
":",
"return",
"flush_operation",
"=",
"(",
"vi_const",
".",
"BufferOperation",
".",
"discard_read_buffer_no_io",
"|",
"vi_const",
".",
"BufferOperation"... | Clear the buffers of the device | [
"Clear",
"the",
"buffers",
"of",
"the",
"device"
] | [
"\"\"\"Clear the buffers of the device\"\"\"",
"# Serial instruments have a separate flush method to clear",
"# their buffers which behaves differently to clear. This is",
"# particularly important for instruments which do not support",
"# SCPI commands.",
"# Simulated instruments do not support a handle ... | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cfc318f2dbb2e9fa2e91e18abffdd4d2e01990b1 | jakeogh/Qcodes | qcodes/instrument/visa.py | [
"MIT"
] | Python | close | None | def close(self) -> None:
"""Disconnect and irreversibly tear down the instrument."""
if getattr(self, 'visa_handle', None):
self.visa_handle.close()
super().close() | Disconnect and irreversibly tear down the instrument. | Disconnect and irreversibly tear down the instrument. | [
"Disconnect",
"and",
"irreversibly",
"tear",
"down",
"the",
"instrument",
"."
] | def close(self) -> None:
if getattr(self, 'visa_handle', None):
self.visa_handle.close()
super().close() | [
"def",
"close",
"(",
"self",
")",
"->",
"None",
":",
"if",
"getattr",
"(",
"self",
",",
"'visa_handle'",
",",
"None",
")",
":",
"self",
".",
"visa_handle",
".",
"close",
"(",
")",
"super",
"(",
")",
".",
"close",
"(",
")"
] | Disconnect and irreversibly tear down the instrument. | [
"Disconnect",
"and",
"irreversibly",
"tear",
"down",
"the",
"instrument",
"."
] | [
"\"\"\"Disconnect and irreversibly tear down the instrument.\"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cfc318f2dbb2e9fa2e91e18abffdd4d2e01990b1 | jakeogh/Qcodes | qcodes/instrument/visa.py | [
"MIT"
] | Python | check_error | None | def check_error(self, ret_code: int) -> None:
"""
Default error checking, raises an error if return code ``!=0``.
Does not differentiate between warnings or specific error messages.
Override this function in your driver if you want to add specific
error messages.
Args:
... |
Default error checking, raises an error if return code ``!=0``.
Does not differentiate between warnings or specific error messages.
Override this function in your driver if you want to add specific
error messages.
Args:
ret_code: A Visa error code. See eg:
... | Default error checking, raises an error if return code ``!=0``.
Does not differentiate between warnings or specific error messages.
Override this function in your driver if you want to add specific
error messages. | [
"Default",
"error",
"checking",
"raises",
"an",
"error",
"if",
"return",
"code",
"`",
"`",
"!",
"=",
"0",
"`",
"`",
".",
"Does",
"not",
"differentiate",
"between",
"warnings",
"or",
"specific",
"error",
"messages",
".",
"Override",
"this",
"function",
"in"... | def check_error(self, ret_code: int) -> None:
if ret_code != 0:
raise visa.VisaIOError(ret_code) | [
"def",
"check_error",
"(",
"self",
",",
"ret_code",
":",
"int",
")",
"->",
"None",
":",
"if",
"ret_code",
"!=",
"0",
":",
"raise",
"visa",
".",
"VisaIOError",
"(",
"ret_code",
")"
] | Default error checking, raises an error if return code ``!=0``. | [
"Default",
"error",
"checking",
"raises",
"an",
"error",
"if",
"return",
"code",
"`",
"`",
"!",
"=",
"0",
"`",
"`",
"."
] | [
"\"\"\"\n Default error checking, raises an error if return code ``!=0``.\n Does not differentiate between warnings or specific error messages.\n Override this function in your driver if you want to add specific\n error messages.\n\n Args:\n ret_code: A Visa error code.... | [
{
"param": "self",
"type": null
},
{
"param": "ret_code",
"type": "int"
}
] | {
"returns": [],
"raises": [
{
"docstring": "if ``ret_code`` indicates a communication\nproblem.",
"docstring_tokens": [
"if",
"`",
"`",
"ret_code",
"`",
"`",
"indicates",
"a",
"communication",
"problem",
"."
... |
d95869c306bdb2bbc3c81ef7b64132821a3d72ad | jakeogh/Qcodes | qcodes/instrument/ip.py | [
"MIT"
] | Python | write_raw | None | def write_raw(self, cmd: str) -> None:
"""
Low-level interface to send a command that gets no response.
Args:
cmd: The command to send to the instrument.
"""
with self._ensure_connection:
self._send(cmd)
if self._confirmation:
... |
Low-level interface to send a command that gets no response.
Args:
cmd: The command to send to the instrument.
| Low-level interface to send a command that gets no response. | [
"Low",
"-",
"level",
"interface",
"to",
"send",
"a",
"command",
"that",
"gets",
"no",
"response",
"."
] | def write_raw(self, cmd: str) -> None:
with self._ensure_connection:
self._send(cmd)
if self._confirmation:
self._recv() | [
"def",
"write_raw",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"None",
":",
"with",
"self",
".",
"_ensure_connection",
":",
"self",
".",
"_send",
"(",
"cmd",
")",
"if",
"self",
".",
"_confirmation",
":",
"self",
".",
"_recv",
"(",
")"
] | Low-level interface to send a command that gets no response. | [
"Low",
"-",
"level",
"interface",
"to",
"send",
"a",
"command",
"that",
"gets",
"no",
"response",
"."
] | [
"\"\"\"\n Low-level interface to send a command that gets no response.\n\n Args:\n cmd: The command to send to the instrument.\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": "The command to send to the instr... |
d95869c306bdb2bbc3c81ef7b64132821a3d72ad | jakeogh/Qcodes | qcodes/instrument/ip.py | [
"MIT"
] | Python | ask_raw | str | def ask_raw(self, cmd: str) -> str:
"""
Low-level interface to send a command an read a response.
Args:
cmd: The command to send to the instrument.
Returns:
The instrument's string response.
"""
with self._ensure_connection:
self._sen... |
Low-level interface to send a command an read a response.
Args:
cmd: The command to send to the instrument.
Returns:
The instrument's string response.
| Low-level interface to send a command an read a response. | [
"Low",
"-",
"level",
"interface",
"to",
"send",
"a",
"command",
"an",
"read",
"a",
"response",
"."
] | def ask_raw(self, cmd: str) -> str:
with self._ensure_connection:
self._send(cmd)
return self._recv() | [
"def",
"ask_raw",
"(",
"self",
",",
"cmd",
":",
"str",
")",
"->",
"str",
":",
"with",
"self",
".",
"_ensure_connection",
":",
"self",
".",
"_send",
"(",
"cmd",
")",
"return",
"self",
".",
"_recv",
"(",
")"
] | Low-level interface to send a command an read a response. | [
"Low",
"-",
"level",
"interface",
"to",
"send",
"a",
"command",
"an",
"read",
"a",
"response",
"."
] | [
"\"\"\"\n Low-level interface to send a command an read a response.\n\n Args:\n cmd: The command to send to the instrument.\n\n Returns:\n The instrument's string response.\n \"\"\""
] | [
{
"param": "self",
"type": null
},
{
"param": "cmd",
"type": "str"
}
] | {
"returns": [
{
"docstring": "The instrument's string response.",
"docstring_tokens": [
"The",
"instrument",
"'",
"s",
"string",
"response",
"."
],
"type": null
}
],
"raises": [],
"params": [
{
"identifier": "self... |
76faa4fa718b75196743bb5f5464887e7d598d02 | jakeogh/Qcodes | qcodes/dataset/linked_datasets/links.py | [
"MIT"
] | Python | validate_node | None | def validate_node(node_guid: str, node: str) -> None:
"""
Validate that the guid given is a valid guid.
Args:
node_guid: the guid
node: either "head" or "tail"
"""
try:
validate_guid_format(node_guid)
except ValueError:
rai... |
Validate that the guid given is a valid guid.
Args:
node_guid: the guid
node: either "head" or "tail"
| Validate that the guid given is a valid guid. | [
"Validate",
"that",
"the",
"guid",
"given",
"is",
"a",
"valid",
"guid",
"."
] | def validate_node(node_guid: str, node: str) -> None:
try:
validate_guid_format(node_guid)
except ValueError:
raise ValueError(
f'The guid given for {node} is not a valid guid. Received '
f'{node_guid}.') | [
"def",
"validate_node",
"(",
"node_guid",
":",
"str",
",",
"node",
":",
"str",
")",
"->",
"None",
":",
"try",
":",
"validate_guid_format",
"(",
"node_guid",
")",
"except",
"ValueError",
":",
"raise",
"ValueError",
"(",
"f'The guid given for {node} is not a valid g... | Validate that the guid given is a valid guid. | [
"Validate",
"that",
"the",
"guid",
"given",
"is",
"a",
"valid",
"guid",
"."
] | [
"\"\"\"\n Validate that the guid given is a valid guid.\n\n Args:\n node_guid: the guid\n node: either \"head\" or \"tail\"\n \"\"\""
] | [
{
"param": "node_guid",
"type": "str"
},
{
"param": "node",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node_guid",
"type": "str",
"docstring": null,
"docstring_tokens": [
"None"
],
"default": null,
"is_optional": null
},
{
"identifier": "node",
"type": "str",
"docstring": "eit... |
76faa4fa718b75196743bb5f5464887e7d598d02 | jakeogh/Qcodes | qcodes/dataset/linked_datasets/links.py | [
"MIT"
] | Python | link_to_str | str | def link_to_str(link: Link) -> str:
"""
Convert a Link to a string
"""
return json.dumps(asdict(link)) |
Convert a Link to a string
| Convert a Link to a string | [
"Convert",
"a",
"Link",
"to",
"a",
"string"
] | def link_to_str(link: Link) -> str:
return json.dumps(asdict(link)) | [
"def",
"link_to_str",
"(",
"link",
":",
"Link",
")",
"->",
"str",
":",
"return",
"json",
".",
"dumps",
"(",
"asdict",
"(",
"link",
")",
")"
] | Convert a Link to a string | [
"Convert",
"a",
"Link",
"to",
"a",
"string"
] | [
"\"\"\"\n Convert a Link to a string\n \"\"\""
] | [
{
"param": "link",
"type": "Link"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "link",
"type": "Link",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
76faa4fa718b75196743bb5f5464887e7d598d02 | jakeogh/Qcodes | qcodes/dataset/linked_datasets/links.py | [
"MIT"
] | Python | str_to_link | Link | def str_to_link(string: str) -> Link:
"""
Convert a string to a Link
"""
ldict = json.loads(string)
link = Link(**ldict)
return link |
Convert a string to a Link
| Convert a string to a Link | [
"Convert",
"a",
"string",
"to",
"a",
"Link"
] | def str_to_link(string: str) -> Link:
ldict = json.loads(string)
link = Link(**ldict)
return link | [
"def",
"str_to_link",
"(",
"string",
":",
"str",
")",
"->",
"Link",
":",
"ldict",
"=",
"json",
".",
"loads",
"(",
"string",
")",
"link",
"=",
"Link",
"(",
"**",
"ldict",
")",
"return",
"link"
] | Convert a string to a Link | [
"Convert",
"a",
"string",
"to",
"a",
"Link"
] | [
"\"\"\"\n Convert a string to a Link\n \"\"\""
] | [
{
"param": "string",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "string",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
76faa4fa718b75196743bb5f5464887e7d598d02 | jakeogh/Qcodes | qcodes/dataset/linked_datasets/links.py | [
"MIT"
] | Python | links_to_str | str | def links_to_str(links: List[Link]) -> str:
"""
Convert a list of links to string. Note that this is the output that gets
stored in the DB file
"""
output = json.dumps([link_to_str(link) for link in links])
return output |
Convert a list of links to string. Note that this is the output that gets
stored in the DB file
| Convert a list of links to string. Note that this is the output that gets
stored in the DB file | [
"Convert",
"a",
"list",
"of",
"links",
"to",
"string",
".",
"Note",
"that",
"this",
"is",
"the",
"output",
"that",
"gets",
"stored",
"in",
"the",
"DB",
"file"
] | def links_to_str(links: List[Link]) -> str:
output = json.dumps([link_to_str(link) for link in links])
return output | [
"def",
"links_to_str",
"(",
"links",
":",
"List",
"[",
"Link",
"]",
")",
"->",
"str",
":",
"output",
"=",
"json",
".",
"dumps",
"(",
"[",
"link_to_str",
"(",
"link",
")",
"for",
"link",
"in",
"links",
"]",
")",
"return",
"output"
] | Convert a list of links to string. | [
"Convert",
"a",
"list",
"of",
"links",
"to",
"string",
"."
] | [
"\"\"\"\n Convert a list of links to string. Note that this is the output that gets\n stored in the DB file\n \"\"\""
] | [
{
"param": "links",
"type": "List[Link]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "links",
"type": "List[Link]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
76faa4fa718b75196743bb5f5464887e7d598d02 | jakeogh/Qcodes | qcodes/dataset/linked_datasets/links.py | [
"MIT"
] | Python | str_to_links | List[Link] | def str_to_links(links_string: str) -> List[Link]:
"""
Convert a string into a list of Links
"""
if links_string == '[]':
return []
link_dicts = [json.loads(l_str) for l_str in json.loads(links_string)]
links = [Link(**ld) for ld in link_dicts]
return links |
Convert a string into a list of Links
| Convert a string into a list of Links | [
"Convert",
"a",
"string",
"into",
"a",
"list",
"of",
"Links"
] | def str_to_links(links_string: str) -> List[Link]:
if links_string == '[]':
return []
link_dicts = [json.loads(l_str) for l_str in json.loads(links_string)]
links = [Link(**ld) for ld in link_dicts]
return links | [
"def",
"str_to_links",
"(",
"links_string",
":",
"str",
")",
"->",
"List",
"[",
"Link",
"]",
":",
"if",
"links_string",
"==",
"'[]'",
":",
"return",
"[",
"]",
"link_dicts",
"=",
"[",
"json",
".",
"loads",
"(",
"l_str",
")",
"for",
"l_str",
"in",
"jso... | Convert a string into a list of Links | [
"Convert",
"a",
"string",
"into",
"a",
"list",
"of",
"Links"
] | [
"\"\"\"\n Convert a string into a list of Links\n \"\"\""
] | [
{
"param": "links_string",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "links_string",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c0d363d1a0358eceab9526ce0b6c7fe97a58ca73 | jakeogh/Qcodes | qcodes/tests/dataset/test_sqlite_base.py | [
"MIT"
] | Python | shadow_conn | null | def shadow_conn(path_to_db: str):
"""
Simple context manager to create a connection for testing and
close it on exit
"""
conn = mut_db.connect(path_to_db)
yield conn
conn.close() |
Simple context manager to create a connection for testing and
close it on exit
| Simple context manager to create a connection for testing and
close it on exit | [
"Simple",
"context",
"manager",
"to",
"create",
"a",
"connection",
"for",
"testing",
"and",
"close",
"it",
"on",
"exit"
] | def shadow_conn(path_to_db: str):
conn = mut_db.connect(path_to_db)
yield conn
conn.close() | [
"def",
"shadow_conn",
"(",
"path_to_db",
":",
"str",
")",
":",
"conn",
"=",
"mut_db",
".",
"connect",
"(",
"path_to_db",
")",
"yield",
"conn",
"conn",
".",
"close",
"(",
")"
] | Simple context manager to create a connection for testing and
close it on exit | [
"Simple",
"context",
"manager",
"to",
"create",
"a",
"connection",
"for",
"testing",
"and",
"close",
"it",
"on",
"exit"
] | [
"\"\"\"\n Simple context manager to create a connection for testing and\n close it on exit\n \"\"\""
] | [
{
"param": "path_to_db",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "path_to_db",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
691cafce04d9d12d255c66d70936511cb9507363 | jakeogh/Qcodes | qcodes/dataset/experiment_settings.py | [
"MIT"
] | Python | _set_default_experiment_id | None | def _set_default_experiment_id(db_path: str, exp_id: int) -> None:
"""
Sets the default experiment with the exp_id of a created/ loaded
experiment for the database that this experiment belongs to.
Args:
db_path: The database that a created/ loaded experiment belongs to.
exp_id: The exp_... |
Sets the default experiment with the exp_id of a created/ loaded
experiment for the database that this experiment belongs to.
Args:
db_path: The database that a created/ loaded experiment belongs to.
exp_id: The exp_id of a created/ loaded experiment.
| Sets the default experiment with the exp_id of a created/ loaded
experiment for the database that this experiment belongs to. | [
"Sets",
"the",
"default",
"experiment",
"with",
"the",
"exp_id",
"of",
"a",
"created",
"/",
"loaded",
"experiment",
"for",
"the",
"database",
"that",
"this",
"experiment",
"belongs",
"to",
"."
] | def _set_default_experiment_id(db_path: str, exp_id: int) -> None:
global _default_experiment
_default_experiment[db_path] = exp_id | [
"def",
"_set_default_experiment_id",
"(",
"db_path",
":",
"str",
",",
"exp_id",
":",
"int",
")",
"->",
"None",
":",
"global",
"_default_experiment",
"_default_experiment",
"[",
"db_path",
"]",
"=",
"exp_id"
] | Sets the default experiment with the exp_id of a created/ loaded
experiment for the database that this experiment belongs to. | [
"Sets",
"the",
"default",
"experiment",
"with",
"the",
"exp_id",
"of",
"a",
"created",
"/",
"loaded",
"experiment",
"for",
"the",
"database",
"that",
"this",
"experiment",
"belongs",
"to",
"."
] | [
"\"\"\"\n Sets the default experiment with the exp_id of a created/ loaded\n experiment for the database that this experiment belongs to.\n\n Args:\n db_path: The database that a created/ loaded experiment belongs to.\n exp_id: The exp_id of a created/ loaded experiment.\n \"\"\""
] | [
{
"param": "db_path",
"type": "str"
},
{
"param": "exp_id",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "db_path",
"type": "str",
"docstring": "The database that a created/ loaded experiment belongs to.",
"docstring_tokens": [
"The",
"database",
"that",
"a",
"created",
"/",
... |
691cafce04d9d12d255c66d70936511cb9507363 | jakeogh/Qcodes | qcodes/dataset/experiment_settings.py | [
"MIT"
] | Python | reset_default_experiment_id | None | def reset_default_experiment_id(conn: Optional[ConnectionPlus] = None) -> None:
"""
Resets the default experiment id to to the last experiment in the db.
"""
global _default_experiment
if conn is None:
_default_experiment = {}
else:
db_path = path_to_dbfile(conn)
_default... |
Resets the default experiment id to to the last experiment in the db.
| Resets the default experiment id to to the last experiment in the db. | [
"Resets",
"the",
"default",
"experiment",
"id",
"to",
"to",
"the",
"last",
"experiment",
"in",
"the",
"db",
"."
] | def reset_default_experiment_id(conn: Optional[ConnectionPlus] = None) -> None:
global _default_experiment
if conn is None:
_default_experiment = {}
else:
db_path = path_to_dbfile(conn)
_default_experiment[db_path] = None | [
"def",
"reset_default_experiment_id",
"(",
"conn",
":",
"Optional",
"[",
"ConnectionPlus",
"]",
"=",
"None",
")",
"->",
"None",
":",
"global",
"_default_experiment",
"if",
"conn",
"is",
"None",
":",
"_default_experiment",
"=",
"{",
"}",
"else",
":",
"db_path",... | Resets the default experiment id to to the last experiment in the db. | [
"Resets",
"the",
"default",
"experiment",
"id",
"to",
"to",
"the",
"last",
"experiment",
"in",
"the",
"db",
"."
] | [
"\"\"\"\n Resets the default experiment id to to the last experiment in the db.\n \"\"\""
] | [
{
"param": "conn",
"type": "Optional[ConnectionPlus]"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "conn",
"type": "Optional[ConnectionPlus]",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f996a080be9554829e3ce3d11486b4d63a313ad4 | jakeogh/Qcodes | qcodes/dataset/descriptions/detect_shapes.py | [
"MIT"
] | Python | detect_shape_of_measurement | Dict[str, Tuple[int, ...]] | def detect_shape_of_measurement(
parameters: Sequence[_BaseParameter],
steps: Union[Sequence[int], Sequence[Sized]] = ()
) -> Dict[str, Tuple[int, ...]]:
"""
Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over. Note that the
... |
Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over. Note that the
steps should be given in the order from outer to inner loop and
the shape will be returned in C order with the inner loop at the
end.
Args:
parameters: T... | Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over. Note that the
steps should be given in the order from outer to inner loop and
the shape will be returned in C order with the inner loop at the
end. | [
"Construct",
"the",
"shape",
"of",
"a",
"measurement",
"of",
"a",
"dependent",
"parameter",
"from",
"the",
"parameter",
"and",
"the",
"axes",
"it",
"is",
"to",
"be",
"sweept",
"over",
".",
"Note",
"that",
"the",
"steps",
"should",
"be",
"given",
"in",
"t... | def detect_shape_of_measurement(
parameters: Sequence[_BaseParameter],
steps: Union[Sequence[int], Sequence[Sized]] = ()
) -> Dict[str, Tuple[int, ...]]:
loop_shape: List[int] = []
for step in steps:
loop_shape.append(_get_shape_of_step(step))
array_shapes: Dict[str, Tuple[int, ...]]... | [
"def",
"detect_shape_of_measurement",
"(",
"parameters",
":",
"Sequence",
"[",
"_BaseParameter",
"]",
",",
"steps",
":",
"Union",
"[",
"Sequence",
"[",
"int",
"]",
",",
"Sequence",
"[",
"Sized",
"]",
"]",
"=",
"(",
")",
")",
"->",
"Dict",
"[",
"str",
"... | Construct the shape of a measurement of a dependent parameter from the
parameter and the axes it is to be sweept over. | [
"Construct",
"the",
"shape",
"of",
"a",
"measurement",
"of",
"a",
"dependent",
"parameter",
"from",
"the",
"parameter",
"and",
"the",
"axes",
"it",
"is",
"to",
"be",
"sweept",
"over",
"."
] | [
"\"\"\"\n Construct the shape of a measurement of a dependent parameter from the\n parameter and the axes it is to be sweept over. Note that the\n steps should be given in the order from outer to inner loop and\n the shape will be returned in C order with the inner loop at the\n end.\n\n Args:\n ... | [
{
"param": "parameters",
"type": "Sequence[_BaseParameter]"
},
{
"param": "steps",
"type": "Union[Sequence[int], Sequence[Sized]]"
}
] | {
"returns": [
{
"docstring": "A dictionary from the parameter name to a tuple of integers describing\nthe shape.",
"docstring_tokens": [
"A",
"dictionary",
"from",
"the",
"parameter",
"name",
"to",
"a",
"tuple",
"of",
... |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | from_dict_to_current | current.RunDescriber | def from_dict_to_current(dct: RunDescriberDicts) -> current.RunDescriber:
"""
Convert a dict into a RunDescriber of the current version
"""
dct_version = dct['version']
if dct_version == 0:
return current.RunDescriber._from_dict(cast(RunDescriberV0Dict, dct))
elif dct_version == 1:
... |
Convert a dict into a RunDescriber of the current version
| Convert a dict into a RunDescriber of the current version | [
"Convert",
"a",
"dict",
"into",
"a",
"RunDescriber",
"of",
"the",
"current",
"version"
] | def from_dict_to_current(dct: RunDescriberDicts) -> current.RunDescriber:
dct_version = dct['version']
if dct_version == 0:
return current.RunDescriber._from_dict(cast(RunDescriberV0Dict, dct))
elif dct_version == 1:
return current.RunDescriber._from_dict(cast(RunDescriberV1Dict, dct))
e... | [
"def",
"from_dict_to_current",
"(",
"dct",
":",
"RunDescriberDicts",
")",
"->",
"current",
".",
"RunDescriber",
":",
"dct_version",
"=",
"dct",
"[",
"'version'",
"]",
"if",
"dct_version",
"==",
"0",
":",
"return",
"current",
".",
"RunDescriber",
".",
"_from_di... | Convert a dict into a RunDescriber of the current version | [
"Convert",
"a",
"dict",
"into",
"a",
"RunDescriber",
"of",
"the",
"current",
"version"
] | [
"\"\"\"\n Convert a dict into a RunDescriber of the current version\n \"\"\""
] | [
{
"param": "dct",
"type": "RunDescriberDicts"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dct",
"type": "RunDescriberDicts",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | to_dict_as_version | RunDescriberDicts | def to_dict_as_version(desc: current.RunDescriber,
version: int) -> RunDescriberDicts:
"""
Convert the given RunDescriber into a dictionary that represents a
RunDescriber of the given version
"""
input_version = desc.version
input_dict = desc._to_dict()
output_dict = _... |
Convert the given RunDescriber into a dictionary that represents a
RunDescriber of the given version
| Convert the given RunDescriber into a dictionary that represents a
RunDescriber of the given version | [
"Convert",
"the",
"given",
"RunDescriber",
"into",
"a",
"dictionary",
"that",
"represents",
"a",
"RunDescriber",
"of",
"the",
"given",
"version"
] | def to_dict_as_version(desc: current.RunDescriber,
version: int) -> RunDescriberDicts:
input_version = desc.version
input_dict = desc._to_dict()
output_dict = _converters[(input_version, version)](input_dict)
return output_dict | [
"def",
"to_dict_as_version",
"(",
"desc",
":",
"current",
".",
"RunDescriber",
",",
"version",
":",
"int",
")",
"->",
"RunDescriberDicts",
":",
"input_version",
"=",
"desc",
".",
"version",
"input_dict",
"=",
"desc",
".",
"_to_dict",
"(",
")",
"output_dict",
... | Convert the given RunDescriber into a dictionary that represents a
RunDescriber of the given version | [
"Convert",
"the",
"given",
"RunDescriber",
"into",
"a",
"dictionary",
"that",
"represents",
"a",
"RunDescriber",
"of",
"the",
"given",
"version"
] | [
"\"\"\"\n Convert the given RunDescriber into a dictionary that represents a\n RunDescriber of the given version\n \"\"\""
] | [
{
"param": "desc",
"type": "current.RunDescriber"
},
{
"param": "version",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "desc",
"type": "current.RunDescriber",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "version",
"type": "int",
"docstring": null,
... |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | to_dict_for_storage | RunDescriberDicts | def to_dict_for_storage(desc: current.RunDescriber) -> RunDescriberDicts:
"""
Convert a RunDescriber into a dictionary that represents the
RunDescriber of the storage version
"""
return to_dict_as_version(desc, STORAGE_VERSION) |
Convert a RunDescriber into a dictionary that represents the
RunDescriber of the storage version
| Convert a RunDescriber into a dictionary that represents the
RunDescriber of the storage version | [
"Convert",
"a",
"RunDescriber",
"into",
"a",
"dictionary",
"that",
"represents",
"the",
"RunDescriber",
"of",
"the",
"storage",
"version"
] | def to_dict_for_storage(desc: current.RunDescriber) -> RunDescriberDicts:
return to_dict_as_version(desc, STORAGE_VERSION) | [
"def",
"to_dict_for_storage",
"(",
"desc",
":",
"current",
".",
"RunDescriber",
")",
"->",
"RunDescriberDicts",
":",
"return",
"to_dict_as_version",
"(",
"desc",
",",
"STORAGE_VERSION",
")"
] | Convert a RunDescriber into a dictionary that represents the
RunDescriber of the storage version | [
"Convert",
"a",
"RunDescriber",
"into",
"a",
"dictionary",
"that",
"represents",
"the",
"RunDescriber",
"of",
"the",
"storage",
"version"
] | [
"\"\"\"\n Convert a RunDescriber into a dictionary that represents the\n RunDescriber of the storage version\n \"\"\""
] | [
{
"param": "desc",
"type": "current.RunDescriber"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "desc",
"type": "current.RunDescriber",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | to_json_for_storage | str | def to_json_for_storage(desc: current.RunDescriber) -> str:
"""
Serialize the given RunDescriber to JSON as a RunDescriber of the
version for storage
"""
return json.dumps(to_dict_for_storage(desc)) |
Serialize the given RunDescriber to JSON as a RunDescriber of the
version for storage
| Serialize the given RunDescriber to JSON as a RunDescriber of the
version for storage | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"JSON",
"as",
"a",
"RunDescriber",
"of",
"the",
"version",
"for",
"storage"
] | def to_json_for_storage(desc: current.RunDescriber) -> str:
return json.dumps(to_dict_for_storage(desc)) | [
"def",
"to_json_for_storage",
"(",
"desc",
":",
"current",
".",
"RunDescriber",
")",
"->",
"str",
":",
"return",
"json",
".",
"dumps",
"(",
"to_dict_for_storage",
"(",
"desc",
")",
")"
] | Serialize the given RunDescriber to JSON as a RunDescriber of the
version for storage | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"JSON",
"as",
"a",
"RunDescriber",
"of",
"the",
"version",
"for",
"storage"
] | [
"\"\"\"\n Serialize the given RunDescriber to JSON as a RunDescriber of the\n version for storage\n \"\"\""
] | [
{
"param": "desc",
"type": "current.RunDescriber"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "desc",
"type": "current.RunDescriber",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | to_json_as_version | str | def to_json_as_version(desc: current.RunDescriber, version: int) -> str:
"""
Serialize the given RunDescriber to JSON as a RunDescriber of the
given version. Only to be used in tests and upgraders
"""
return json.dumps(to_dict_as_version(desc, version)) |
Serialize the given RunDescriber to JSON as a RunDescriber of the
given version. Only to be used in tests and upgraders
| Serialize the given RunDescriber to JSON as a RunDescriber of the
given version. Only to be used in tests and upgraders | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"JSON",
"as",
"a",
"RunDescriber",
"of",
"the",
"given",
"version",
".",
"Only",
"to",
"be",
"used",
"in",
"tests",
"and",
"upgraders"
] | def to_json_as_version(desc: current.RunDescriber, version: int) -> str:
return json.dumps(to_dict_as_version(desc, version)) | [
"def",
"to_json_as_version",
"(",
"desc",
":",
"current",
".",
"RunDescriber",
",",
"version",
":",
"int",
")",
"->",
"str",
":",
"return",
"json",
".",
"dumps",
"(",
"to_dict_as_version",
"(",
"desc",
",",
"version",
")",
")"
] | Serialize the given RunDescriber to JSON as a RunDescriber of the
given version. | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"JSON",
"as",
"a",
"RunDescriber",
"of",
"the",
"given",
"version",
"."
] | [
"\"\"\"\n Serialize the given RunDescriber to JSON as a RunDescriber of the\n given version. Only to be used in tests and upgraders\n \"\"\""
] | [
{
"param": "desc",
"type": "current.RunDescriber"
},
{
"param": "version",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "desc",
"type": "current.RunDescriber",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "version",
"type": "int",
"docstring": null,
... |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | to_yaml_for_storage | str | def to_yaml_for_storage(desc: current.RunDescriber) -> str:
"""
Serialize the given RunDescriber to YAML as a RunDescriber of the
version for storage
"""
yaml = YAML()
with io.StringIO() as stream:
yaml.dump(to_dict_for_storage(desc), stream=stream)
output = stream.getvalue()
... |
Serialize the given RunDescriber to YAML as a RunDescriber of the
version for storage
| Serialize the given RunDescriber to YAML as a RunDescriber of the
version for storage | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"YAML",
"as",
"a",
"RunDescriber",
"of",
"the",
"version",
"for",
"storage"
] | def to_yaml_for_storage(desc: current.RunDescriber) -> str:
yaml = YAML()
with io.StringIO() as stream:
yaml.dump(to_dict_for_storage(desc), stream=stream)
output = stream.getvalue()
return output | [
"def",
"to_yaml_for_storage",
"(",
"desc",
":",
"current",
".",
"RunDescriber",
")",
"->",
"str",
":",
"yaml",
"=",
"YAML",
"(",
")",
"with",
"io",
".",
"StringIO",
"(",
")",
"as",
"stream",
":",
"yaml",
".",
"dump",
"(",
"to_dict_for_storage",
"(",
"d... | Serialize the given RunDescriber to YAML as a RunDescriber of the
version for storage | [
"Serialize",
"the",
"given",
"RunDescriber",
"to",
"YAML",
"as",
"a",
"RunDescriber",
"of",
"the",
"version",
"for",
"storage"
] | [
"\"\"\"\n Serialize the given RunDescriber to YAML as a RunDescriber of the\n version for storage\n \"\"\""
] | [
{
"param": "desc",
"type": "current.RunDescriber"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "desc",
"type": "current.RunDescriber",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
c687aeee5d3262290013870ee970c1f7696fa443 | jakeogh/Qcodes | qcodes/dataset/descriptions/versioning/serialization.py | [
"MIT"
] | Python | from_yaml_to_current | current.RunDescriber | def from_yaml_to_current(yaml_str: str) -> current.RunDescriber:
"""
Deserialize a YAML string into a RunDescriber of the current version
"""
yaml = YAML()
# yaml.load returns an OrderedDict, but we need a dict
ser = cast(RunDescriberDicts, dict(yaml.load(yaml_str)))
return from_dict_to_curr... |
Deserialize a YAML string into a RunDescriber of the current version
| Deserialize a YAML string into a RunDescriber of the current version | [
"Deserialize",
"a",
"YAML",
"string",
"into",
"a",
"RunDescriber",
"of",
"the",
"current",
"version"
] | def from_yaml_to_current(yaml_str: str) -> current.RunDescriber:
yaml = YAML()
ser = cast(RunDescriberDicts, dict(yaml.load(yaml_str)))
return from_dict_to_current(ser) | [
"def",
"from_yaml_to_current",
"(",
"yaml_str",
":",
"str",
")",
"->",
"current",
".",
"RunDescriber",
":",
"yaml",
"=",
"YAML",
"(",
")",
"ser",
"=",
"cast",
"(",
"RunDescriberDicts",
",",
"dict",
"(",
"yaml",
".",
"load",
"(",
"yaml_str",
")",
")",
"... | Deserialize a YAML string into a RunDescriber of the current version | [
"Deserialize",
"a",
"YAML",
"string",
"into",
"a",
"RunDescriber",
"of",
"the",
"current",
"version"
] | [
"\"\"\"\n Deserialize a YAML string into a RunDescriber of the current version\n \"\"\"",
"# yaml.load returns an OrderedDict, but we need a dict"
] | [
{
"param": "yaml_str",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "yaml_str",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
ab026aa45dd932adb9880fd50fe1e594af2116c2 | jakeogh/Qcodes | qcodes/measure.py | [
"MIT"
] | Python | run | <not_specific> | def run(self, use_threads=False, quiet=False, station=None, **kwargs):
"""
Run the actions in this measurement and return their data as a DataSet
Args:
quiet (Optional[bool]): Set True to not print anything except
errors. Default False.
station (Optional... |
Run the actions in this measurement and return their data as a DataSet
Args:
quiet (Optional[bool]): Set True to not print anything except
errors. Default False.
station (Optional[Station]): the ``Station`` this measurement
pertains to. Defaults... | Run the actions in this measurement and return their data as a DataSet | [
"Run",
"the",
"actions",
"in",
"this",
"measurement",
"and",
"return",
"their",
"data",
"as",
"a",
"DataSet"
] | def run(self, use_threads=False, quiet=False, station=None, **kwargs):
data_set = self._dummyLoop.get_data_set(**kwargs)
original_location = data_set.location
data_set.location = False
self._dummyLoop.run(use_threads=use_threads,
station=station, quiet=True)
... | [
"def",
"run",
"(",
"self",
",",
"use_threads",
"=",
"False",
",",
"quiet",
"=",
"False",
",",
"station",
"=",
"None",
",",
"**",
"kwargs",
")",
":",
"data_set",
"=",
"self",
".",
"_dummyLoop",
".",
"get_data_set",
"(",
"**",
"kwargs",
")",
"original_lo... | Run the actions in this measurement and return their data as a DataSet | [
"Run",
"the",
"actions",
"in",
"this",
"measurement",
"and",
"return",
"their",
"data",
"as",
"a",
"DataSet"
] | [
"\"\"\"\n Run the actions in this measurement and return their data as a DataSet\n\n Args:\n quiet (Optional[bool]): Set True to not print anything except\n errors. Default False.\n\n station (Optional[Station]): the ``Station`` this measurement\n pe... | [
{
"param": "self",
"type": null
},
{
"param": "use_threads",
"type": null
},
{
"param": "quiet",
"type": null
},
{
"param": "station",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "use_threads",
"type": null,
"docstring": "whether to parallelize ``... |
62944f8362b60af5599587634a000b75fbb08210 | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_s46.py | [
"MIT"
] | Python | is_closed | bool | def is_closed(self) -> bool:
"""
Returns: True if channels is closed, False otherwise.
"""
return self.get() == "close" |
Returns: True if channels is closed, False otherwise.
| True if channels is closed, False otherwise. | [
"True",
"if",
"channels",
"is",
"closed",
"False",
"otherwise",
"."
] | def is_closed(self) -> bool:
return self.get() == "close" | [
"def",
"is_closed",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"get",
"(",
")",
"==",
"\"close\""
] | Returns: True if channels is closed, False otherwise. | [
"Returns",
":",
"True",
"if",
"channels",
"is",
"closed",
"False",
"otherwise",
"."
] | [
"\"\"\"\n Returns: True if channels is closed, False otherwise.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
62944f8362b60af5599587634a000b75fbb08210 | jakeogh/Qcodes | qcodes/instrument_drivers/tektronix/Keithley_s46.py | [
"MIT"
] | Python | relay_layout | List[int] | def relay_layout(self) -> List[int]:
"""
The relay layout tells us how many channels we have per relay. Note
that we can have zero channels per relay.
"""
return [int(i) for i in self.ask(":CONF:CPOL?").split(",")] |
The relay layout tells us how many channels we have per relay. Note
that we can have zero channels per relay.
| The relay layout tells us how many channels we have per relay. Note
that we can have zero channels per relay. | [
"The",
"relay",
"layout",
"tells",
"us",
"how",
"many",
"channels",
"we",
"have",
"per",
"relay",
".",
"Note",
"that",
"we",
"can",
"have",
"zero",
"channels",
"per",
"relay",
"."
] | def relay_layout(self) -> List[int]:
return [int(i) for i in self.ask(":CONF:CPOL?").split(",")] | [
"def",
"relay_layout",
"(",
"self",
")",
"->",
"List",
"[",
"int",
"]",
":",
"return",
"[",
"int",
"(",
"i",
")",
"for",
"i",
"in",
"self",
".",
"ask",
"(",
"\":CONF:CPOL?\"",
")",
".",
"split",
"(",
"\",\"",
")",
"]"
] | The relay layout tells us how many channels we have per relay. | [
"The",
"relay",
"layout",
"tells",
"us",
"how",
"many",
"channels",
"we",
"have",
"per",
"relay",
"."
] | [
"\"\"\"\n The relay layout tells us how many channels we have per relay. Note\n that we can have zero channels per relay.\n \"\"\""
] | [
{
"param": "self",
"type": null
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "self",
"type": null,
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
51b8111ffa32d8906f685fdb3d75f1111ebe6d98 | jakeogh/Qcodes | qcodes/instrument_drivers/rigol/DG4000.py | [
"MIT"
] | Python | is_number | bool | def is_number(s: str) -> bool:
""" Test whether a given string can be parsed as a float """
try:
float(s)
return True
except ValueError:
return False | Test whether a given string can be parsed as a float | Test whether a given string can be parsed as a float | [
"Test",
"whether",
"a",
"given",
"string",
"can",
"be",
"parsed",
"as",
"a",
"float"
] | def is_number(s: str) -> bool:
try:
float(s)
return True
except ValueError:
return False | [
"def",
"is_number",
"(",
"s",
":",
"str",
")",
"->",
"bool",
":",
"try",
":",
"float",
"(",
"s",
")",
"return",
"True",
"except",
"ValueError",
":",
"return",
"False"
] | Test whether a given string can be parsed as a float | [
"Test",
"whether",
"a",
"given",
"string",
"can",
"be",
"parsed",
"as",
"a",
"float"
] | [
"\"\"\" Test whether a given string can be parsed as a float \"\"\""
] | [
{
"param": "s",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "s",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
51b8111ffa32d8906f685fdb3d75f1111ebe6d98 | jakeogh/Qcodes | qcodes/instrument_drivers/rigol/DG4000.py | [
"MIT"
] | Python | clean_string | str | def clean_string(s: str) -> str:
""" Clean string outputs of a VISA instrument for further parsing """
# Remove surrounding whitespace and newline characters
s = s.strip()
# Remove surrounding quotes
if (s[0] == s[-1]) and s.startswith(("'", '"')):
s = s[1:-1]
s = s.lower()
return... | Clean string outputs of a VISA instrument for further parsing | Clean string outputs of a VISA instrument for further parsing | [
"Clean",
"string",
"outputs",
"of",
"a",
"VISA",
"instrument",
"for",
"further",
"parsing"
] | def clean_string(s: str) -> str:
s = s.strip()
if (s[0] == s[-1]) and s.startswith(("'", '"')):
s = s[1:-1]
s = s.lower()
return s | [
"def",
"clean_string",
"(",
"s",
":",
"str",
")",
"->",
"str",
":",
"s",
"=",
"s",
".",
"strip",
"(",
")",
"if",
"(",
"s",
"[",
"0",
"]",
"==",
"s",
"[",
"-",
"1",
"]",
")",
"and",
"s",
".",
"startswith",
"(",
"(",
"\"'\"",
",",
"'\"'",
"... | Clean string outputs of a VISA instrument for further parsing | [
"Clean",
"string",
"outputs",
"of",
"a",
"VISA",
"instrument",
"for",
"further",
"parsing"
] | [
"\"\"\" Clean string outputs of a VISA instrument for further parsing \"\"\"",
"# Remove surrounding whitespace and newline characters",
"# Remove surrounding quotes"
] | [
{
"param": "s",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "s",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
51b8111ffa32d8906f685fdb3d75f1111ebe6d98 | jakeogh/Qcodes | qcodes/instrument_drivers/rigol/DG4000.py | [
"MIT"
] | Python | parse_string_output | Union[float, str] | def parse_string_output(s: str) -> Union[float, str]:
""" Parse an output of the VISA instrument into either text of a number """
s = clean_string(s)
# prevent float() from parsing 'infinity' into a float
if s == 'infinity':
return s
# If it is a number; parse it
if is_number(s):
... | Parse an output of the VISA instrument into either text of a number | Parse an output of the VISA instrument into either text of a number | [
"Parse",
"an",
"output",
"of",
"the",
"VISA",
"instrument",
"into",
"either",
"text",
"of",
"a",
"number"
] | def parse_string_output(s: str) -> Union[float, str]:
s = clean_string(s)
if s == 'infinity':
return s
if is_number(s):
return float(s)
return s | [
"def",
"parse_string_output",
"(",
"s",
":",
"str",
")",
"->",
"Union",
"[",
"float",
",",
"str",
"]",
":",
"s",
"=",
"clean_string",
"(",
"s",
")",
"if",
"s",
"==",
"'infinity'",
":",
"return",
"s",
"if",
"is_number",
"(",
"s",
")",
":",
"return",... | Parse an output of the VISA instrument into either text of a number | [
"Parse",
"an",
"output",
"of",
"the",
"VISA",
"instrument",
"into",
"either",
"text",
"of",
"a",
"number"
] | [
"\"\"\" Parse an output of the VISA instrument into either text of a number \"\"\"",
"# prevent float() from parsing 'infinity' into a float",
"# If it is a number; parse it"
] | [
{
"param": "s",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "s",
"type": "str",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
51b8111ffa32d8906f685fdb3d75f1111ebe6d98 | jakeogh/Qcodes | qcodes/instrument_drivers/rigol/DG4000.py | [
"MIT"
] | Python | parse_single_output | Union[float, str] | def parse_single_output(i: int, s: str) -> Union[float, str]:
""" Used as a partial function to parse output i in string s """
parts = clean_string(s).split(',')
return parse_string_output(parts[i]) | Used as a partial function to parse output i in string s | Used as a partial function to parse output i in string s | [
"Used",
"as",
"a",
"partial",
"function",
"to",
"parse",
"output",
"i",
"in",
"string",
"s"
] | def parse_single_output(i: int, s: str) -> Union[float, str]:
parts = clean_string(s).split(',')
return parse_string_output(parts[i]) | [
"def",
"parse_single_output",
"(",
"i",
":",
"int",
",",
"s",
":",
"str",
")",
"->",
"Union",
"[",
"float",
",",
"str",
"]",
":",
"parts",
"=",
"clean_string",
"(",
"s",
")",
".",
"split",
"(",
"','",
")",
"return",
"parse_string_output",
"(",
"parts... | Used as a partial function to parse output i in string s | [
"Used",
"as",
"a",
"partial",
"function",
"to",
"parse",
"output",
"i",
"in",
"string",
"s"
] | [
"\"\"\" Used as a partial function to parse output i in string s \"\"\""
] | [
{
"param": "i",
"type": "int"
},
{
"param": "s",
"type": "str"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "i",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "s",
"type": "str",
"docstring": null,
"docstring_tokens": [],
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.