Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cached_property
def _get_f(self):
"""
Calculate the frequency vector appropriate for indexing non-shifted FFT output, in Hz.
# (i.e. - [0, f0, 2 * f0, ... , fN] + [-(fN - f0), -(fN - 2 * f0), ... , -f0]
"""
t = self.t
npts = len(t)
f0 = 1.0 / (t[1] * npts)
half_npts = npts // 2
return array([i * f0 for i in range(half_npts + 1)] + [(half_npts - i) * -f0 for i in range(1, half_npts)])
@cached_property
def _get_rotation(self):
rot = np.array([self.rot_x, self.rot_y, self.rot_z])
return rot
@cached_property
def _get_can_save_as(self):
can = not (np.all(self.nasion == self.lpa) or
np.all(self.nasion == self.rpa) or
np.all(self.lpa == self.rpa))
return can
@cached_property
def _get_queue_len_str(self):
if self.queue_len:
return "Queue length: %i" % self.queue_len
else:
return ''
@cached_property
def _get_postprocessors(self):
return self.rules.get("postprocessors", [])
@cached_property
def _get_visible_snippets(self):
""" Returns the list of code items that are currently visible.
"""
if self.visible:
return self.snippets
return [snippet for snippet in self.snippets if (not snippet.hidden)]
@cached_property
def _get_mri_trans(self):
t = self.mri_trans_noscale.copy()
t[:, :3] *= self.parameters[6:9]
return t
@cached_property
def _get_control(self):
"""
Returns the control cluster for the notebook page
"""
self.layout = QtGui.QVBoxLayout()
control = QtGui.QWidget()
buttons_layout = QtGui.QHBoxLayout()
buttons_container = QtGui.QWidget()
self.cmd_button = QtGui.QCommandLinkButton(buttons_container)
self.cmd_button.setVisible(True)
self.cmd_button.setCheckable(True)
self.cmd_button.setFlat(True)
self.cmd_button.setAutoFillBackground(True)
self.cmd_button.clicked.connect(self._handle_page_toggle)
@cached_property
def _get_digest( self ):
return digest(self)
@cached_property
def _get_transformed_hsp_lpa(self):
return apply_trans(self.hsp_trans, self.hsp.lpa)