repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
titusjan/argos | argos/config/qtctis.py | createPenStyleCti | def createPenStyleCti(nodeName, defaultData=0, includeNone=False):
""" Creates a ChoiceCti with Qt PenStyles.
If includeEmtpy is True, the first option will be None.
"""
displayValues=PEN_STYLE_DISPLAY_VALUES
configValues=PEN_STYLE_CONFIG_VALUES
if includeNone:
displayValues = [''] +... | python | def createPenStyleCti(nodeName, defaultData=0, includeNone=False):
""" Creates a ChoiceCti with Qt PenStyles.
If includeEmtpy is True, the first option will be None.
"""
displayValues=PEN_STYLE_DISPLAY_VALUES
configValues=PEN_STYLE_CONFIG_VALUES
if includeNone:
displayValues = [''] +... | [
"def",
"createPenStyleCti",
"(",
"nodeName",
",",
"defaultData",
"=",
"0",
",",
"includeNone",
"=",
"False",
")",
":",
"displayValues",
"=",
"PEN_STYLE_DISPLAY_VALUES",
"configValues",
"=",
"PEN_STYLE_CONFIG_VALUES",
"if",
"includeNone",
":",
"displayValues",
"=",
"... | Creates a ChoiceCti with Qt PenStyles.
If includeEmtpy is True, the first option will be None. | [
"Creates",
"a",
"ChoiceCti",
"with",
"Qt",
"PenStyles",
".",
"If",
"includeEmtpy",
"is",
"True",
"the",
"first",
"option",
"will",
"be",
"None",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L41-L51 |
titusjan/argos | argos/config/qtctis.py | createPenWidthCti | def createPenWidthCti(nodeName, defaultData=1.0, zeroValueText=None):
""" Creates a FloatCti with defaults for configuring a QPen width.
If specialValueZero is set, this string will be displayed when 0.0 is selected.
If specialValueZero is None, the minValue will be 0.1
"""
# A pen line wid... | python | def createPenWidthCti(nodeName, defaultData=1.0, zeroValueText=None):
""" Creates a FloatCti with defaults for configuring a QPen width.
If specialValueZero is set, this string will be displayed when 0.0 is selected.
If specialValueZero is None, the minValue will be 0.1
"""
# A pen line wid... | [
"def",
"createPenWidthCti",
"(",
"nodeName",
",",
"defaultData",
"=",
"1.0",
",",
"zeroValueText",
"=",
"None",
")",
":",
"# A pen line width of zero indicates a cosmetic pen. This means that the pen width is",
"# always drawn one pixel wide, independent of the transformation set on th... | Creates a FloatCti with defaults for configuring a QPen width.
If specialValueZero is set, this string will be displayed when 0.0 is selected.
If specialValueZero is None, the minValue will be 0.1 | [
"Creates",
"a",
"FloatCti",
"with",
"defaults",
"for",
"configuring",
"a",
"QPen",
"width",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L54-L65 |
titusjan/argos | argos/config/qtctis.py | fontFamilyIndex | def fontFamilyIndex(qFont, families):
""" Searches the index of qFont.family in the families list.
If qFont.family() is not in the list, the index of qFont.defaultFamily() is returned.
If that is also not present an error is raised.
"""
try:
return families.index(qFont.family())
... | python | def fontFamilyIndex(qFont, families):
""" Searches the index of qFont.family in the families list.
If qFont.family() is not in the list, the index of qFont.defaultFamily() is returned.
If that is also not present an error is raised.
"""
try:
return families.index(qFont.family())
... | [
"def",
"fontFamilyIndex",
"(",
"qFont",
",",
"families",
")",
":",
"try",
":",
"return",
"families",
".",
"index",
"(",
"qFont",
".",
"family",
"(",
")",
")",
"except",
"ValueError",
":",
"if",
"False",
"and",
"DEBUGGING",
":",
"raise",
"else",
":",
"l... | Searches the index of qFont.family in the families list.
If qFont.family() is not in the list, the index of qFont.defaultFamily() is returned.
If that is also not present an error is raised. | [
"Searches",
"the",
"index",
"of",
"qFont",
".",
"family",
"in",
"the",
"families",
"list",
".",
"If",
"qFont",
".",
"family",
"()",
"is",
"not",
"in",
"the",
"list",
"the",
"index",
"of",
"qFont",
".",
"defaultFamily",
"()",
"is",
"returned",
".",
"If"... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L68-L80 |
titusjan/argos | argos/config/qtctis.py | fontWeightIndex | def fontWeightIndex(qFont, weights):
""" Searches the index of qFont.family in the weight list.
If qFont.weight() is not in the list, the index of QFont.Normal is returned.
If that is also not present an error is raised.
"""
try:
return weights.index(qFont.weight())
except ValueE... | python | def fontWeightIndex(qFont, weights):
""" Searches the index of qFont.family in the weight list.
If qFont.weight() is not in the list, the index of QFont.Normal is returned.
If that is also not present an error is raised.
"""
try:
return weights.index(qFont.weight())
except ValueE... | [
"def",
"fontWeightIndex",
"(",
"qFont",
",",
"weights",
")",
":",
"try",
":",
"return",
"weights",
".",
"index",
"(",
"qFont",
".",
"weight",
"(",
")",
")",
"except",
"ValueError",
":",
"if",
"False",
"and",
"DEBUGGING",
":",
"raise",
"else",
":",
"log... | Searches the index of qFont.family in the weight list.
If qFont.weight() is not in the list, the index of QFont.Normal is returned.
If that is also not present an error is raised. | [
"Searches",
"the",
"index",
"of",
"qFont",
".",
"family",
"in",
"the",
"weight",
"list",
".",
"If",
"qFont",
".",
"weight",
"()",
"is",
"not",
"in",
"the",
"list",
"the",
"index",
"of",
"QFont",
".",
"Normal",
"is",
"returned",
".",
"If",
"that",
"is... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L83-L95 |
titusjan/argos | argos/config/qtctis.py | ColorCti._enforceDataType | def _enforceDataType(self, data):
""" Converts to str so that this CTI always stores that type.
"""
qColor = QtGui.QColor(data) # TODO: store a RGB string?
if not qColor.isValid():
raise ValueError("Invalid color specification: {!r}".format(data))
return qColor | python | def _enforceDataType(self, data):
""" Converts to str so that this CTI always stores that type.
"""
qColor = QtGui.QColor(data) # TODO: store a RGB string?
if not qColor.isValid():
raise ValueError("Invalid color specification: {!r}".format(data))
return qColor | [
"def",
"_enforceDataType",
"(",
"self",
",",
"data",
")",
":",
"qColor",
"=",
"QtGui",
".",
"QColor",
"(",
"data",
")",
"# TODO: store a RGB string?",
"if",
"not",
"qColor",
".",
"isValid",
"(",
")",
":",
"raise",
"ValueError",
"(",
"\"Invalid color specificat... | Converts to str so that this CTI always stores that type. | [
"Converts",
"to",
"str",
"so",
"that",
"this",
"CTI",
"always",
"stores",
"that",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L107-L113 |
titusjan/argos | argos/config/qtctis.py | ColorCti._nodeGetNonDefaultsDict | def _nodeGetNonDefaultsDict(self):
""" Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict
"""
dct = {}
if self.data != self.defaultData:
dct['data'] = self.data.name()
return dct | python | def _nodeGetNonDefaultsDict(self):
""" Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict
"""
dct = {}
if self.data != self.defaultData:
dct['data'] = self.data.name()
return dct | [
"def",
"_nodeGetNonDefaultsDict",
"(",
"self",
")",
":",
"dct",
"=",
"{",
"}",
"if",
"self",
".",
"data",
"!=",
"self",
".",
"defaultData",
":",
"dct",
"[",
"'data'",
"]",
"=",
"self",
".",
"data",
".",
"name",
"(",
")",
"return",
"dct"
] | Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict | [
"Retrieves",
"this",
"nodes",
"values",
"as",
"a",
"dictionary",
"to",
"be",
"used",
"for",
"persistence",
".",
"Non",
"-",
"recursive",
"auxiliary",
"function",
"for",
"getNonDefaultsDict"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L127-L134 |
titusjan/argos | argos/config/qtctis.py | ColorCti.createEditor | def createEditor(self, delegate, parent, option):
""" Creates a ColorCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return ColorCtiEditor(self, delegate, parent=parent) | python | def createEditor(self, delegate, parent, option):
""" Creates a ColorCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return ColorCtiEditor(self, delegate, parent=parent) | [
"def",
"createEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
",",
"option",
")",
":",
"return",
"ColorCtiEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
"=",
"parent",
")"
] | Creates a ColorCtiEditor.
For the parameters see the AbstractCti constructor documentation. | [
"Creates",
"a",
"ColorCtiEditor",
".",
"For",
"the",
"parameters",
"see",
"the",
"AbstractCti",
"constructor",
"documentation",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L145-L149 |
titusjan/argos | argos/config/qtctis.py | ColorCtiEditor.finalize | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.pickButton.clicked.disconnect(self.openColorDialog)
super(ColorCtiEditor, self).finalize() | python | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.pickButton.clicked.disconnect(self.openColorDialog)
super(ColorCtiEditor, self).finalize() | [
"def",
"finalize",
"(",
"self",
")",
":",
"self",
".",
"pickButton",
".",
"clicked",
".",
"disconnect",
"(",
"self",
".",
"openColorDialog",
")",
"super",
"(",
"ColorCtiEditor",
",",
"self",
")",
".",
"finalize",
"(",
")"
] | Is called when the editor is closed. Disconnect signals. | [
"Is",
"called",
"when",
"the",
"editor",
"is",
"closed",
".",
"Disconnect",
"signals",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L177-L181 |
titusjan/argos | argos/config/qtctis.py | ColorCtiEditor.openColorDialog | def openColorDialog(self):
""" Opens a QColorDialog for the user
"""
try:
currentColor = self.getData()
except InvalidInputError:
currentColor = self.cti.data
qColor = QtWidgets.QColorDialog.getColor(currentColor, self)
if qColor.isValid():
... | python | def openColorDialog(self):
""" Opens a QColorDialog for the user
"""
try:
currentColor = self.getData()
except InvalidInputError:
currentColor = self.cti.data
qColor = QtWidgets.QColorDialog.getColor(currentColor, self)
if qColor.isValid():
... | [
"def",
"openColorDialog",
"(",
"self",
")",
":",
"try",
":",
"currentColor",
"=",
"self",
".",
"getData",
"(",
")",
"except",
"InvalidInputError",
":",
"currentColor",
"=",
"self",
".",
"cti",
".",
"data",
"qColor",
"=",
"QtWidgets",
".",
"QColorDialog",
"... | Opens a QColorDialog for the user | [
"Opens",
"a",
"QColorDialog",
"for",
"the",
"user"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L184-L196 |
titusjan/argos | argos/config/qtctis.py | ColorCtiEditor.getData | def getData(self):
""" Gets data from the editor widget.
"""
text = self.lineEditor.text()
if not text.startswith('#'):
text = '#' + text
validator = self.lineEditor.validator()
if validator is not None:
state, text, _ = validator.validate(text, 0... | python | def getData(self):
""" Gets data from the editor widget.
"""
text = self.lineEditor.text()
if not text.startswith('#'):
text = '#' + text
validator = self.lineEditor.validator()
if validator is not None:
state, text, _ = validator.validate(text, 0... | [
"def",
"getData",
"(",
"self",
")",
":",
"text",
"=",
"self",
".",
"lineEditor",
".",
"text",
"(",
")",
"if",
"not",
"text",
".",
"startswith",
"(",
"'#'",
")",
":",
"text",
"=",
"'#'",
"+",
"text",
"validator",
"=",
"self",
".",
"lineEditor",
".",... | Gets data from the editor widget. | [
"Gets",
"data",
"from",
"the",
"editor",
"widget",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L205-L218 |
titusjan/argos | argos/config/qtctis.py | FontCti.data | def data(self, data):
""" Sets the font data of this item.
Does type conversion to ensure data is always of the correct type.
Also updates the children (which is the reason for this property to be overloaded.
"""
self._data = self._enforceDataType(data) # Enforce self._d... | python | def data(self, data):
""" Sets the font data of this item.
Does type conversion to ensure data is always of the correct type.
Also updates the children (which is the reason for this property to be overloaded.
"""
self._data = self._enforceDataType(data) # Enforce self._d... | [
"def",
"data",
"(",
"self",
",",
"data",
")",
":",
"self",
".",
"_data",
"=",
"self",
".",
"_enforceDataType",
"(",
"data",
")",
"# Enforce self._data to be a QFont",
"self",
".",
"familyCti",
".",
"data",
"=",
"fontFamilyIndex",
"(",
"self",
".",
"data",
... | Sets the font data of this item.
Does type conversion to ensure data is always of the correct type.
Also updates the children (which is the reason for this property to be overloaded. | [
"Sets",
"the",
"font",
"data",
"of",
"this",
"item",
".",
"Does",
"type",
"conversion",
"to",
"ensure",
"data",
"is",
"always",
"of",
"the",
"correct",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L269-L279 |
titusjan/argos | argos/config/qtctis.py | FontCti.defaultData | def defaultData(self, defaultData):
""" Sets the data of this item.
Does type conversion to ensure default data is always of the correct type.
"""
self._defaultData = self._enforceDataType(defaultData) # Enforce to be a QFont
self.familyCti.defaultData = fontFamilyIndex(self.... | python | def defaultData(self, defaultData):
""" Sets the data of this item.
Does type conversion to ensure default data is always of the correct type.
"""
self._defaultData = self._enforceDataType(defaultData) # Enforce to be a QFont
self.familyCti.defaultData = fontFamilyIndex(self.... | [
"def",
"defaultData",
"(",
"self",
",",
"defaultData",
")",
":",
"self",
".",
"_defaultData",
"=",
"self",
".",
"_enforceDataType",
"(",
"defaultData",
")",
"# Enforce to be a QFont",
"self",
".",
"familyCti",
".",
"defaultData",
"=",
"fontFamilyIndex",
"(",
"se... | Sets the data of this item.
Does type conversion to ensure default data is always of the correct type. | [
"Sets",
"the",
"data",
"of",
"this",
"item",
".",
"Does",
"type",
"conversion",
"to",
"ensure",
"default",
"data",
"is",
"always",
"of",
"the",
"correct",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L290-L299 |
titusjan/argos | argos/config/qtctis.py | FontCti._updateTargetFromNode | def _updateTargetFromNode(self):
""" Applies the font config settings to the target widget's font.
That is the targetWidget.setFont() is called with a font create from the config values.
"""
font = self.data
if self.familyCti.configValue:
font.setFamily(self.fami... | python | def _updateTargetFromNode(self):
""" Applies the font config settings to the target widget's font.
That is the targetWidget.setFont() is called with a font create from the config values.
"""
font = self.data
if self.familyCti.configValue:
font.setFamily(self.fami... | [
"def",
"_updateTargetFromNode",
"(",
"self",
")",
":",
"font",
"=",
"self",
".",
"data",
"if",
"self",
".",
"familyCti",
".",
"configValue",
":",
"font",
".",
"setFamily",
"(",
"self",
".",
"familyCti",
".",
"configValue",
")",
"else",
":",
"font",
".",
... | Applies the font config settings to the target widget's font.
That is the targetWidget.setFont() is called with a font create from the config values. | [
"Applies",
"the",
"font",
"config",
"settings",
"to",
"the",
"target",
"widget",
"s",
"font",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L324-L337 |
titusjan/argos | argos/config/qtctis.py | FontCti._nodeGetNonDefaultsDict | def _nodeGetNonDefaultsDict(self):
""" Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict
"""
dct = {}
if self.data != self.defaultData:
dct['data'] = self.data.toString() # calls QFont.... | python | def _nodeGetNonDefaultsDict(self):
""" Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict
"""
dct = {}
if self.data != self.defaultData:
dct['data'] = self.data.toString() # calls QFont.... | [
"def",
"_nodeGetNonDefaultsDict",
"(",
"self",
")",
":",
"dct",
"=",
"{",
"}",
"if",
"self",
".",
"data",
"!=",
"self",
".",
"defaultData",
":",
"dct",
"[",
"'data'",
"]",
"=",
"self",
".",
"data",
".",
"toString",
"(",
")",
"# calls QFont.toString()",
... | Retrieves this nodes` values as a dictionary to be used for persistence.
Non-recursive auxiliary function for getNonDefaultsDict | [
"Retrieves",
"this",
"nodes",
"values",
"as",
"a",
"dictionary",
"to",
"be",
"used",
"for",
"persistence",
".",
"Non",
"-",
"recursive",
"auxiliary",
"function",
"for",
"getNonDefaultsDict"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L340-L347 |
titusjan/argos | argos/config/qtctis.py | FontCti._nodeSetValuesFromDict | def _nodeSetValuesFromDict(self, dct):
""" Sets values from a dictionary in the current node.
Non-recursive auxiliary function for setValuesFromDict
"""
if 'data' in dct:
qFont = QtGui.QFont()
success = qFont.fromString(dct['data'])
if not success:... | python | def _nodeSetValuesFromDict(self, dct):
""" Sets values from a dictionary in the current node.
Non-recursive auxiliary function for setValuesFromDict
"""
if 'data' in dct:
qFont = QtGui.QFont()
success = qFont.fromString(dct['data'])
if not success:... | [
"def",
"_nodeSetValuesFromDict",
"(",
"self",
",",
"dct",
")",
":",
"if",
"'data'",
"in",
"dct",
":",
"qFont",
"=",
"QtGui",
".",
"QFont",
"(",
")",
"success",
"=",
"qFont",
".",
"fromString",
"(",
"dct",
"[",
"'data'",
"]",
")",
"if",
"not",
"succes... | Sets values from a dictionary in the current node.
Non-recursive auxiliary function for setValuesFromDict | [
"Sets",
"values",
"from",
"a",
"dictionary",
"in",
"the",
"current",
"node",
".",
"Non",
"-",
"recursive",
"auxiliary",
"function",
"for",
"setValuesFromDict"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L350-L362 |
titusjan/argos | argos/config/qtctis.py | FontCti.createEditor | def createEditor(self, delegate, parent, option):
""" Creates a FontCtiEditor.
For the parameters see the AbstractCti documentation.
"""
return FontCtiEditor(self, delegate, parent=parent) | python | def createEditor(self, delegate, parent, option):
""" Creates a FontCtiEditor.
For the parameters see the AbstractCti documentation.
"""
return FontCtiEditor(self, delegate, parent=parent) | [
"def",
"createEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
",",
"option",
")",
":",
"return",
"FontCtiEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
"=",
"parent",
")"
] | Creates a FontCtiEditor.
For the parameters see the AbstractCti documentation. | [
"Creates",
"a",
"FontCtiEditor",
".",
"For",
"the",
"parameters",
"see",
"the",
"AbstractCti",
"documentation",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L365-L369 |
titusjan/argos | argos/config/qtctis.py | FontCtiEditor.finalize | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.pickButton.clicked.disconnect(self.execFontDialog)
super(FontCtiEditor, self).finalize() | python | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.pickButton.clicked.disconnect(self.execFontDialog)
super(FontCtiEditor, self).finalize() | [
"def",
"finalize",
"(",
"self",
")",
":",
"self",
".",
"pickButton",
".",
"clicked",
".",
"disconnect",
"(",
"self",
".",
"execFontDialog",
")",
"super",
"(",
"FontCtiEditor",
",",
"self",
")",
".",
"finalize",
"(",
")"
] | Is called when the editor is closed. Disconnect signals. | [
"Is",
"called",
"when",
"the",
"editor",
"is",
"closed",
".",
"Disconnect",
"signals",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L396-L400 |
titusjan/argos | argos/config/qtctis.py | FontCtiEditor.execFontDialog | def execFontDialog(self):
""" Opens a QColorDialog for the user
"""
currentFont = self.getData()
newFont, ok = QtGui.QFontDialog.getFont(currentFont, self)
if ok:
self.setData(newFont)
else:
self.setData(currentFont)
self.commitAndClose() | python | def execFontDialog(self):
""" Opens a QColorDialog for the user
"""
currentFont = self.getData()
newFont, ok = QtGui.QFontDialog.getFont(currentFont, self)
if ok:
self.setData(newFont)
else:
self.setData(currentFont)
self.commitAndClose() | [
"def",
"execFontDialog",
"(",
"self",
")",
":",
"currentFont",
"=",
"self",
".",
"getData",
"(",
")",
"newFont",
",",
"ok",
"=",
"QtGui",
".",
"QFontDialog",
".",
"getFont",
"(",
"currentFont",
",",
"self",
")",
"if",
"ok",
":",
"self",
".",
"setData",... | Opens a QColorDialog for the user | [
"Opens",
"a",
"QColorDialog",
"for",
"the",
"user"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L403-L412 |
titusjan/argos | argos/config/qtctis.py | FontChoiceCti.createEditor | def createEditor(self, delegate, parent, option):
""" Creates a ChoiceCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return FontChoiceCtiEditor(self, delegate, parent=parent) | python | def createEditor(self, delegate, parent, option):
""" Creates a ChoiceCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return FontChoiceCtiEditor(self, delegate, parent=parent) | [
"def",
"createEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
",",
"option",
")",
":",
"return",
"FontChoiceCtiEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
"=",
"parent",
")"
] | Creates a ChoiceCtiEditor.
For the parameters see the AbstractCti constructor documentation. | [
"Creates",
"a",
"ChoiceCtiEditor",
".",
"For",
"the",
"parameters",
"see",
"the",
"AbstractCti",
"constructor",
"documentation",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L464-L468 |
titusjan/argos | argos/config/qtctis.py | FontChoiceCtiEditor.finalize | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.comboBox.activated.disconnect(self.comboBoxActivated)
super(FontChoiceCtiEditor, self).finalize() | python | def finalize(self):
""" Is called when the editor is closed. Disconnect signals.
"""
self.comboBox.activated.disconnect(self.comboBoxActivated)
super(FontChoiceCtiEditor, self).finalize() | [
"def",
"finalize",
"(",
"self",
")",
":",
"self",
".",
"comboBox",
".",
"activated",
".",
"disconnect",
"(",
"self",
".",
"comboBoxActivated",
")",
"super",
"(",
"FontChoiceCtiEditor",
",",
"self",
")",
".",
"finalize",
"(",
")"
] | Is called when the editor is closed. Disconnect signals. | [
"Is",
"called",
"when",
"the",
"editor",
"is",
"closed",
".",
"Disconnect",
"signals",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L498-L502 |
titusjan/argos | argos/config/qtctis.py | PenCti.configValue | def configValue(self):
""" Creates a QPen made of the children's config values.
"""
if not self.data:
return None
else:
pen = QtGui.QPen()
pen.setCosmetic(True)
pen.setColor(self.colorCti.configValue)
style = self.styleCti.confi... | python | def configValue(self):
""" Creates a QPen made of the children's config values.
"""
if not self.data:
return None
else:
pen = QtGui.QPen()
pen.setCosmetic(True)
pen.setColor(self.colorCti.configValue)
style = self.styleCti.confi... | [
"def",
"configValue",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"data",
":",
"return",
"None",
"else",
":",
"pen",
"=",
"QtGui",
".",
"QPen",
"(",
")",
"pen",
".",
"setCosmetic",
"(",
"True",
")",
"pen",
".",
"setColor",
"(",
"self",
".",
... | Creates a QPen made of the children's config values. | [
"Creates",
"a",
"QPen",
"made",
"of",
"the",
"children",
"s",
"config",
"values",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L560-L573 |
titusjan/argos | argos/config/qtctis.py | PenCti.createPen | def createPen(self, altStyle=None, altWidth=None):
""" Creates a pen from the config values with the style overridden by altStyle if the
None-option is selected in the combo box.
"""
pen = self.configValue
if pen is not None:
style = self.findByNodePath('style').... | python | def createPen(self, altStyle=None, altWidth=None):
""" Creates a pen from the config values with the style overridden by altStyle if the
None-option is selected in the combo box.
"""
pen = self.configValue
if pen is not None:
style = self.findByNodePath('style').... | [
"def",
"createPen",
"(",
"self",
",",
"altStyle",
"=",
"None",
",",
"altWidth",
"=",
"None",
")",
":",
"pen",
"=",
"self",
".",
"configValue",
"if",
"pen",
"is",
"not",
"None",
":",
"style",
"=",
"self",
".",
"findByNodePath",
"(",
"'style'",
")",
".... | Creates a pen from the config values with the style overridden by altStyle if the
None-option is selected in the combo box. | [
"Creates",
"a",
"pen",
"from",
"the",
"config",
"values",
"with",
"the",
"style",
"overridden",
"by",
"altStyle",
"if",
"the",
"None",
"-",
"option",
"is",
"selected",
"in",
"the",
"combo",
"box",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/qtctis.py#L576-L592 |
titusjan/argos | argos/utils/masks.py | replaceMaskedValue | def replaceMaskedValue(data, mask, replacementValue, copyOnReplace=True):
""" Replaces values where the mask is True with the replacement value.
:copyOnReplace makeCopy: If True (the default) it makes a copy if data is replaced.
"""
if mask is False:
result = data
elif mask is True:
... | python | def replaceMaskedValue(data, mask, replacementValue, copyOnReplace=True):
""" Replaces values where the mask is True with the replacement value.
:copyOnReplace makeCopy: If True (the default) it makes a copy if data is replaced.
"""
if mask is False:
result = data
elif mask is True:
... | [
"def",
"replaceMaskedValue",
"(",
"data",
",",
"mask",
",",
"replacementValue",
",",
"copyOnReplace",
"=",
"True",
")",
":",
"if",
"mask",
"is",
"False",
":",
"result",
"=",
"data",
"elif",
"mask",
"is",
"True",
":",
"result",
"=",
"np",
".",
"copy",
"... | Replaces values where the mask is True with the replacement value.
:copyOnReplace makeCopy: If True (the default) it makes a copy if data is replaced. | [
"Replaces",
"values",
"where",
"the",
"mask",
"is",
"True",
"with",
"the",
"replacement",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L231-L251 |
titusjan/argos | argos/utils/masks.py | replaceMaskedValueWithFloat | def replaceMaskedValueWithFloat(data, mask, replacementValue, copyOnReplace=True):
""" Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing. Otherwise it will ca... | python | def replaceMaskedValueWithFloat(data, mask, replacementValue, copyOnReplace=True):
""" Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing. Otherwise it will ca... | [
"def",
"replaceMaskedValueWithFloat",
"(",
"data",
",",
"mask",
",",
"replacementValue",
",",
"copyOnReplace",
"=",
"True",
")",
":",
"kind",
"=",
"data",
".",
"dtype",
".",
"kind",
"if",
"kind",
"==",
"'i'",
"or",
"kind",
"==",
"'u'",
":",
"# signed/unsig... | Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing. Otherwise it will call
replaceMaskedValue with the same parameters.
:copyOnReplace makeCopy: I... | [
"Replaces",
"values",
"where",
"the",
"mask",
"is",
"True",
"with",
"the",
"replacement",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L254-L270 |
titusjan/argos | argos/utils/masks.py | maskedNanPercentile | def maskedNanPercentile(maskedArray, percentiles, *args, **kwargs):
""" Calculates np.nanpercentile on the non-masked values
"""
#https://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html#accessing-the-data
awm = ArrayWithMask.createFromMaskedArray(maskedArray)
maskIdx = awm.maskIndex()
... | python | def maskedNanPercentile(maskedArray, percentiles, *args, **kwargs):
""" Calculates np.nanpercentile on the non-masked values
"""
#https://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html#accessing-the-data
awm = ArrayWithMask.createFromMaskedArray(maskedArray)
maskIdx = awm.maskIndex()
... | [
"def",
"maskedNanPercentile",
"(",
"maskedArray",
",",
"percentiles",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"#https://docs.scipy.org/doc/numpy/reference/maskedarray.generic.html#accessing-the-data",
"awm",
"=",
"ArrayWithMask",
".",
"createFromMaskedArray",
"... | Calculates np.nanpercentile on the non-masked values | [
"Calculates",
"np",
".",
"nanpercentile",
"on",
"the",
"non",
"-",
"masked",
"values"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L274-L293 |
titusjan/argos | argos/utils/masks.py | maskedEqual | def maskedEqual(array, missingValue):
""" Mask an array where equal to a given (missing)value.
Unfortunately ma.masked_equal does not work with structured arrays. See:
https://mail.scipy.org/pipermail/numpy-discussion/2011-July/057669.html
If the data is a structured array the mask is appl... | python | def maskedEqual(array, missingValue):
""" Mask an array where equal to a given (missing)value.
Unfortunately ma.masked_equal does not work with structured arrays. See:
https://mail.scipy.org/pipermail/numpy-discussion/2011-July/057669.html
If the data is a structured array the mask is appl... | [
"def",
"maskedEqual",
"(",
"array",
",",
"missingValue",
")",
":",
"if",
"array_is_structured",
"(",
"array",
")",
":",
"# Enforce the array to be masked",
"if",
"not",
"isinstance",
"(",
"array",
",",
"ma",
".",
"MaskedArray",
")",
":",
"array",
"=",
"ma",
... | Mask an array where equal to a given (missing)value.
Unfortunately ma.masked_equal does not work with structured arrays. See:
https://mail.scipy.org/pipermail/numpy-discussion/2011-July/057669.html
If the data is a structured array the mask is applied for every field (i.e. forming a
lo... | [
"Mask",
"an",
"array",
"where",
"equal",
"to",
"a",
"given",
"(",
"missing",
")",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L338-L367 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.mask | def mask(self, mask):
""" The mask values. Must be an array or a boolean scalar."""
check_class(mask, (np.ndarray, bool, np.bool_))
if isinstance(mask, (bool, np.bool_)):
self._mask = bool(mask)
else:
self._mask = mask | python | def mask(self, mask):
""" The mask values. Must be an array or a boolean scalar."""
check_class(mask, (np.ndarray, bool, np.bool_))
if isinstance(mask, (bool, np.bool_)):
self._mask = bool(mask)
else:
self._mask = mask | [
"def",
"mask",
"(",
"self",
",",
"mask",
")",
":",
"check_class",
"(",
"mask",
",",
"(",
"np",
".",
"ndarray",
",",
"bool",
",",
"np",
".",
"bool_",
")",
")",
"if",
"isinstance",
"(",
"mask",
",",
"(",
"bool",
",",
"np",
".",
"bool_",
")",
")",... | The mask values. Must be an array or a boolean scalar. | [
"The",
"mask",
"values",
".",
"Must",
"be",
"an",
"array",
"or",
"a",
"boolean",
"scalar",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L84-L90 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.checkIsConsistent | def checkIsConsistent(self):
""" Raises a ConsistencyError if the mask has an incorrect shape.
"""
if is_an_array(self.mask) and self.mask.shape != self.data.shape:
raise ConsistencyError("Shape mismatch mask={}, data={}"
.format(self.mask.shape != ... | python | def checkIsConsistent(self):
""" Raises a ConsistencyError if the mask has an incorrect shape.
"""
if is_an_array(self.mask) and self.mask.shape != self.data.shape:
raise ConsistencyError("Shape mismatch mask={}, data={}"
.format(self.mask.shape != ... | [
"def",
"checkIsConsistent",
"(",
"self",
")",
":",
"if",
"is_an_array",
"(",
"self",
".",
"mask",
")",
"and",
"self",
".",
"mask",
".",
"shape",
"!=",
"self",
".",
"data",
".",
"shape",
":",
"raise",
"ConsistencyError",
"(",
"\"Shape mismatch mask={}, data={... | Raises a ConsistencyError if the mask has an incorrect shape. | [
"Raises",
"a",
"ConsistencyError",
"if",
"the",
"mask",
"has",
"an",
"incorrect",
"shape",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L105-L110 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.createFromMaskedArray | def createFromMaskedArray(cls, masked_arr):
""" Creates an ArrayWithMak
:param masked_arr: a numpy MaskedArray or numpy array
:return: ArrayWithMask
"""
if isinstance(masked_arr, ArrayWithMask):
return masked_arr
check_class(masked_arr, (np.ndarray, ... | python | def createFromMaskedArray(cls, masked_arr):
""" Creates an ArrayWithMak
:param masked_arr: a numpy MaskedArray or numpy array
:return: ArrayWithMask
"""
if isinstance(masked_arr, ArrayWithMask):
return masked_arr
check_class(masked_arr, (np.ndarray, ... | [
"def",
"createFromMaskedArray",
"(",
"cls",
",",
"masked_arr",
")",
":",
"if",
"isinstance",
"(",
"masked_arr",
",",
"ArrayWithMask",
")",
":",
"return",
"masked_arr",
"check_class",
"(",
"masked_arr",
",",
"(",
"np",
".",
"ndarray",
",",
"ma",
".",
"MaskedA... | Creates an ArrayWithMak
:param masked_arr: a numpy MaskedArray or numpy array
:return: ArrayWithMask | [
"Creates",
"an",
"ArrayWithMak"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L114-L130 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.asMaskedArray | def asMaskedArray(self):
""" Creates converts to a masked array
"""
return ma.masked_array(data=self.data, mask=self.mask, fill_value=self.fill_value) | python | def asMaskedArray(self):
""" Creates converts to a masked array
"""
return ma.masked_array(data=self.data, mask=self.mask, fill_value=self.fill_value) | [
"def",
"asMaskedArray",
"(",
"self",
")",
":",
"return",
"ma",
".",
"masked_array",
"(",
"data",
"=",
"self",
".",
"data",
",",
"mask",
"=",
"self",
".",
"mask",
",",
"fill_value",
"=",
"self",
".",
"fill_value",
")"
] | Creates converts to a masked array | [
"Creates",
"converts",
"to",
"a",
"masked",
"array"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L133-L136 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.maskAt | def maskAt(self, index):
""" Returns the mask at the index.
It the mask is a boolean it is returned since this boolean representes the mask for
all array elements.
"""
if isinstance(self.mask, bool):
return self.mask
else:
return self.mask... | python | def maskAt(self, index):
""" Returns the mask at the index.
It the mask is a boolean it is returned since this boolean representes the mask for
all array elements.
"""
if isinstance(self.mask, bool):
return self.mask
else:
return self.mask... | [
"def",
"maskAt",
"(",
"self",
",",
"index",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"mask",
",",
"bool",
")",
":",
"return",
"self",
".",
"mask",
"else",
":",
"return",
"self",
".",
"mask",
"[",
"index",
"]"
] | Returns the mask at the index.
It the mask is a boolean it is returned since this boolean representes the mask for
all array elements. | [
"Returns",
"the",
"mask",
"at",
"the",
"index",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L139-L148 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.maskIndex | def maskIndex(self):
""" Returns a boolean index with True if the value is masked.
Always has the same shape as the maksedArray.data, event if the mask is a single boolan.
"""
if isinstance(self.mask, bool):
return np.full(self.data.shape, self.mask, dtype=np.bool)
... | python | def maskIndex(self):
""" Returns a boolean index with True if the value is masked.
Always has the same shape as the maksedArray.data, event if the mask is a single boolan.
"""
if isinstance(self.mask, bool):
return np.full(self.data.shape, self.mask, dtype=np.bool)
... | [
"def",
"maskIndex",
"(",
"self",
")",
":",
"if",
"isinstance",
"(",
"self",
".",
"mask",
",",
"bool",
")",
":",
"return",
"np",
".",
"full",
"(",
"self",
".",
"data",
".",
"shape",
",",
"self",
".",
"mask",
",",
"dtype",
"=",
"np",
".",
"bool",
... | Returns a boolean index with True if the value is masked.
Always has the same shape as the maksedArray.data, event if the mask is a single boolan. | [
"Returns",
"a",
"boolean",
"index",
"with",
"True",
"if",
"the",
"value",
"is",
"masked",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L151-L159 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.transpose | def transpose(self, *args, **kwargs):
""" Transposes the array and mask separately
:param awm: ArrayWithMask
:return: copy/view with transposed
"""
tdata = np.transpose(self.data, *args, **kwargs)
tmask = np.transpose(self.mask, *args, **kwargs) if is_an_array(se... | python | def transpose(self, *args, **kwargs):
""" Transposes the array and mask separately
:param awm: ArrayWithMask
:return: copy/view with transposed
"""
tdata = np.transpose(self.data, *args, **kwargs)
tmask = np.transpose(self.mask, *args, **kwargs) if is_an_array(se... | [
"def",
"transpose",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"tdata",
"=",
"np",
".",
"transpose",
"(",
"self",
".",
"data",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"tmask",
"=",
"np",
".",
"transpose",
"(",
"se... | Transposes the array and mask separately
:param awm: ArrayWithMask
:return: copy/view with transposed | [
"Transposes",
"the",
"array",
"and",
"mask",
"separately"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L184-L192 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.replaceMaskedValue | def replaceMaskedValue(self, replacementValue):
""" Replaces values where the mask is True with the replacement value.
"""
if self.mask is False:
pass
elif self.mask is True:
self.data[:] = replacementValue
else:
self.data[self.mask] = replacem... | python | def replaceMaskedValue(self, replacementValue):
""" Replaces values where the mask is True with the replacement value.
"""
if self.mask is False:
pass
elif self.mask is True:
self.data[:] = replacementValue
else:
self.data[self.mask] = replacem... | [
"def",
"replaceMaskedValue",
"(",
"self",
",",
"replacementValue",
")",
":",
"if",
"self",
".",
"mask",
"is",
"False",
":",
"pass",
"elif",
"self",
".",
"mask",
"is",
"True",
":",
"self",
".",
"data",
"[",
":",
"]",
"=",
"replacementValue",
"else",
":"... | Replaces values where the mask is True with the replacement value. | [
"Replaces",
"values",
"where",
"the",
"mask",
"is",
"True",
"with",
"the",
"replacement",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L195-L203 |
titusjan/argos | argos/utils/masks.py | ArrayWithMask.replaceMaskedValueWithNan | def replaceMaskedValueWithNan(self):
""" Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing.
"""
kind = self.data.dtype.kind
... | python | def replaceMaskedValueWithNan(self):
""" Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing.
"""
kind = self.data.dtype.kind
... | [
"def",
"replaceMaskedValueWithNan",
"(",
"self",
")",
":",
"kind",
"=",
"self",
".",
"data",
".",
"dtype",
".",
"kind",
"if",
"kind",
"==",
"'i'",
"or",
"kind",
"==",
"'u'",
":",
"# signed/unsigned int",
"self",
".",
"data",
"=",
"self",
".",
"data",
"... | Replaces values where the mask is True with the replacement value.
Will change the data type to float if the data is an integer.
If the data is not a float (or int) the function does nothing. | [
"Replaces",
"values",
"where",
"the",
"mask",
"is",
"True",
"with",
"the",
"replacement",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/utils/masks.py#L206-L224 |
titusjan/argos | argos/widgets/pluginsdialog.py | RegistryTab.importRegItem | def importRegItem(self, regItem):
""" Imports the regItem
Writes this in the statusLabel while the import is in progress.
"""
self.statusLabel.setText("Importing {}...".format(regItem.fullName))
QtWidgets.qApp.processEvents()
regItem.tryImportClass()
self.tabl... | python | def importRegItem(self, regItem):
""" Imports the regItem
Writes this in the statusLabel while the import is in progress.
"""
self.statusLabel.setText("Importing {}...".format(regItem.fullName))
QtWidgets.qApp.processEvents()
regItem.tryImportClass()
self.tabl... | [
"def",
"importRegItem",
"(",
"self",
",",
"regItem",
")",
":",
"self",
".",
"statusLabel",
".",
"setText",
"(",
"\"Importing {}...\"",
".",
"format",
"(",
"regItem",
".",
"fullName",
")",
")",
"QtWidgets",
".",
"qApp",
".",
"processEvents",
"(",
")",
"regI... | Imports the regItem
Writes this in the statusLabel while the import is in progress. | [
"Imports",
"the",
"regItem",
"Writes",
"this",
"in",
"the",
"statusLabel",
"while",
"the",
"import",
"is",
"in",
"progress",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/pluginsdialog.py#L133-L142 |
titusjan/argos | argos/widgets/pluginsdialog.py | RegistryTab.tryImportAllPlugins | def tryImportAllPlugins(self):
""" Tries to import all underlying plugin classes
"""
for regItem in self.registeredItems:
if not regItem.triedImport:
self.importRegItem(regItem)
logger.debug("Importing finished.") | python | def tryImportAllPlugins(self):
""" Tries to import all underlying plugin classes
"""
for regItem in self.registeredItems:
if not regItem.triedImport:
self.importRegItem(regItem)
logger.debug("Importing finished.") | [
"def",
"tryImportAllPlugins",
"(",
"self",
")",
":",
"for",
"regItem",
"in",
"self",
".",
"registeredItems",
":",
"if",
"not",
"regItem",
".",
"triedImport",
":",
"self",
".",
"importRegItem",
"(",
"regItem",
")",
"logger",
".",
"debug",
"(",
"\"Importing fi... | Tries to import all underlying plugin classes | [
"Tries",
"to",
"import",
"all",
"underlying",
"plugin",
"classes"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/pluginsdialog.py#L145-L152 |
titusjan/argos | argos/widgets/pluginsdialog.py | RegistryTab.setCurrentRegItem | def setCurrentRegItem(self, regItem):
""" Sets the current item to the regItem
"""
check_class(regItem, ClassRegItem, allow_none=True)
self.tableView.setCurrentRegItem(regItem) | python | def setCurrentRegItem(self, regItem):
""" Sets the current item to the regItem
"""
check_class(regItem, ClassRegItem, allow_none=True)
self.tableView.setCurrentRegItem(regItem) | [
"def",
"setCurrentRegItem",
"(",
"self",
",",
"regItem",
")",
":",
"check_class",
"(",
"regItem",
",",
"ClassRegItem",
",",
"allow_none",
"=",
"True",
")",
"self",
".",
"tableView",
".",
"setCurrentRegItem",
"(",
"regItem",
")"
] | Sets the current item to the regItem | [
"Sets",
"the",
"current",
"item",
"to",
"the",
"regItem"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/pluginsdialog.py#L162-L166 |
titusjan/argos | argos/widgets/pluginsdialog.py | RegistryTab.currentItemChanged | def currentItemChanged(self, _currentIndex=None, _previousIndex=None):
""" Updates the description text widget when the user clicks on a selector in the table.
The _currentIndex and _previousIndex parameters are ignored.
"""
self.editor.clear()
self.editor.setTextColor(QCOLOR... | python | def currentItemChanged(self, _currentIndex=None, _previousIndex=None):
""" Updates the description text widget when the user clicks on a selector in the table.
The _currentIndex and _previousIndex parameters are ignored.
"""
self.editor.clear()
self.editor.setTextColor(QCOLOR... | [
"def",
"currentItemChanged",
"(",
"self",
",",
"_currentIndex",
"=",
"None",
",",
"_previousIndex",
"=",
"None",
")",
":",
"self",
".",
"editor",
".",
"clear",
"(",
")",
"self",
".",
"editor",
".",
"setTextColor",
"(",
"QCOLOR_REGULAR",
")",
"regItem",
"="... | Updates the description text widget when the user clicks on a selector in the table.
The _currentIndex and _previousIndex parameters are ignored. | [
"Updates",
"the",
"description",
"text",
"widget",
"when",
"the",
"user",
"clicks",
"on",
"a",
"selector",
"in",
"the",
"table",
".",
"The",
"_currentIndex",
"and",
"_previousIndex",
"parameters",
"are",
"ignored",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/pluginsdialog.py#L170-L194 |
titusjan/argos | argos/widgets/pluginsdialog.py | PluginsDialog.tryImportAllPlugins | def tryImportAllPlugins(self):
""" Refreshes the tables of all tables by importing the underlying classes
"""
logger.debug("Importing plugins: {}".format(self))
for tabNr in range(self.tabWidget.count()):
tab = self.tabWidget.widget(tabNr)
tab.tryImportAllPlugins(... | python | def tryImportAllPlugins(self):
""" Refreshes the tables of all tables by importing the underlying classes
"""
logger.debug("Importing plugins: {}".format(self))
for tabNr in range(self.tabWidget.count()):
tab = self.tabWidget.widget(tabNr)
tab.tryImportAllPlugins(... | [
"def",
"tryImportAllPlugins",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Importing plugins: {}\"",
".",
"format",
"(",
"self",
")",
")",
"for",
"tabNr",
"in",
"range",
"(",
"self",
".",
"tabWidget",
".",
"count",
"(",
")",
")",
":",
"tab",
... | Refreshes the tables of all tables by importing the underlying classes | [
"Refreshes",
"the",
"tables",
"of",
"all",
"tables",
"by",
"importing",
"the",
"underlying",
"classes"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/pluginsdialog.py#L243-L249 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | dimNamesFromDataset | def dimNamesFromDataset(h5Dataset):
""" Constructs the dimension names given a h5py dataset.
First looks in the dataset's dimension scales to see if it refers to another
dataset. In that case the referred dataset's name is used. If not, the label of the
dimension scale is used. Finally, if ... | python | def dimNamesFromDataset(h5Dataset):
""" Constructs the dimension names given a h5py dataset.
First looks in the dataset's dimension scales to see if it refers to another
dataset. In that case the referred dataset's name is used. If not, the label of the
dimension scale is used. Finally, if ... | [
"def",
"dimNamesFromDataset",
"(",
"h5Dataset",
")",
":",
"dimNames",
"=",
"[",
"]",
"# TODO: cache?",
"for",
"dimNr",
",",
"dimScales",
"in",
"enumerate",
"(",
"h5Dataset",
".",
"dims",
")",
":",
"if",
"len",
"(",
"dimScales",
")",
"==",
"0",
":",
"dimN... | Constructs the dimension names given a h5py dataset.
First looks in the dataset's dimension scales to see if it refers to another
dataset. In that case the referred dataset's name is used. If not, the label of the
dimension scale is used. Finally, if this is empty, the dimension is numbered. | [
"Constructs",
"the",
"dimension",
"names",
"given",
"a",
"h5py",
"dataset",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L39-L64 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | dataSetElementType | def dataSetElementType(h5Dataset):
""" Returns a string describing the element type of the dataset
"""
dtype = h5Dataset.dtype
if dtype.names:
return '<structured>'
else:
if dtype.metadata and 'vlen' in dtype.metadata:
vlen_type = dtype.metadata['vlen']
try:... | python | def dataSetElementType(h5Dataset):
""" Returns a string describing the element type of the dataset
"""
dtype = h5Dataset.dtype
if dtype.names:
return '<structured>'
else:
if dtype.metadata and 'vlen' in dtype.metadata:
vlen_type = dtype.metadata['vlen']
try:... | [
"def",
"dataSetElementType",
"(",
"h5Dataset",
")",
":",
"dtype",
"=",
"h5Dataset",
".",
"dtype",
"if",
"dtype",
".",
"names",
":",
"return",
"'<structured>'",
"else",
":",
"if",
"dtype",
".",
"metadata",
"and",
"'vlen'",
"in",
"dtype",
".",
"metadata",
":... | Returns a string describing the element type of the dataset | [
"Returns",
"a",
"string",
"describing",
"the",
"element",
"type",
"of",
"the",
"dataset"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L67-L82 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | dataSetUnit | def dataSetUnit(h5Dataset):
""" Returns the unit of the h5Dataset by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned.
Always returns a str... | python | def dataSetUnit(h5Dataset):
""" Returns the unit of the h5Dataset by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned.
Always returns a str... | [
"def",
"dataSetUnit",
"(",
"h5Dataset",
")",
":",
"attributes",
"=",
"h5Dataset",
".",
"attrs",
"if",
"not",
"attributes",
":",
"return",
"''",
"# a premature optimization :-)",
"for",
"key",
"in",
"(",
"'unit'",
",",
"'units'",
",",
"'Unit'",
",",
"'Units'",
... | Returns the unit of the h5Dataset by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned.
Always returns a string | [
"Returns",
"the",
"unit",
"of",
"the",
"h5Dataset",
"by",
"looking",
"in",
"the",
"attributes",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L85-L104 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | dataSetMissingValue | def dataSetMissingValue(h5Dataset):
""" Returns the missingData given a HDF-5 dataset
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found.
HDF-EOS and NetCDF files seem to put the attributes in 1-e... | python | def dataSetMissingValue(h5Dataset):
""" Returns the missingData given a HDF-5 dataset
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found.
HDF-EOS and NetCDF files seem to put the attributes in 1-e... | [
"def",
"dataSetMissingValue",
"(",
"h5Dataset",
")",
":",
"attributes",
"=",
"h5Dataset",
".",
"attrs",
"if",
"not",
"attributes",
":",
"return",
"None",
"# a premature optimization :-)",
"for",
"key",
"in",
"(",
"'missing_value'",
",",
"'MissingValue'",
",",
"'mi... | Returns the missingData given a HDF-5 dataset
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found.
HDF-EOS and NetCDF files seem to put the attributes in 1-element arrays. So if the
attribute c... | [
"Returns",
"the",
"missingData",
"given",
"a",
"HDF",
"-",
"5",
"dataset"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L107-L127 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFieldRti._subArrayShape | def _subArrayShape(self):
""" Returns the shape of the sub-array
An empty tuple is returned for regular fields, which have no sub array.
"""
if self._h5Dataset.dtype.fields is None:
return tuple() # regular field
else:
fieldName = self.nodeName
... | python | def _subArrayShape(self):
""" Returns the shape of the sub-array
An empty tuple is returned for regular fields, which have no sub array.
"""
if self._h5Dataset.dtype.fields is None:
return tuple() # regular field
else:
fieldName = self.nodeName
... | [
"def",
"_subArrayShape",
"(",
"self",
")",
":",
"if",
"self",
".",
"_h5Dataset",
".",
"dtype",
".",
"fields",
"is",
"None",
":",
"return",
"tuple",
"(",
")",
"# regular field",
"else",
":",
"fieldName",
"=",
"self",
".",
"nodeName",
"fieldDtype",
"=",
"s... | Returns the shape of the sub-array
An empty tuple is returned for regular fields, which have no sub array. | [
"Returns",
"the",
"shape",
"of",
"the",
"sub",
"-",
"array",
"An",
"empty",
"tuple",
"is",
"returned",
"for",
"regular",
"fields",
"which",
"have",
"no",
"sub",
"array",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L268-L277 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFieldRti.elementTypeName | def elementTypeName(self):
""" String representation of the element type.
"""
fieldName = self.nodeName
return str(self._h5Dataset.dtype.fields[fieldName][0]) | python | def elementTypeName(self):
""" String representation of the element type.
"""
fieldName = self.nodeName
return str(self._h5Dataset.dtype.fields[fieldName][0]) | [
"def",
"elementTypeName",
"(",
"self",
")",
":",
"fieldName",
"=",
"self",
".",
"nodeName",
"return",
"str",
"(",
"self",
".",
"_h5Dataset",
".",
"dtype",
".",
"fields",
"[",
"fieldName",
"]",
"[",
"0",
"]",
")"
] | String representation of the element type. | [
"String",
"representation",
"of",
"the",
"element",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L289-L293 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFieldRti.dimensionNames | def dimensionNames(self):
""" Returns a list with the dimension names of the underlying NCDF variable
"""
nSubDims = len(self._subArrayShape)
subArrayDims = ['SubDim{}'.format(dimNr) for dimNr in range(nSubDims)]
return dimNamesFromDataset(self._h5Dataset) + subArrayDims | python | def dimensionNames(self):
""" Returns a list with the dimension names of the underlying NCDF variable
"""
nSubDims = len(self._subArrayShape)
subArrayDims = ['SubDim{}'.format(dimNr) for dimNr in range(nSubDims)]
return dimNamesFromDataset(self._h5Dataset) + subArrayDims | [
"def",
"dimensionNames",
"(",
"self",
")",
":",
"nSubDims",
"=",
"len",
"(",
"self",
".",
"_subArrayShape",
")",
"subArrayDims",
"=",
"[",
"'SubDim{}'",
".",
"format",
"(",
"dimNr",
")",
"for",
"dimNr",
"in",
"range",
"(",
"nSubDims",
")",
"]",
"return",... | Returns a list with the dimension names of the underlying NCDF variable | [
"Returns",
"a",
"list",
"with",
"the",
"dimension",
"names",
"of",
"the",
"underlying",
"NCDF",
"variable"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L297-L302 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFieldRti.unit | def unit(self):
""" Returns the unit of the RTI by calling dataSetUnit on the underlying dataset
"""
unit = dataSetUnit(self._h5Dataset)
fieldNames = self._h5Dataset.dtype.names
# If the missing value attribute is a list with the same length as the number of fields,
# re... | python | def unit(self):
""" Returns the unit of the RTI by calling dataSetUnit on the underlying dataset
"""
unit = dataSetUnit(self._h5Dataset)
fieldNames = self._h5Dataset.dtype.names
# If the missing value attribute is a list with the same length as the number of fields,
# re... | [
"def",
"unit",
"(",
"self",
")",
":",
"unit",
"=",
"dataSetUnit",
"(",
"self",
".",
"_h5Dataset",
")",
"fieldNames",
"=",
"self",
".",
"_h5Dataset",
".",
"dtype",
".",
"names",
"# If the missing value attribute is a list with the same length as the number of fields,",
... | Returns the unit of the RTI by calling dataSetUnit on the underlying dataset | [
"Returns",
"the",
"unit",
"of",
"the",
"RTI",
"by",
"calling",
"dataSetUnit",
"on",
"the",
"underlying",
"dataset"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L306-L318 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFieldRti.missingDataValue | def missingDataValue(self):
""" Returns the value to indicate missing data. None if no missing-data value is specified.
"""
value = dataSetMissingValue(self._h5Dataset)
fieldNames = self._h5Dataset.dtype.names
# If the missing value attribute is a list with the same length as th... | python | def missingDataValue(self):
""" Returns the value to indicate missing data. None if no missing-data value is specified.
"""
value = dataSetMissingValue(self._h5Dataset)
fieldNames = self._h5Dataset.dtype.names
# If the missing value attribute is a list with the same length as th... | [
"def",
"missingDataValue",
"(",
"self",
")",
":",
"value",
"=",
"dataSetMissingValue",
"(",
"self",
".",
"_h5Dataset",
")",
"fieldNames",
"=",
"self",
".",
"_h5Dataset",
".",
"dtype",
".",
"names",
"# If the missing value attribute is a list with the same length as the ... | Returns the value to indicate missing data. None if no missing-data value is specified. | [
"Returns",
"the",
"value",
"to",
"indicate",
"missing",
"data",
".",
"None",
"if",
"no",
"missing",
"-",
"data",
"value",
"is",
"specified",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L322-L334 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyDatasetRti.iconGlyph | def iconGlyph(self):
""" Shows an Array icon for regular datasets but a dimension icon for dimension scales
"""
if self._h5Dataset.attrs.get('CLASS', None) == b'DIMENSION_SCALE':
return RtiIconFactory.DIMENSION
else:
return RtiIconFactory.ARRAY | python | def iconGlyph(self):
""" Shows an Array icon for regular datasets but a dimension icon for dimension scales
"""
if self._h5Dataset.attrs.get('CLASS', None) == b'DIMENSION_SCALE':
return RtiIconFactory.DIMENSION
else:
return RtiIconFactory.ARRAY | [
"def",
"iconGlyph",
"(",
"self",
")",
":",
"if",
"self",
".",
"_h5Dataset",
".",
"attrs",
".",
"get",
"(",
"'CLASS'",
",",
"None",
")",
"==",
"b'DIMENSION_SCALE'",
":",
"return",
"RtiIconFactory",
".",
"DIMENSION",
"else",
":",
"return",
"RtiIconFactory",
... | Shows an Array icon for regular datasets but a dimension icon for dimension scales | [
"Shows",
"an",
"Array",
"icon",
"for",
"regular",
"datasets",
"but",
"a",
"dimension",
"icon",
"for",
"dimension",
"scales"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L356-L362 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyDatasetRti._fetchAllChildren | def _fetchAllChildren(self):
""" Fetches all fields that this variable contains.
Only variables with a structured data type can have fields.
"""
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
# Add fields
if self._isStructure... | python | def _fetchAllChildren(self):
""" Fetches all fields that this variable contains.
Only variables with a structured data type can have fields.
"""
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
# Add fields
if self._isStructure... | [
"def",
"_fetchAllChildren",
"(",
"self",
")",
":",
"assert",
"self",
".",
"canFetchChildren",
"(",
")",
",",
"\"canFetchChildren must be True\"",
"childItems",
"=",
"[",
"]",
"# Add fields",
"if",
"self",
".",
"_isStructured",
":",
"for",
"fieldName",
"in",
"sel... | Fetches all fields that this variable contains.
Only variables with a structured data type can have fields. | [
"Fetches",
"all",
"fields",
"that",
"this",
"variable",
"contains",
".",
"Only",
"variables",
"with",
"a",
"structured",
"data",
"type",
"can",
"have",
"fields",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L428-L442 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyGroupRti._fetchAllChildren | def _fetchAllChildren(self):
""" Fetches all sub groups and variables that this group contains.
"""
assert self._h5Group is not None, "dataset undefined (file not opened?)"
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
for childName, h5... | python | def _fetchAllChildren(self):
""" Fetches all sub groups and variables that this group contains.
"""
assert self._h5Group is not None, "dataset undefined (file not opened?)"
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
for childName, h5... | [
"def",
"_fetchAllChildren",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_h5Group",
"is",
"not",
"None",
",",
"\"dataset undefined (file not opened?)\"",
"assert",
"self",
".",
"canFetchChildren",
"(",
")",
",",
"\"canFetchChildren must be True\"",
"childItems",
"="... | Fetches all sub groups and variables that this group contains. | [
"Fetches",
"all",
"sub",
"groups",
"and",
"variables",
"that",
"this",
"group",
"contains",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L467-L494 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFileRti._openResources | def _openResources(self):
""" Opens the root Dataset.
"""
logger.info("Opening: {}".format(self._fileName))
self._h5Group = h5py.File(self._fileName, 'r') | python | def _openResources(self):
""" Opens the root Dataset.
"""
logger.info("Opening: {}".format(self._fileName))
self._h5Group = h5py.File(self._fileName, 'r') | [
"def",
"_openResources",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"\"Opening: {}\"",
".",
"format",
"(",
"self",
".",
"_fileName",
")",
")",
"self",
".",
"_h5Group",
"=",
"h5py",
".",
"File",
"(",
"self",
".",
"_fileName",
",",
"'r'",
")"
] | Opens the root Dataset. | [
"Opens",
"the",
"root",
"Dataset",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L512-L516 |
titusjan/argos | argos/repo/rtiplugins/hdf5.py | H5pyFileRti._closeResources | def _closeResources(self):
""" Closes the root Dataset.
"""
logger.info("Closing: {}".format(self._fileName))
self._h5Group.close()
self._h5Group = None | python | def _closeResources(self):
""" Closes the root Dataset.
"""
logger.info("Closing: {}".format(self._fileName))
self._h5Group.close()
self._h5Group = None | [
"def",
"_closeResources",
"(",
"self",
")",
":",
"logger",
".",
"info",
"(",
"\"Closing: {}\"",
".",
"format",
"(",
"self",
".",
"_fileName",
")",
")",
"self",
".",
"_h5Group",
".",
"close",
"(",
")",
"self",
".",
"_h5Group",
"=",
"None"
] | Closes the root Dataset. | [
"Closes",
"the",
"root",
"Dataset",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/hdf5.py#L519-L524 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | calcPgImagePlot2dDataRange | def calcPgImagePlot2dDataRange(pgImagePlot2d, percentage, crossPlot):
""" Calculates the range from the inspectors' sliced array. Discards percentage of the minimum
and percentage of the maximum values of the inspector.slicedArray
:param pgImagePlot2d: the range methods will work on (the sliced arr... | python | def calcPgImagePlot2dDataRange(pgImagePlot2d, percentage, crossPlot):
""" Calculates the range from the inspectors' sliced array. Discards percentage of the minimum
and percentage of the maximum values of the inspector.slicedArray
:param pgImagePlot2d: the range methods will work on (the sliced arr... | [
"def",
"calcPgImagePlot2dDataRange",
"(",
"pgImagePlot2d",
",",
"percentage",
",",
"crossPlot",
")",
":",
"check_class",
"(",
"pgImagePlot2d",
".",
"slicedArray",
",",
"ArrayWithMask",
")",
"# sanity check",
"if",
"crossPlot",
"is",
"None",
":",
"array",
"=",
"pgI... | Calculates the range from the inspectors' sliced array. Discards percentage of the minimum
and percentage of the maximum values of the inspector.slicedArray
:param pgImagePlot2d: the range methods will work on (the sliced array) of this inspector.
:param percentage: percentage that will be disc... | [
"Calculates",
"the",
"range",
"from",
"the",
"inspectors",
"sliced",
"array",
".",
"Discards",
"percentage",
"of",
"the",
"minimum",
"and",
"percentage",
"of",
"the",
"maximum",
"values",
"of",
"the",
"inspector",
".",
"slicedArray"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L56-L88 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | crossPlotAutoRangeMethods | def crossPlotAutoRangeMethods(pgImagePlot2d, crossPlot, intialItems=None):
""" Creates an ordered dict with autorange methods for an PgImagePlot2d inspector.
:param pgImagePlot2d: the range methods will work on (the sliced array) of this inspector.
:param crossPlot: if None, the range will be calcu... | python | def crossPlotAutoRangeMethods(pgImagePlot2d, crossPlot, intialItems=None):
""" Creates an ordered dict with autorange methods for an PgImagePlot2d inspector.
:param pgImagePlot2d: the range methods will work on (the sliced array) of this inspector.
:param crossPlot: if None, the range will be calcu... | [
"def",
"crossPlotAutoRangeMethods",
"(",
"pgImagePlot2d",
",",
"crossPlot",
",",
"intialItems",
"=",
"None",
")",
":",
"rangeFunctions",
"=",
"OrderedDict",
"(",
"{",
"}",
"if",
"intialItems",
"is",
"None",
"else",
"intialItems",
")",
"# If crossPlot is \"horizontal... | Creates an ordered dict with autorange methods for an PgImagePlot2d inspector.
:param pgImagePlot2d: the range methods will work on (the sliced array) of this inspector.
:param crossPlot: if None, the range will be calculated from the entire sliced array,
if "horizontal" or "vertical" the r... | [
"Creates",
"an",
"ordered",
"dict",
"with",
"autorange",
"methods",
"for",
"an",
"PgImagePlot2d",
"inspector",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L91-L120 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2dCti._closeResources | def _closeResources(self):
""" Disconnects signals.
Is called by self.finalize when the cti is deleted.
"""
verCrossViewBox = self.pgImagePlot2d.verCrossPlotItem.getViewBox()
verCrossViewBox.sigRangeChangedManually.disconnect(self.yAxisRangeCti.setAutoRangeOff)
horCro... | python | def _closeResources(self):
""" Disconnects signals.
Is called by self.finalize when the cti is deleted.
"""
verCrossViewBox = self.pgImagePlot2d.verCrossPlotItem.getViewBox()
verCrossViewBox.sigRangeChangedManually.disconnect(self.yAxisRangeCti.setAutoRangeOff)
horCro... | [
"def",
"_closeResources",
"(",
"self",
")",
":",
"verCrossViewBox",
"=",
"self",
".",
"pgImagePlot2d",
".",
"verCrossPlotItem",
".",
"getViewBox",
"(",
")",
"verCrossViewBox",
".",
"sigRangeChangedManually",
".",
"disconnect",
"(",
"self",
".",
"yAxisRangeCti",
".... | Disconnects signals.
Is called by self.finalize when the cti is deleted. | [
"Disconnects",
"signals",
".",
"Is",
"called",
"by",
"self",
".",
"finalize",
"when",
"the",
"cti",
"is",
"deleted",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L214-L225 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2dCti.setImagePlotAutoRangeOn | def setImagePlotAutoRangeOn(self, axisNumber):
""" Sets the image plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.xAxisRangeCti, self.yAxisRangeCti, axisNumber) | python | def setImagePlotAutoRangeOn(self, axisNumber):
""" Sets the image plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.xAxisRangeCti, self.yAxisRangeCti, axisNumber) | [
"def",
"setImagePlotAutoRangeOn",
"(",
"self",
",",
"axisNumber",
")",
":",
"setXYAxesAutoRangeOn",
"(",
"self",
",",
"self",
".",
"xAxisRangeCti",
",",
"self",
".",
"yAxisRangeCti",
",",
"axisNumber",
")"
] | Sets the image plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes). | [
"Sets",
"the",
"image",
"plot",
"s",
"auto",
"-",
"range",
"on",
"for",
"the",
"axis",
"with",
"number",
"axisNumber",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L228-L233 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2dCti.setHorCrossPlotAutoRangeOn | def setHorCrossPlotAutoRangeOn(self, axisNumber):
""" Sets the horizontal cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.xAxisRangeCti, self.horCrossPlotRange... | python | def setHorCrossPlotAutoRangeOn(self, axisNumber):
""" Sets the horizontal cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.xAxisRangeCti, self.horCrossPlotRange... | [
"def",
"setHorCrossPlotAutoRangeOn",
"(",
"self",
",",
"axisNumber",
")",
":",
"setXYAxesAutoRangeOn",
"(",
"self",
",",
"self",
".",
"xAxisRangeCti",
",",
"self",
".",
"horCrossPlotRangeCti",
",",
"axisNumber",
")"
] | Sets the horizontal cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes). | [
"Sets",
"the",
"horizontal",
"cross",
"-",
"hair",
"plot",
"s",
"auto",
"-",
"range",
"on",
"for",
"the",
"axis",
"with",
"number",
"axisNumber",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L236-L241 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2dCti.setVerCrossPlotAutoRangeOn | def setVerCrossPlotAutoRangeOn(self, axisNumber):
""" Sets the vertical cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.verCrossPlotRangeCti, self.yAxisRangeCt... | python | def setVerCrossPlotAutoRangeOn(self, axisNumber):
""" Sets the vertical cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes).
"""
setXYAxesAutoRangeOn(self, self.verCrossPlotRangeCti, self.yAxisRangeCt... | [
"def",
"setVerCrossPlotAutoRangeOn",
"(",
"self",
",",
"axisNumber",
")",
":",
"setXYAxesAutoRangeOn",
"(",
"self",
",",
"self",
".",
"verCrossPlotRangeCti",
",",
"self",
".",
"yAxisRangeCti",
",",
"axisNumber",
")"
] | Sets the vertical cross-hair plot's auto-range on for the axis with number axisNumber.
:param axisNumber: 0 (X-axis), 1 (Y-axis), 2, (Both X and Y axes). | [
"Sets",
"the",
"vertical",
"cross",
"-",
"hair",
"plot",
"s",
"auto",
"-",
"range",
"on",
"for",
"the",
"axis",
"with",
"number",
"axisNumber",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L244-L249 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2d._clearContents | def _clearContents(self):
""" Clears the contents when no valid data is available
"""
logger.debug("Clearing inspector contents")
self.titleLabel.setText('')
# Don't clear the imagePlotItem, the imageItem is only added in the constructor.
self.imageItem.clear()
s... | python | def _clearContents(self):
""" Clears the contents when no valid data is available
"""
logger.debug("Clearing inspector contents")
self.titleLabel.setText('')
# Don't clear the imagePlotItem, the imageItem is only added in the constructor.
self.imageItem.clear()
s... | [
"def",
"_clearContents",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Clearing inspector contents\"",
")",
"self",
".",
"titleLabel",
".",
"setText",
"(",
"''",
")",
"# Don't clear the imagePlotItem, the imageItem is only added in the constructor.",
"self",
".",... | Clears the contents when no valid data is available | [
"Clears",
"the",
"contents",
"when",
"no",
"valid",
"data",
"is",
"available"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L368-L393 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2d._drawContents | def _drawContents(self, reason=None, initiator=None):
""" Draws the plot contents from the sliced array of the collected repo tree item.
The reason parameter is used to determine if the axes will be reset (the initiator
parameter is ignored). See AbstractInspector.updateContents for the... | python | def _drawContents(self, reason=None, initiator=None):
""" Draws the plot contents from the sliced array of the collected repo tree item.
The reason parameter is used to determine if the axes will be reset (the initiator
parameter is ignored). See AbstractInspector.updateContents for the... | [
"def",
"_drawContents",
"(",
"self",
",",
"reason",
"=",
"None",
",",
"initiator",
"=",
"None",
")",
":",
"self",
".",
"crossPlotRow",
"=",
"None",
"# reset because the sliced array shape may change",
"self",
".",
"crossPlotCol",
"=",
"None",
"# idem dito",
"gridL... | Draws the plot contents from the sliced array of the collected repo tree item.
The reason parameter is used to determine if the axes will be reset (the initiator
parameter is ignored). See AbstractInspector.updateContents for their description. | [
"Draws",
"the",
"plot",
"contents",
"from",
"the",
"sliced",
"array",
"of",
"the",
"collected",
"repo",
"tree",
"item",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L396-L484 |
titusjan/argos | argos/inspector/pgplugins/imageplot2d.py | PgImagePlot2d.mouseMoved | def mouseMoved(self, viewPos):
""" Updates the probe text with the values under the cursor.
Draws a vertical line and a symbol at the position of the probe.
"""
try:
check_class(viewPos, QtCore.QPointF)
show_data_point = False # shows the data point as a circl... | python | def mouseMoved(self, viewPos):
""" Updates the probe text with the values under the cursor.
Draws a vertical line and a symbol at the position of the probe.
"""
try:
check_class(viewPos, QtCore.QPointF)
show_data_point = False # shows the data point as a circl... | [
"def",
"mouseMoved",
"(",
"self",
",",
"viewPos",
")",
":",
"try",
":",
"check_class",
"(",
"viewPos",
",",
"QtCore",
".",
"QPointF",
")",
"show_data_point",
"=",
"False",
"# shows the data point as a circle in the cross hair plots",
"self",
".",
"crossPlotRow",
","... | Updates the probe text with the values under the cursor.
Draws a vertical line and a symbol at the position of the probe. | [
"Updates",
"the",
"probe",
"text",
"with",
"the",
"values",
"under",
"the",
"cursor",
".",
"Draws",
"a",
"vertical",
"line",
"and",
"a",
"symbol",
"at",
"the",
"position",
"of",
"the",
"probe",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/inspector/pgplugins/imageplot2d.py#L488-L621 |
titusjan/argos | argos/repo/registry.py | RtiRegItem.getFileDialogFilter | def getFileDialogFilter(self):
""" Returns a filters that can be used to construct file dialogs filters,
for example: 'Text File (*.txt;*.text)'
"""
extStr = ';'.join(['*' + ext for ext in self.extensions])
return '{} ({})'.format(self.name, extStr) | python | def getFileDialogFilter(self):
""" Returns a filters that can be used to construct file dialogs filters,
for example: 'Text File (*.txt;*.text)'
"""
extStr = ';'.join(['*' + ext for ext in self.extensions])
return '{} ({})'.format(self.name, extStr) | [
"def",
"getFileDialogFilter",
"(",
"self",
")",
":",
"extStr",
"=",
"';'",
".",
"join",
"(",
"[",
"'*'",
"+",
"ext",
"for",
"ext",
"in",
"self",
".",
"extensions",
"]",
")",
"return",
"'{} ({})'",
".",
"format",
"(",
"self",
".",
"name",
",",
"extStr... | Returns a filters that can be used to construct file dialogs filters,
for example: 'Text File (*.txt;*.text)' | [
"Returns",
"a",
"filters",
"that",
"can",
"be",
"used",
"to",
"construct",
"file",
"dialogs",
"filters",
"for",
"example",
":",
"Text",
"File",
"(",
"*",
".",
"txt",
";",
"*",
".",
"text",
")"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L46-L51 |
titusjan/argos | argos/repo/registry.py | RtiRegItem.asDict | def asDict(self):
""" Returns a dictionary for serialization.
"""
dct = super(RtiRegItem, self).asDict()
dct['extensions'] = self.extensions
return dct | python | def asDict(self):
""" Returns a dictionary for serialization.
"""
dct = super(RtiRegItem, self).asDict()
dct['extensions'] = self.extensions
return dct | [
"def",
"asDict",
"(",
"self",
")",
":",
"dct",
"=",
"super",
"(",
"RtiRegItem",
",",
"self",
")",
".",
"asDict",
"(",
")",
"dct",
"[",
"'extensions'",
"]",
"=",
"self",
".",
"extensions",
"return",
"dct"
] | Returns a dictionary for serialization. | [
"Returns",
"a",
"dictionary",
"for",
"serialization",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L54-L59 |
titusjan/argos | argos/repo/registry.py | RtiRegistry._registerExtension | def _registerExtension(self, extension, rtiRegItem):
""" Links an file name extension to a repository tree item.
"""
check_is_a_string(extension)
check_class(rtiRegItem, RtiRegItem)
logger.debug(" Registering extension {!r} for {}".format(extension, rtiRegItem))
# TODO... | python | def _registerExtension(self, extension, rtiRegItem):
""" Links an file name extension to a repository tree item.
"""
check_is_a_string(extension)
check_class(rtiRegItem, RtiRegItem)
logger.debug(" Registering extension {!r} for {}".format(extension, rtiRegItem))
# TODO... | [
"def",
"_registerExtension",
"(",
"self",
",",
"extension",
",",
"rtiRegItem",
")",
":",
"check_is_a_string",
"(",
"extension",
")",
"check_class",
"(",
"rtiRegItem",
",",
"RtiRegItem",
")",
"logger",
".",
"debug",
"(",
"\" Registering extension {!r} for {}\"",
"."... | Links an file name extension to a repository tree item. | [
"Links",
"an",
"file",
"name",
"extension",
"to",
"a",
"repository",
"tree",
"item",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L85-L97 |
titusjan/argos | argos/repo/registry.py | RtiRegistry.registerItem | def registerItem(self, regItem):
""" Adds a ClassRegItem object to the registry.
"""
super(RtiRegistry, self).registerItem(regItem)
for ext in regItem.extensions:
self._registerExtension(ext, regItem) | python | def registerItem(self, regItem):
""" Adds a ClassRegItem object to the registry.
"""
super(RtiRegistry, self).registerItem(regItem)
for ext in regItem.extensions:
self._registerExtension(ext, regItem) | [
"def",
"registerItem",
"(",
"self",
",",
"regItem",
")",
":",
"super",
"(",
"RtiRegistry",
",",
"self",
")",
".",
"registerItem",
"(",
"regItem",
")",
"for",
"ext",
"in",
"regItem",
".",
"extensions",
":",
"self",
".",
"_registerExtension",
"(",
"ext",
"... | Adds a ClassRegItem object to the registry. | [
"Adds",
"a",
"ClassRegItem",
"object",
"to",
"the",
"registry",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L100-L106 |
titusjan/argos | argos/repo/registry.py | RtiRegistry.registerRti | def registerRti(self, fullName, fullClassName, extensions=None, pythonPath=''):
""" Class that maintains the collection of registered inspector classes.
Maintains a lit of file extensions that open the RTI by default.
"""
check_is_a_sequence(extensions)
extensions = extension... | python | def registerRti(self, fullName, fullClassName, extensions=None, pythonPath=''):
""" Class that maintains the collection of registered inspector classes.
Maintains a lit of file extensions that open the RTI by default.
"""
check_is_a_sequence(extensions)
extensions = extension... | [
"def",
"registerRti",
"(",
"self",
",",
"fullName",
",",
"fullClassName",
",",
"extensions",
"=",
"None",
",",
"pythonPath",
"=",
"''",
")",
":",
"check_is_a_sequence",
"(",
"extensions",
")",
"extensions",
"=",
"extensions",
"if",
"extensions",
"is",
"not",
... | Class that maintains the collection of registered inspector classes.
Maintains a lit of file extensions that open the RTI by default. | [
"Class",
"that",
"maintains",
"the",
"collection",
"of",
"registered",
"inspector",
"classes",
".",
"Maintains",
"a",
"lit",
"of",
"file",
"extensions",
"that",
"open",
"the",
"RTI",
"by",
"default",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L109-L118 |
titusjan/argos | argos/repo/registry.py | RtiRegistry.getFileDialogFilter | def getFileDialogFilter(self):
""" Returns a filter that can be used in open file dialogs,
for example: 'All files (*);;Txt (*.txt;*.text);;netCDF(*.nc;*.nc4)'
"""
filters = []
for regRti in self.items:
filters.append(regRti.getFileDialogFilter())
return '... | python | def getFileDialogFilter(self):
""" Returns a filter that can be used in open file dialogs,
for example: 'All files (*);;Txt (*.txt;*.text);;netCDF(*.nc;*.nc4)'
"""
filters = []
for regRti in self.items:
filters.append(regRti.getFileDialogFilter())
return '... | [
"def",
"getFileDialogFilter",
"(",
"self",
")",
":",
"filters",
"=",
"[",
"]",
"for",
"regRti",
"in",
"self",
".",
"items",
":",
"filters",
".",
"append",
"(",
"regRti",
".",
"getFileDialogFilter",
"(",
")",
")",
"return",
"';;'",
".",
"join",
"(",
"fi... | Returns a filter that can be used in open file dialogs,
for example: 'All files (*);;Txt (*.txt;*.text);;netCDF(*.nc;*.nc4)' | [
"Returns",
"a",
"filter",
"that",
"can",
"be",
"used",
"in",
"open",
"file",
"dialogs",
"for",
"example",
":",
"All",
"files",
"(",
"*",
")",
";;",
"Txt",
"(",
"*",
".",
"txt",
";",
"*",
".",
"text",
")",
";;",
"netCDF",
"(",
"*",
".",
"nc",
";... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L129-L136 |
titusjan/argos | argos/repo/registry.py | RtiRegistry.getDefaultItems | def getDefaultItems(self):
""" Returns a list with the default plugins in the repo tree item registry.
"""
return [
RtiRegItem('HDF-5 file',
'argos.repo.rtiplugins.hdf5.H5pyFileRti',
extensions=['hdf5', 'h5', 'h5e', 'he5', 'nc']), # hdf e... | python | def getDefaultItems(self):
""" Returns a list with the default plugins in the repo tree item registry.
"""
return [
RtiRegItem('HDF-5 file',
'argos.repo.rtiplugins.hdf5.H5pyFileRti',
extensions=['hdf5', 'h5', 'h5e', 'he5', 'nc']), # hdf e... | [
"def",
"getDefaultItems",
"(",
"self",
")",
":",
"return",
"[",
"RtiRegItem",
"(",
"'HDF-5 file'",
",",
"'argos.repo.rtiplugins.hdf5.H5pyFileRti'",
",",
"extensions",
"=",
"[",
"'hdf5'",
",",
"'h5'",
",",
"'h5e'",
",",
"'he5'",
",",
"'nc'",
"]",
")",
",",
"#... | Returns a list with the default plugins in the repo tree item registry. | [
"Returns",
"a",
"list",
"with",
"the",
"default",
"plugins",
"in",
"the",
"repo",
"tree",
"item",
"registry",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/registry.py#L139-L185 |
titusjan/argos | argos/widgets/aboutdialog.py | AboutDialog._addModuleInfo | def _addModuleInfo(self, moduleInfo):
""" Adds a line with module info to the editor
:param moduleInfo: can either be a string or a module info class.
In the first case, an object is instantiated as ImportedModuleInfo(moduleInfo).
"""
if is_a_string(moduleInfo):
... | python | def _addModuleInfo(self, moduleInfo):
""" Adds a line with module info to the editor
:param moduleInfo: can either be a string or a module info class.
In the first case, an object is instantiated as ImportedModuleInfo(moduleInfo).
"""
if is_a_string(moduleInfo):
... | [
"def",
"_addModuleInfo",
"(",
"self",
",",
"moduleInfo",
")",
":",
"if",
"is_a_string",
"(",
"moduleInfo",
")",
":",
"moduleInfo",
"=",
"mi",
".",
"ImportedModuleInfo",
"(",
"moduleInfo",
")",
"line",
"=",
"\"{:15s}: {}\"",
".",
"format",
"(",
"moduleInfo",
... | Adds a line with module info to the editor
:param moduleInfo: can either be a string or a module info class.
In the first case, an object is instantiated as ImportedModuleInfo(moduleInfo). | [
"Adds",
"a",
"line",
"with",
"module",
"info",
"to",
"the",
"editor",
":",
"param",
"moduleInfo",
":",
"can",
"either",
"be",
"a",
"string",
"or",
"a",
"module",
"info",
"class",
".",
"In",
"the",
"first",
"case",
"an",
"object",
"is",
"instantiated",
... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/aboutdialog.py#L65-L75 |
titusjan/argos | argos/widgets/aboutdialog.py | AboutDialog.addDependencyInfo | def addDependencyInfo(self):
""" Adds version info about the installed dependencies
"""
logger.debug("Adding dependency info to the AboutDialog")
self.progressLabel.setText("Retrieving package info...")
self.editor.clear()
self._addModuleInfo(mi.PythonModuleInfo())
... | python | def addDependencyInfo(self):
""" Adds version info about the installed dependencies
"""
logger.debug("Adding dependency info to the AboutDialog")
self.progressLabel.setText("Retrieving package info...")
self.editor.clear()
self._addModuleInfo(mi.PythonModuleInfo())
... | [
"def",
"addDependencyInfo",
"(",
"self",
")",
":",
"logger",
".",
"debug",
"(",
"\"Adding dependency info to the AboutDialog\"",
")",
"self",
".",
"progressLabel",
".",
"setText",
"(",
"\"Retrieving package info...\"",
")",
"self",
".",
"editor",
".",
"clear",
"(",
... | Adds version info about the installed dependencies | [
"Adds",
"version",
"info",
"about",
"the",
"installed",
"dependencies"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/widgets/aboutdialog.py#L78-L97 |
titusjan/argos | argos/config/floatcti.py | FloatCti._enforceDataType | def _enforceDataType(self, data):
""" Converts to float so that this CTI always stores that type.
Replaces infinite with the maximum respresentable float.
Raises a ValueError if data is a NaN.
"""
value = float(data)
if math.isnan(value):
raise ValueE... | python | def _enforceDataType(self, data):
""" Converts to float so that this CTI always stores that type.
Replaces infinite with the maximum respresentable float.
Raises a ValueError if data is a NaN.
"""
value = float(data)
if math.isnan(value):
raise ValueE... | [
"def",
"_enforceDataType",
"(",
"self",
",",
"data",
")",
":",
"value",
"=",
"float",
"(",
"data",
")",
"if",
"math",
".",
"isnan",
"(",
"value",
")",
":",
"raise",
"ValueError",
"(",
"\"FloatCti can't store NaNs\"",
")",
"if",
"math",
".",
"isinf",
"(",... | Converts to float so that this CTI always stores that type.
Replaces infinite with the maximum respresentable float.
Raises a ValueError if data is a NaN. | [
"Converts",
"to",
"float",
"so",
"that",
"this",
"CTI",
"always",
"stores",
"that",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L60-L78 |
titusjan/argos | argos/config/floatcti.py | FloatCti._dataToString | def _dataToString(self, data):
""" Conversion function used to convert the (default)data to the display value.
"""
if self.specialValueText is not None and data == self.minValue:
return self.specialValueText
else:
return "{}{:.{}f}{}".format(self.prefix, data, sel... | python | def _dataToString(self, data):
""" Conversion function used to convert the (default)data to the display value.
"""
if self.specialValueText is not None and data == self.minValue:
return self.specialValueText
else:
return "{}{:.{}f}{}".format(self.prefix, data, sel... | [
"def",
"_dataToString",
"(",
"self",
",",
"data",
")",
":",
"if",
"self",
".",
"specialValueText",
"is",
"not",
"None",
"and",
"data",
"==",
"self",
".",
"minValue",
":",
"return",
"self",
".",
"specialValueText",
"else",
":",
"return",
"\"{}{:.{}f}{}\"",
... | Conversion function used to convert the (default)data to the display value. | [
"Conversion",
"function",
"used",
"to",
"convert",
"the",
"(",
"default",
")",
"data",
"to",
"the",
"display",
"value",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L81-L87 |
titusjan/argos | argos/config/floatcti.py | FloatCti.debugInfo | def debugInfo(self):
""" Returns the string with debugging information
"""
return ("min = {}, max = {}, step = {}, decimals = {}, specVal = {}"
.format(self.minValue, self.maxValue, self.stepSize,
self.decimals, self.specialValueText)) | python | def debugInfo(self):
""" Returns the string with debugging information
"""
return ("min = {}, max = {}, step = {}, decimals = {}, specVal = {}"
.format(self.minValue, self.maxValue, self.stepSize,
self.decimals, self.specialValueText)) | [
"def",
"debugInfo",
"(",
"self",
")",
":",
"return",
"(",
"\"min = {}, max = {}, step = {}, decimals = {}, specVal = {}\"",
".",
"format",
"(",
"self",
".",
"minValue",
",",
"self",
".",
"maxValue",
",",
"self",
".",
"stepSize",
",",
"self",
".",
"decimals",
","... | Returns the string with debugging information | [
"Returns",
"the",
"string",
"with",
"debugging",
"information"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L91-L96 |
titusjan/argos | argos/config/floatcti.py | FloatCti.createEditor | def createEditor(self, delegate, parent, option):
""" Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return FloatCtiEditor(self, delegate, parent=parent) | python | def createEditor(self, delegate, parent, option):
""" Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return FloatCtiEditor(self, delegate, parent=parent) | [
"def",
"createEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
",",
"option",
")",
":",
"return",
"FloatCtiEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
"=",
"parent",
")"
] | Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation. | [
"Creates",
"a",
"FloatCtiEditor",
".",
"For",
"the",
"parameters",
"see",
"the",
"AbstractCti",
"constructor",
"documentation",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L99-L103 |
titusjan/argos | argos/config/floatcti.py | FloatCtiEditor.finalize | def finalize(self):
""" Called at clean up. Is used to disconnect signals.
"""
self.spinBox.valueChanged.disconnect(self.commitChangedValue)
super(FloatCtiEditor, self).finalize() | python | def finalize(self):
""" Called at clean up. Is used to disconnect signals.
"""
self.spinBox.valueChanged.disconnect(self.commitChangedValue)
super(FloatCtiEditor, self).finalize() | [
"def",
"finalize",
"(",
"self",
")",
":",
"self",
".",
"spinBox",
".",
"valueChanged",
".",
"disconnect",
"(",
"self",
".",
"commitChangedValue",
")",
"super",
"(",
"FloatCtiEditor",
",",
"self",
")",
".",
"finalize",
"(",
")"
] | Called at clean up. Is used to disconnect signals. | [
"Called",
"at",
"clean",
"up",
".",
"Is",
"used",
"to",
"disconnect",
"signals",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L140-L144 |
titusjan/argos | argos/config/floatcti.py | SnFloatCti.debugInfo | def debugInfo(self):
""" Returns the string with debugging information
"""
return ("enabled = {}, min = {}, max = {}, precision = {}, specVal = {}"
.format(self.enabled, self.minValue, self.maxValue,
self.precision, self.specialValueText)) | python | def debugInfo(self):
""" Returns the string with debugging information
"""
return ("enabled = {}, min = {}, max = {}, precision = {}, specVal = {}"
.format(self.enabled, self.minValue, self.maxValue,
self.precision, self.specialValueText)) | [
"def",
"debugInfo",
"(",
"self",
")",
":",
"return",
"(",
"\"enabled = {}, min = {}, max = {}, precision = {}, specVal = {}\"",
".",
"format",
"(",
"self",
".",
"enabled",
",",
"self",
".",
"minValue",
",",
"self",
".",
"maxValue",
",",
"self",
".",
"precision",
... | Returns the string with debugging information | [
"Returns",
"the",
"string",
"with",
"debugging",
"information"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L248-L253 |
titusjan/argos | argos/config/floatcti.py | SnFloatCti.createEditor | def createEditor(self, delegate, parent, option):
""" Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return SnFloatCtiEditor(self, delegate, self.precision, parent=parent) | python | def createEditor(self, delegate, parent, option):
""" Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation.
"""
return SnFloatCtiEditor(self, delegate, self.precision, parent=parent) | [
"def",
"createEditor",
"(",
"self",
",",
"delegate",
",",
"parent",
",",
"option",
")",
":",
"return",
"SnFloatCtiEditor",
"(",
"self",
",",
"delegate",
",",
"self",
".",
"precision",
",",
"parent",
"=",
"parent",
")"
] | Creates a FloatCtiEditor.
For the parameters see the AbstractCti constructor documentation. | [
"Creates",
"a",
"FloatCtiEditor",
".",
"For",
"the",
"parameters",
"see",
"the",
"AbstractCti",
"constructor",
"documentation",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L256-L260 |
titusjan/argos | argos/config/floatcti.py | SnFloatCtiEditor.finalize | def finalize(self):
""" Called at clean up. Is used to disconnect signals.
"""
self.spinBox.valueChanged.disconnect(self.commitChangedValue)
super(SnFloatCtiEditor, self).finalize() | python | def finalize(self):
""" Called at clean up. Is used to disconnect signals.
"""
self.spinBox.valueChanged.disconnect(self.commitChangedValue)
super(SnFloatCtiEditor, self).finalize() | [
"def",
"finalize",
"(",
"self",
")",
":",
"self",
".",
"spinBox",
".",
"valueChanged",
".",
"disconnect",
"(",
"self",
".",
"commitChangedValue",
")",
"super",
"(",
"SnFloatCtiEditor",
",",
"self",
")",
".",
"finalize",
"(",
")"
] | Called at clean up. Is used to disconnect signals. | [
"Called",
"at",
"clean",
"up",
".",
"Is",
"used",
"to",
"disconnect",
"signals",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/floatcti.py#L295-L299 |
titusjan/argos | argos/repo/filesytemrtis.py | detectRtiFromFileName | def detectRtiFromFileName(fileName):
""" Determines the type of RepoTreeItem to use given a file name.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions.
Returns (cls, regItem) tuple. Both the cls ond the regIt... | python | def detectRtiFromFileName(fileName):
""" Determines the type of RepoTreeItem to use given a file name.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions.
Returns (cls, regItem) tuple. Both the cls ond the regIt... | [
"def",
"detectRtiFromFileName",
"(",
"fileName",
")",
":",
"_",
",",
"extension",
"=",
"os",
".",
"path",
".",
"splitext",
"(",
"fileName",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"fileName",
")",
":",
"rtiRegItem",
"=",
"None",
"cls",
"=",
... | Determines the type of RepoTreeItem to use given a file name.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions.
Returns (cls, regItem) tuple. Both the cls ond the regItem can be None.
If the file is a dire... | [
"Determines",
"the",
"type",
"of",
"RepoTreeItem",
"to",
"use",
"given",
"a",
"file",
"name",
".",
"Uses",
"a",
"DirectoryRti",
"for",
"directories",
"and",
"an",
"UnknownFileRti",
"if",
"the",
"file",
"extension",
"doesn",
"t",
"match",
"one",
"of",
"the",
... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/filesytemrtis.py#L85-L110 |
titusjan/argos | argos/repo/filesytemrtis.py | createRtiFromFileName | def createRtiFromFileName(fileName):
""" Determines the type of RepoTreeItem to use given a file name and creates it.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions.
"""
cls, rtiRegItem = detectRtiFromFileNam... | python | def createRtiFromFileName(fileName):
""" Determines the type of RepoTreeItem to use given a file name and creates it.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions.
"""
cls, rtiRegItem = detectRtiFromFileNam... | [
"def",
"createRtiFromFileName",
"(",
"fileName",
")",
":",
"cls",
",",
"rtiRegItem",
"=",
"detectRtiFromFileName",
"(",
"fileName",
")",
"if",
"cls",
"is",
"None",
":",
"logger",
".",
"warn",
"(",
"\"Unable to import plugin {}: {}\"",
".",
"format",
"(",
"rtiReg... | Determines the type of RepoTreeItem to use given a file name and creates it.
Uses a DirectoryRti for directories and an UnknownFileRti if the file
extension doesn't match one of the registered RTI extensions. | [
"Determines",
"the",
"type",
"of",
"RepoTreeItem",
"to",
"use",
"given",
"a",
"file",
"name",
"and",
"creates",
"it",
".",
"Uses",
"a",
"DirectoryRti",
"for",
"directories",
"and",
"an",
"UnknownFileRti",
"if",
"the",
"file",
"extension",
"doesn",
"t",
"matc... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/filesytemrtis.py#L113-L128 |
titusjan/argos | argos/repo/filesytemrtis.py | DirectoryRti._fetchAllChildren | def _fetchAllChildren(self):
""" Gets all sub directories and files within the current directory.
Does not fetch hidden files.
"""
childItems = []
fileNames = os.listdir(self._fileName)
absFileNames = [os.path.join(self._fileName, fn) for fn in fileNames]
# A... | python | def _fetchAllChildren(self):
""" Gets all sub directories and files within the current directory.
Does not fetch hidden files.
"""
childItems = []
fileNames = os.listdir(self._fileName)
absFileNames = [os.path.join(self._fileName, fn) for fn in fileNames]
# A... | [
"def",
"_fetchAllChildren",
"(",
"self",
")",
":",
"childItems",
"=",
"[",
"]",
"fileNames",
"=",
"os",
".",
"listdir",
"(",
"self",
".",
"_fileName",
")",
"absFileNames",
"=",
"[",
"os",
".",
"path",
".",
"join",
"(",
"self",
".",
"_fileName",
",",
... | Gets all sub directories and files within the current directory.
Does not fetch hidden files. | [
"Gets",
"all",
"sub",
"directories",
"and",
"files",
"within",
"the",
"current",
"directory",
".",
"Does",
"not",
"fetch",
"hidden",
"files",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/filesytemrtis.py#L63-L82 |
titusjan/argos | argos/collect/collectortree.py | CollectorTree.resizeColumnsToContents | def resizeColumnsToContents(self, startCol=None, stopCol=None):
""" Resizes all columns to the contents
"""
numCols = self.model().columnCount()
startCol = 0 if startCol is None else max(startCol, 0)
stopCol = numCols if stopCol is None else min(stopCol, numCols)
row = ... | python | def resizeColumnsToContents(self, startCol=None, stopCol=None):
""" Resizes all columns to the contents
"""
numCols = self.model().columnCount()
startCol = 0 if startCol is None else max(startCol, 0)
stopCol = numCols if stopCol is None else min(stopCol, numCols)
row = ... | [
"def",
"resizeColumnsToContents",
"(",
"self",
",",
"startCol",
"=",
"None",
",",
"stopCol",
"=",
"None",
")",
":",
"numCols",
"=",
"self",
".",
"model",
"(",
")",
".",
"columnCount",
"(",
")",
"startCol",
"=",
"0",
"if",
"startCol",
"is",
"None",
"els... | Resizes all columns to the contents | [
"Resizes",
"all",
"columns",
"to",
"the",
"contents"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/collect/collectortree.py#L83-L99 |
titusjan/argos | argos/collect/collectortree.py | CollectorSpinBox.sizeHint | def sizeHint(self):
""" Reimplemented from the C++ Qt source of QAbstractSpinBox.sizeHint, but without
truncating to a maximum of 18 characters.
"""
# The cache is invalid after the prefix, postfix and other properties
# have been set. I disabled it because sizeHint isn't cal... | python | def sizeHint(self):
""" Reimplemented from the C++ Qt source of QAbstractSpinBox.sizeHint, but without
truncating to a maximum of 18 characters.
"""
# The cache is invalid after the prefix, postfix and other properties
# have been set. I disabled it because sizeHint isn't cal... | [
"def",
"sizeHint",
"(",
"self",
")",
":",
"# The cache is invalid after the prefix, postfix and other properties",
"# have been set. I disabled it because sizeHint isn't called that often.",
"#if self._cachedSizeHint is not None:",
"# return self._cachedSizeHint",
"orgSizeHint",
"=",
"sup... | Reimplemented from the C++ Qt source of QAbstractSpinBox.sizeHint, but without
truncating to a maximum of 18 characters. | [
"Reimplemented",
"from",
"the",
"C",
"++",
"Qt",
"source",
"of",
"QAbstractSpinBox",
".",
"sizeHint",
"but",
"without",
"truncating",
"to",
"a",
"maximum",
"of",
"18",
"characters",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/collect/collectortree.py#L114-L176 |
titusjan/argos | argos/config/configitemdelegate.py | ConfigItemDelegate.createEditor | def createEditor(self, parent, option, index):
""" Returns the widget used to change data from the model and can be reimplemented to
customize editing behavior.
Reimplemented from QStyledItemDelegate.
"""
logger.debug("ConfigItemDelegate.createEditor, parent: {!r}".forma... | python | def createEditor(self, parent, option, index):
""" Returns the widget used to change data from the model and can be reimplemented to
customize editing behavior.
Reimplemented from QStyledItemDelegate.
"""
logger.debug("ConfigItemDelegate.createEditor, parent: {!r}".forma... | [
"def",
"createEditor",
"(",
"self",
",",
"parent",
",",
"option",
",",
"index",
")",
":",
"logger",
".",
"debug",
"(",
"\"ConfigItemDelegate.createEditor, parent: {!r}\"",
".",
"format",
"(",
"parent",
".",
"objectName",
"(",
")",
")",
")",
"assert",
"index",
... | Returns the widget used to change data from the model and can be reimplemented to
customize editing behavior.
Reimplemented from QStyledItemDelegate. | [
"Returns",
"the",
"widget",
"used",
"to",
"change",
"data",
"from",
"the",
"model",
"and",
"can",
"be",
"reimplemented",
"to",
"customize",
"editing",
"behavior",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configitemdelegate.py#L46-L57 |
titusjan/argos | argos/config/configitemdelegate.py | ConfigItemDelegate.setEditorData | def setEditorData(self, editor, index):
""" Provides the widget with data to manipulate.
Calls the setEditorValue of the config tree item at the index.
:type editor: QWidget
:type index: QModelIndex
Reimplemented from QStyledItemDelegate.
"""
# W... | python | def setEditorData(self, editor, index):
""" Provides the widget with data to manipulate.
Calls the setEditorValue of the config tree item at the index.
:type editor: QWidget
:type index: QModelIndex
Reimplemented from QStyledItemDelegate.
"""
# W... | [
"def",
"setEditorData",
"(",
"self",
",",
"editor",
",",
"index",
")",
":",
"# We take the config value via the model to be consistent with setModelData",
"data",
"=",
"index",
".",
"model",
"(",
")",
".",
"data",
"(",
"index",
",",
"Qt",
".",
"EditRole",
")",
"... | Provides the widget with data to manipulate.
Calls the setEditorValue of the config tree item at the index.
:type editor: QWidget
:type index: QModelIndex
Reimplemented from QStyledItemDelegate. | [
"Provides",
"the",
"widget",
"with",
"data",
"to",
"manipulate",
".",
"Calls",
"the",
"setEditorValue",
"of",
"the",
"config",
"tree",
"item",
"at",
"the",
"index",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configitemdelegate.py#L78-L89 |
titusjan/argos | argos/config/configitemdelegate.py | ConfigItemDelegate.setModelData | def setModelData(self, editor, model, index):
""" Gets data from the editor widget and stores it in the specified model at the item index.
Does this by calling getEditorValue of the config tree item at the index.
:type editor: QWidget
:type model: ConfigTreeModel
... | python | def setModelData(self, editor, model, index):
""" Gets data from the editor widget and stores it in the specified model at the item index.
Does this by calling getEditorValue of the config tree item at the index.
:type editor: QWidget
:type model: ConfigTreeModel
... | [
"def",
"setModelData",
"(",
"self",
",",
"editor",
",",
"model",
",",
"index",
")",
":",
"try",
":",
"data",
"=",
"editor",
".",
"getData",
"(",
")",
"except",
"InvalidInputError",
"as",
"ex",
":",
"logger",
".",
"warn",
"(",
"ex",
")",
"else",
":",
... | Gets data from the editor widget and stores it in the specified model at the item index.
Does this by calling getEditorValue of the config tree item at the index.
:type editor: QWidget
:type model: ConfigTreeModel
:type index: QModelIndex
Reimplemented from ... | [
"Gets",
"data",
"from",
"the",
"editor",
"widget",
"and",
"stores",
"it",
"in",
"the",
"specified",
"model",
"at",
"the",
"item",
"index",
".",
"Does",
"this",
"by",
"calling",
"getEditorValue",
"of",
"the",
"config",
"tree",
"item",
"at",
"the",
"index",
... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configitemdelegate.py#L92-L109 |
titusjan/argos | argos/config/configitemdelegate.py | ConfigItemDelegate.updateEditorGeometry | def updateEditorGeometry(self, editor, option, index):
""" Ensures that the editor is displayed correctly with respect to the item view.
"""
cti = index.model().getItem(index)
if cti.checkState is None:
displayRect = option.rect
else:
checkBoxRect = widget... | python | def updateEditorGeometry(self, editor, option, index):
""" Ensures that the editor is displayed correctly with respect to the item view.
"""
cti = index.model().getItem(index)
if cti.checkState is None:
displayRect = option.rect
else:
checkBoxRect = widget... | [
"def",
"updateEditorGeometry",
"(",
"self",
",",
"editor",
",",
"option",
",",
"index",
")",
":",
"cti",
"=",
"index",
".",
"model",
"(",
")",
".",
"getItem",
"(",
"index",
")",
"if",
"cti",
".",
"checkState",
"is",
"None",
":",
"displayRect",
"=",
"... | Ensures that the editor is displayed correctly with respect to the item view. | [
"Ensures",
"that",
"the",
"editor",
"is",
"displayed",
"correctly",
"with",
"respect",
"to",
"the",
"item",
"view",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configitemdelegate.py#L112-L124 |
titusjan/argos | argos/config/configtreeview.py | ConfigTreeView.closeEditor | def closeEditor(self, editor, hint):
""" Finalizes, closes and releases the given editor.
"""
# It would be nicer if this method was part of ConfigItemDelegate since createEditor also
# lives there. However, QAbstractItemView.closeEditor is sometimes called directly,
# without th... | python | def closeEditor(self, editor, hint):
""" Finalizes, closes and releases the given editor.
"""
# It would be nicer if this method was part of ConfigItemDelegate since createEditor also
# lives there. However, QAbstractItemView.closeEditor is sometimes called directly,
# without th... | [
"def",
"closeEditor",
"(",
"self",
",",
"editor",
",",
"hint",
")",
":",
"# It would be nicer if this method was part of ConfigItemDelegate since createEditor also",
"# lives there. However, QAbstractItemView.closeEditor is sometimes called directly,",
"# without the QAbstractItemDelegate.cl... | Finalizes, closes and releases the given editor. | [
"Finalizes",
"closes",
"and",
"releases",
"the",
"given",
"editor",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configtreeview.py#L93-L104 |
titusjan/argos | argos/config/configtreeview.py | ConfigTreeView.expandBranch | def expandBranch(self, index=None, expanded=None):
""" Expands or collapses the node at the index and all it's descendants.
If expanded is True the nodes will be expanded, if False they will be collapsed, and if
expanded is None the expanded attribute of each item is used.
If... | python | def expandBranch(self, index=None, expanded=None):
""" Expands or collapses the node at the index and all it's descendants.
If expanded is True the nodes will be expanded, if False they will be collapsed, and if
expanded is None the expanded attribute of each item is used.
If... | [
"def",
"expandBranch",
"(",
"self",
",",
"index",
"=",
"None",
",",
"expanded",
"=",
"None",
")",
":",
"configModel",
"=",
"self",
".",
"model",
"(",
")",
"if",
"index",
"is",
"None",
":",
"#index = configTreeModel.createIndex()",
"index",
"=",
"QtCore",
"... | Expands or collapses the node at the index and all it's descendants.
If expanded is True the nodes will be expanded, if False they will be collapsed, and if
expanded is None the expanded attribute of each item is used.
If parentIndex is None, the invisible root will be used (i.e. the... | [
"Expands",
"or",
"collapses",
"the",
"node",
"at",
"the",
"index",
"and",
"all",
"it",
"s",
"descendants",
".",
"If",
"expanded",
"is",
"True",
"the",
"nodes",
"will",
"be",
"expanded",
"if",
"False",
"they",
"will",
"be",
"collapsed",
"and",
"if",
"expa... | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/config/configtreeview.py#L107-L128 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | ncVarAttributes | def ncVarAttributes(ncVar):
""" Returns the attributes of ncdf variable
"""
try:
return ncVar.__dict__
except Exception as ex:
# Due to some internal error netCDF4 may raise an AttributeError or KeyError,
# depending on its version.
logger.warn("Unable to read the attribu... | python | def ncVarAttributes(ncVar):
""" Returns the attributes of ncdf variable
"""
try:
return ncVar.__dict__
except Exception as ex:
# Due to some internal error netCDF4 may raise an AttributeError or KeyError,
# depending on its version.
logger.warn("Unable to read the attribu... | [
"def",
"ncVarAttributes",
"(",
"ncVar",
")",
":",
"try",
":",
"return",
"ncVar",
".",
"__dict__",
"except",
"Exception",
"as",
"ex",
":",
"# Due to some internal error netCDF4 may raise an AttributeError or KeyError,",
"# depending on its version.",
"logger",
".",
"warn",
... | Returns the attributes of ncdf variable | [
"Returns",
"the",
"attributes",
"of",
"ncdf",
"variable"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L36-L46 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | ncVarUnit | def ncVarUnit(ncVar):
""" Returns the unit of the ncVar by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned.
"""
attributes = ncVarAttribute... | python | def ncVarUnit(ncVar):
""" Returns the unit of the ncVar by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned.
"""
attributes = ncVarAttribute... | [
"def",
"ncVarUnit",
"(",
"ncVar",
")",
":",
"attributes",
"=",
"ncVarAttributes",
"(",
"ncVar",
")",
"if",
"not",
"attributes",
":",
"return",
"''",
"# a premature optimization :-)",
"for",
"key",
"in",
"(",
"'unit'",
",",
"'units'",
",",
"'Unit'",
",",
"'Un... | Returns the unit of the ncVar by looking in the attributes.
It searches in the attributes for one of the following keys:
'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty
string is returned. | [
"Returns",
"the",
"unit",
"of",
"the",
"ncVar",
"by",
"looking",
"in",
"the",
"attributes",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L49-L66 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | variableMissingValue | def variableMissingValue(ncVar):
""" Returns the missingData given a NetCDF variable
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found.
"""
attributes = ncVarAttributes(ncVar)
if not attribute... | python | def variableMissingValue(ncVar):
""" Returns the missingData given a NetCDF variable
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found.
"""
attributes = ncVarAttributes(ncVar)
if not attribute... | [
"def",
"variableMissingValue",
"(",
"ncVar",
")",
":",
"attributes",
"=",
"ncVarAttributes",
"(",
"ncVar",
")",
"if",
"not",
"attributes",
":",
"return",
"None",
"# a premature optimization :-)",
"for",
"key",
"in",
"(",
"'missing_value'",
",",
"'MissingValue'",
"... | Returns the missingData given a NetCDF variable
Looks for one of the following attributes: _FillValue, missing_value, MissingValue,
missingValue. Returns None if these attributes are not found. | [
"Returns",
"the",
"missingData",
"given",
"a",
"NetCDF",
"variable"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L70-L84 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfFieldRti.elementTypeName | def elementTypeName(self):
""" String representation of the element type.
"""
fieldName = self.nodeName
return str(self._ncVar.dtype.fields[fieldName][0]) | python | def elementTypeName(self):
""" String representation of the element type.
"""
fieldName = self.nodeName
return str(self._ncVar.dtype.fields[fieldName][0]) | [
"def",
"elementTypeName",
"(",
"self",
")",
":",
"fieldName",
"=",
"self",
".",
"nodeName",
"return",
"str",
"(",
"self",
".",
"_ncVar",
".",
"dtype",
".",
"fields",
"[",
"fieldName",
"]",
"[",
"0",
"]",
")"
] | String representation of the element type. | [
"String",
"representation",
"of",
"the",
"element",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L191-L195 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfFieldRti.unit | def unit(self):
""" Returns the unit attribute of the underlying ncdf variable.
If the units has a length (e.g is a list) and has precisely one element per field,
the unit for this field is returned.
"""
unit = ncVarUnit(self._ncVar)
fieldNames = self._ncVar.dtyp... | python | def unit(self):
""" Returns the unit attribute of the underlying ncdf variable.
If the units has a length (e.g is a list) and has precisely one element per field,
the unit for this field is returned.
"""
unit = ncVarUnit(self._ncVar)
fieldNames = self._ncVar.dtyp... | [
"def",
"unit",
"(",
"self",
")",
":",
"unit",
"=",
"ncVarUnit",
"(",
"self",
".",
"_ncVar",
")",
"fieldNames",
"=",
"self",
".",
"_ncVar",
".",
"dtype",
".",
"names",
"# If the missing value attribute is a list with the same length as the number of fields,",
"# return... | Returns the unit attribute of the underlying ncdf variable.
If the units has a length (e.g is a list) and has precisely one element per field,
the unit for this field is returned. | [
"Returns",
"the",
"unit",
"attribute",
"of",
"the",
"underlying",
"ncdf",
"variable",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L207-L222 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfFieldRti.dimensionNames | def dimensionNames(self):
""" Returns a list with the dimension names of the underlying NCDF variable
"""
nSubDims = len(self._subArrayShape)
subArrayDims = ['SubDim{}'.format(dimNr) for dimNr in range(nSubDims)]
return list(self._ncVar.dimensions + tuple(subArrayDims)) | python | def dimensionNames(self):
""" Returns a list with the dimension names of the underlying NCDF variable
"""
nSubDims = len(self._subArrayShape)
subArrayDims = ['SubDim{}'.format(dimNr) for dimNr in range(nSubDims)]
return list(self._ncVar.dimensions + tuple(subArrayDims)) | [
"def",
"dimensionNames",
"(",
"self",
")",
":",
"nSubDims",
"=",
"len",
"(",
"self",
".",
"_subArrayShape",
")",
"subArrayDims",
"=",
"[",
"'SubDim{}'",
".",
"format",
"(",
"dimNr",
")",
"for",
"dimNr",
"in",
"range",
"(",
"nSubDims",
")",
"]",
"return",... | Returns a list with the dimension names of the underlying NCDF variable | [
"Returns",
"a",
"list",
"with",
"the",
"dimension",
"names",
"of",
"the",
"underlying",
"NCDF",
"variable"
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L227-L232 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfFieldRti.missingDataValue | def missingDataValue(self):
""" Returns the value to indicate missing data. None if no missing-data value is specified.
"""
value = variableMissingValue(self._ncVar)
fieldNames = self._ncVar.dtype.names
# If the missing value attibute is a list with the same length as the number... | python | def missingDataValue(self):
""" Returns the value to indicate missing data. None if no missing-data value is specified.
"""
value = variableMissingValue(self._ncVar)
fieldNames = self._ncVar.dtype.names
# If the missing value attibute is a list with the same length as the number... | [
"def",
"missingDataValue",
"(",
"self",
")",
":",
"value",
"=",
"variableMissingValue",
"(",
"self",
".",
"_ncVar",
")",
"fieldNames",
"=",
"self",
".",
"_ncVar",
".",
"dtype",
".",
"names",
"# If the missing value attibute is a list with the same length as the number o... | Returns the value to indicate missing data. None if no missing-data value is specified. | [
"Returns",
"the",
"value",
"to",
"indicate",
"missing",
"data",
".",
"None",
"if",
"no",
"missing",
"-",
"data",
"value",
"is",
"specified",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L236-L248 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfVariableRti.elementTypeName | def elementTypeName(self):
""" String representation of the element type.
"""
dtype = self._ncVar.dtype
if type(dtype) == type:
# Handle the unexpected case that dtype is a regular Python type
# (happens e.g. in the /PROCESSOR/processing_configuration of the Trop... | python | def elementTypeName(self):
""" String representation of the element type.
"""
dtype = self._ncVar.dtype
if type(dtype) == type:
# Handle the unexpected case that dtype is a regular Python type
# (happens e.g. in the /PROCESSOR/processing_configuration of the Trop... | [
"def",
"elementTypeName",
"(",
"self",
")",
":",
"dtype",
"=",
"self",
".",
"_ncVar",
".",
"dtype",
"if",
"type",
"(",
"dtype",
")",
"==",
"type",
":",
"# Handle the unexpected case that dtype is a regular Python type",
"# (happens e.g. in the /PROCESSOR/processing_config... | String representation of the element type. | [
"String",
"representation",
"of",
"the",
"element",
"type",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L321-L330 |
titusjan/argos | argos/repo/rtiplugins/ncdf.py | NcdfVariableRti._fetchAllChildren | def _fetchAllChildren(self):
""" Fetches all fields that this variable contains.
Only variables with a structured data type can have fields.
"""
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
# Add fields
if self._isStructure... | python | def _fetchAllChildren(self):
""" Fetches all fields that this variable contains.
Only variables with a structured data type can have fields.
"""
assert self.canFetchChildren(), "canFetchChildren must be True"
childItems = []
# Add fields
if self._isStructure... | [
"def",
"_fetchAllChildren",
"(",
"self",
")",
":",
"assert",
"self",
".",
"canFetchChildren",
"(",
")",
",",
"\"canFetchChildren must be True\"",
"childItems",
"=",
"[",
"]",
"# Add fields",
"if",
"self",
".",
"_isStructured",
":",
"for",
"fieldName",
"in",
"sel... | Fetches all fields that this variable contains.
Only variables with a structured data type can have fields. | [
"Fetches",
"all",
"fields",
"that",
"this",
"variable",
"contains",
".",
"Only",
"variables",
"with",
"a",
"structured",
"data",
"type",
"can",
"have",
"fields",
"."
] | train | https://github.com/titusjan/argos/blob/20d0a3cae26c36ea789a5d219c02ca7df21279dd/argos/repo/rtiplugins/ncdf.py#L354-L367 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.