コード例 #1
0
ファイル: TreeWithButtons.py プロジェクト: lisarosalina/App
    def __init__(self, object, parent, buttonType=None):

        Node.__init__(self, object, parent)

        # list of values used to emulate buttons and associated Tk ids
        # created in drawNodeCustomization
        if parent:
            chkbtval = []
            pchkbtval = parent.chkbtval
            for i, c in enumerate(parent.tree().columns):
                if c.inherited:
                    chkbtval.append(pchkbtval[i])
                else:
                    chkbtval.append(c.isOn(self))
            self.chkbtval = chkbtval
        else:
            self.chkbtval = []
        self.chkbtid = []
        self.buttonType = buttonType # can be 'OnOffButtons'
コード例 #2
0
ファイル: cvitems.py プロジェクト: Dave4675/geosolver-2
    def __init__(self, compView, parentNode, id, parent=None):
        QtGui.QGraphicsItem.__init__(self, parent)
        Node.__init__(self, parentNode)

        self.compositionView = compView
        self.setFlags(QtGui.QGraphicsItem.ItemIsSelectable)
        self.setAcceptsHoverEvents(True)
        self.startAngle = 0
        self.spanAngle = 0
        self.paintRect = QtCore.QRectF(0, 0, self.width / 2, self.height / 2)
        self.fixGraphic = QtGui.QGraphicsSimpleTextItem("F", self)
        self.fixGraphic.hide()
        self.bezierCurve = None
        self.flag = None
        self.prtRef = None
        self.boundary = self.paintRect
        self.clusterHighlight = None
        self.permCluster = None
        self.clusterActive = False
        self.identifier = id
コード例 #3
0
 def __init__(self, key, p, left, right, color):
     Node.__init__(self, key, p, left, right)
     self.color = color
コード例 #4
0
 def __init__(self, key, p, left, right, color):
     Node.__init__(self, key, p, left, right)
     self.color = color
     if key != None:
         key.pointer = self
コード例 #5
0
    def __init__(self,
                 name,
                 value,
                 min_value=None,
                 max_value=None,
                 desc=None,
                 unit=u.dimensionless_unscaled,
                 transformation=None):

        # Make this a node

        Node.__init__(self, name)

        # Make a static name which will never change (not even after a _change_name call)
        self._static_name = str(name)

        # Callbacks are executed any time the value for the parameter changes (i.e., its value changes)

        # We start from a empty list of callbacks.
        self._callbacks = []

        # Assign to members

        # Store the units as an astropy.units.Unit instance

        self._unit = self._safe_assign_unit(unit)

        # A ParameterBase instance cannot have auxiliary variables
        self._aux_variable = {}

        # Set min and max to None first so that the .value setter will work,
        # we will override them later if needed
        self._external_min_value = None
        self._external_max_value = None

        # Store the transformation. This allows to disentangle the value of the parameter which the user interact
        # width with the value of the parameter the fitting engine (or the Bayesian sampler) interact with
        self._transformation = transformation

        # Let's store the init value

        # NOTE: this will be updated immediately by the _set_value method of the "value" property
        self._internal_value = None
        # If the value is a Quantity, deal with that

        if isinstance(value, u.Quantity):

            # If the user did not specify an ad-hoc unit, use the unit
            # of the Quantity

            if self._unit == u.dimensionless_unscaled:

                self._unit = value.unit

            # Convert the value to the provided unit (if necessary)

            self.value = value.to(self._unit).value

        else:

            self.value = value

        # Set minimum if provided, otherwise use default
        # (use the property so the checks that are there are performed also on construction)

        self.min_value = min_value

        # Set maximum if provided, otherwise use default

        # this will be overwritten immediately in the next line
        self.max_value = max_value

        # Store description

        self._desc = desc

        # Make the description the documentation as well

        self.__doc__ = desc

        # Now perform a very lazy check that we can perform math operations on value, minimum and maximum
        # (i.e., they are numbers)

        if not _behaves_like_a_number(self.value):

            raise TypeError("The provided initial value is not a number")
コード例 #6
0
 def __init__(self, data=None, parent=None, color=1):
     Node.__init__(self, data, parent)
     self.color = color
 def __init__(self, liss, data):
     Node.__init__(self, data)
     self.liss = liss
コード例 #8
0
ファイル: kdtree.py プロジェクト: stemon/ML_lihang
 def __init__(self, data=-1, depth=-1, left=None, right=None, idx=None):
     Node.__init__(self, data, depth, left, right)
     self.idx = idx