Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 18, 2023
1 parent 6508c76 commit 5c2c21b
Show file tree
Hide file tree
Showing 13 changed files with 2 additions and 31 deletions.
1 change: 0 additions & 1 deletion fiducialreg/imref.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class DimensionManager:
def __init__(
self, DimensionName="", NumberOfSamples=2, Delta=1, StartCoordinateInWorld=0.5
):

if DimensionName not in ["X", "Y", "Z"]:
raise ValueError("DimensionName must be X, Y, or Z")
self.DimensionName = DimensionName
Expand Down
1 change: 0 additions & 1 deletion llspy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from llspy.bin.llspy_gui import main

if __name__ == "__main__":

import logging

logger = logging.getLogger(__name__)
Expand Down
2 changes: 0 additions & 2 deletions llspy/camcalib.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ def process_dark_images(folder, callback=None, callback2=None):


def process_bright_images(folder, darkavg, darkstd, callback=None, save=True):

ch0list, ch1list = get_channel_list(folder)
pre, post = combine_stacks(ch0list, ch1list, darkavg)

Expand Down Expand Up @@ -203,7 +202,6 @@ def process_bright_images(folder, darkavg, darkstd, callback=None, save=True):


if __name__ == "__main__":

# this script assumes you have aquired a series of 2-channel zstacks
# (not actually a stack, turn off Z galvo, and Z and Sample Piezos
# the first channel is "bright" and "even" (such as 488 laser sheet exciting FITC)
Expand Down
1 change: 0 additions & 1 deletion llspy/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,6 @@ def correct_stacks(


if __name__ == "__main__":

from llspy import llsdir, samples

paramfile = samples.camparams # path to the calibration file
Expand Down
2 changes: 0 additions & 2 deletions llspy/gui/camcalibgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def setFolder(self):
self.darkSTDineEdit.setText(os.path.join(folder, "dark_STD.tif"))

def processFolder(self):

folder = self.camCalibFolderLineEdit.text()

darkavg = None
Expand Down Expand Up @@ -214,7 +213,6 @@ def _abort(self):


if __name__ == "__main__":

app = QtW.QApplication(sys.argv)
# dlg = LogWindow()
# dlg.show()
Expand Down
3 changes: 0 additions & 3 deletions llspy/gui/img_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(self, name, wave=None, parent=None):


class DataModel(QtCore.QObject):

_idxChanged = QtCore.Signal()
_dataChanged = QtCore.Signal()

Expand Down Expand Up @@ -294,7 +293,6 @@ def __getitem__(self, tczTuple):


class MplCanvas(FigureCanvas):

_contrastChanged = QtCore.Signal()

def __init__(self):
Expand Down Expand Up @@ -582,7 +580,6 @@ def update_sliders(self):
self.update_axis_slider(axis, n)

def initialize(self):

datamax = self.data.max()
datamin = self.data.min()
# dataRange = datamax - datamin
Expand Down
4 changes: 0 additions & 4 deletions llspy/gui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,14 +1138,12 @@ def displayPreview(self, array, dx, dz, params=None):
viewer.dims.ndisplay = 3
self.spimwins.append(viewer)
elif self.prevBackendSpimagineRadio.isChecked() and _SPIMAGINE_IMPORTED:

if np.squeeze(array).ndim > 4:
arrays = [array[:, i] for i in range(array.shape[1])]
else:
arrays = [np.squeeze(array)]

for arr in arrays:

datamax = arr.max()
datamin = arr.min()
dataRange = datamax - datamin
Expand Down Expand Up @@ -1660,7 +1658,6 @@ def concatenateSelected(self):
[self.listbox.addPath(p) for p in selectedPaths]

def undoRenameSelected(self):

box = QtW.QMessageBox()
box.setWindowTitle("Undo Renaming")
box.setText(
Expand Down Expand Up @@ -1712,7 +1709,6 @@ def renameSelected(self):
[self.listbox.addPath(osp.join(item, p)) for p in os.listdir(item)]

def mergeMIPtool(self):

if len(self.listbox.selectedPaths()):
for obj in self.listbox.selectedObjects():
obj.mergemips()
Expand Down
1 change: 0 additions & 1 deletion llspy/gui/qtlogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def formatException(self, exc_info):


class NotificationHandler(QObject, logging.Handler):

emitSignal = Signal(str)

def __init__(self):
Expand Down
6 changes: 0 additions & 6 deletions llspy/gui/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def onFinished(self, exitCode, exitStatus):


class CompressionWorker(SubprocessWorker):

status_update = QtCore.Signal(str, int)

def __init__(self, path, mode="compress", binary=None, wid=1, **kwargs):
Expand Down Expand Up @@ -235,7 +234,6 @@ def untar(self, tarball, delete=True):
with tarfile.open(tarball) as tar:

def is_within_directory(directory, target):

abs_directory = os.path.abspath(directory)
abs_target = os.path.abspath(target)

Expand All @@ -244,7 +242,6 @@ def is_within_directory(directory, target):
return prefix == abs_directory

def safe_extract(tar, path=".", members=None, *, numeric_owner=False):

for member in tar.getmembers():
member_path = os.path.join(path, member.name)
if not is_within_directory(path, member_path):
Expand Down Expand Up @@ -345,7 +342,6 @@ def split(a, n):


class LLSitemWorker(QtCore.QObject):

sig_starting_item = QtCore.Signal(str, int) # item path, numfiles

status_update = QtCore.Signal(str) # update mainGUI status
Expand Down Expand Up @@ -438,7 +434,6 @@ def work(self):

# only call cudaDeconv if we need to deskew or deconvolve
if self.P.nIters > 0 or (self.P.deskew != 0 and self.P.saveDeskewedRaw):

try:
# check the binary path and create object
binary = llspy.cudabinwrapper.CUDAbin(_CUDABIN)
Expand Down Expand Up @@ -547,7 +542,6 @@ def on_CUDAworker_done(self, worker_id):
self.post_process()

def post_process(self):

if self.P.doReg:
self.status_update.emit(f"Doing Channel Registration: {self.E.basename}")
try:
Expand Down
1 change: 0 additions & 1 deletion llspy/libcudawrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@ def RL_decon(
plt.show()
RL_cleanup()
elif sys.argv[1] == "camcor":

import time

from llspy import llsdir, samples
Expand Down
1 change: 0 additions & 1 deletion llspy/llsdir.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,6 @@ def median_and_trim(
trimX=(0, 0),
**kwargs,
):

trim = (trimZ, trimY, trimX)

outpath = self.path.joinpath("Corrected")
Expand Down
1 change: 0 additions & 1 deletion llspy/xzpsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ def find_settext(path, filepattern="*Settings.txt"):


if __name__ == "__main__":

import argparse

parser = argparse.ArgumentParser()
Expand Down
9 changes: 2 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ url = https://github.com/tlambert03/LLSpy
author = Talley Lambert
author_email = [email protected]
license = BSD 3-clause
license_file = LICENSE
license_files = LICENSE
classifiers =
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Expand All @@ -18,11 +18,6 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Visualization

Expand All @@ -41,7 +36,7 @@ install_requires =
voluptuous
watchdog
numba;python_version < '3.10'
python_requires = >=3.6
python_requires = >=3.8
include_package_data = True
zip_safe = False

Expand Down

0 comments on commit 5c2c21b

Please sign in to comment.