def _get_name(self): if self.name is t.Undefined: if self.axes_manager is None: name = "Unnamed" else: name = "Unnamed " + ordinal(self.index_in_axes_manager) else: name = self.name return name
def __init__(self, order=2, module="numexpr", **kwargs): # Not to break scripts once we remove the legacy Polynomial if "legacy" in kwargs: del kwargs["legacy"] if order == 0: raise ValueError("Polynomial of order 0 is not supported.") coeff_list = ['{}'.format(o).zfill(len(list(str(order)))) for o in range(order, -1, -1)] expr = "+".join(["a{}*x**{}".format(c, o) for c, o in zip(coeff_list, range(order, -1, -1))]) name = "{} order Polynomial".format(ordinal(order)) super().__init__(expression=expr, name=name, module=module, autodoc=False, **kwargs) self._id_name = "eab91275-88db-4855-917a-cdcbe7209592"
def __repr__(self): text = "%s order Polynomial component" % ordinal( self.get_polynomial_order()) if self.name: text = "%s (%s)" % (self.name, text) return "<%s>" % text
def _get_name(self): name = (self.name if self.name is not t.Undefined else ("Unnamed " + ordinal(self.index_in_axes_manager))) return name
def _get_name(self): name = (self.name if self.name is not t.Undefined else ("Unnamed " + ordinal(self.index_in_axes_manager)) if self.axes_manager is not None else "Unnamed") return name
def __repr__(self): return u'Component <%s order polynomial>'.encode('utf8') % (ordinal( self.get_polynomial_order()))
def __repr__(self): return 'Component <%s order polynomial>' % ( ordinal(self.get_polynomial_order()))
def __repr__(self): return u'Component <%s order polynomial>'.encode('utf8') % ( ordinal(self.get_polynomial_order()))
def get_axis_label(axis): idx = ordinal(axis.index_in_axes_manager) type_ = "navigation" if axis.navigate else "signal" label = "{} ({}) axis".format(idx, type_) return label