Skip to content

Commit

Permalink
Merge pull request #150 from fmi-faim/typos
Browse files Browse the repository at this point in the history
Add typos pre-commit hook
  • Loading branch information
imagejan authored Jun 24, 2024
2 parents d826de6 + aefbacb commit 1d63fe6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ repos:
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/crate-ci/typos
rev: v1.22.9
hooks:
- id: typos
files: \.(py|md|rst|yaml|toml)
# empty to do not write fixes
args: []
exclude: pyproject.toml
# mypy will force you to type your code ;)
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.910-1
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,12 @@ exclude_lines = [

[tool.setuptools_scm]
write_to = "src/faim_ipa/_version.py"

[tool.typos.default]
extend-ignore-words-re = [
# Hexadecimal identifiers in file names
"^[A-F0-9]*$",
]

[tool.typos.default.extend-words]
ome = "ome"
4 changes: 2 additions & 2 deletions src/faim_ipa/dask_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def __init__(

def _get_scheduler_address(self):
if self._scheduler_address is None:
scheduler_adress = self._queue.get()
self._scheduler_address = scheduler_adress
scheduler_address = self._queue.get()
self._scheduler_address = scheduler_address
self._queue.close()
self._queue = None

Expand Down
10 changes: 5 additions & 5 deletions tests/hcs/imagexpress/test_ImageXpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def single_plane_acquisition(acquisition_dir):
return SinglePlaneAcquisition(acquisition_dir, alignment=TileAlignmentOptions.GRID)


def test_single_plane_acquistion(single_plane_acquisition: PlateAcquisition):
def test_single_plane_acquisition(single_plane_acquisition: PlateAcquisition):
wells = single_plane_acquisition.get_well_acquisitions()

assert wells is not None
Expand Down Expand Up @@ -99,7 +99,7 @@ def stack_acquisition(acquisition_dir):
return StackAcquisition(acquisition_dir, alignment=TileAlignmentOptions.GRID)


def test_stack_acquistion(stack_acquisition: PlateAcquisition):
def test_stack_acquisition(stack_acquisition: PlateAcquisition):
wells = stack_acquisition.get_well_acquisitions()

assert wells is not None
Expand Down Expand Up @@ -290,7 +290,7 @@ def single_channel_acquisition(acquisition_dir_single_channel):
)


def test_single_channel_acquistion(single_channel_acquisition: PlateAcquisition):
def test_single_channel_acquisition(single_channel_acquisition: PlateAcquisition):
wells = single_channel_acquisition.get_well_acquisitions()

assert wells is not None
Expand Down Expand Up @@ -343,7 +343,7 @@ def time_lapse_acquisition(acquisition_dir_time_lapse):
)


def test_time_lapse_acquistion(time_lapse_acquisition: PlateAcquisition):
def test_time_lapse_acquisition(time_lapse_acquisition: PlateAcquisition):
wells = time_lapse_acquisition.get_well_acquisitions()
for well in wells:
assert isinstance(well, WellAcquisition)
Expand All @@ -357,7 +357,7 @@ def test_time_lapse_acquistion(time_lapse_acquisition: PlateAcquisition):
assert tile.shape == (256, 256)


def test_single_field_stack_acquistion(stack_acquisition: PlateAcquisition):
def test_single_field_stack_acquisition(stack_acquisition: PlateAcquisition):
# Regular z spacing in dataset
files = stack_acquisition._parse_files()
z_step = stack_acquisition._compute_z_spacing(files)
Expand Down
4 changes: 2 additions & 2 deletions tests/hcs/test_acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def test_raise_not_implemented_errors(dummy_well):
dummy_well.get_z_spacing()


def test_get_coordiante_transformations_3d(dummy_well):
def test_get_coordinate_transformations_3d(dummy_well):
dummy_well.get_z_spacing = lambda: 1.0
dummy_well.get_yx_spacing = lambda: (2.0, 3.0)
ct = dummy_well.get_coordinate_transformations(
Expand Down Expand Up @@ -280,7 +280,7 @@ def test_get_coordiante_transformations_3d(dummy_well):
]


def test_get_coordiante_transformations_2d(dummy_well):
def test_get_coordinate_transformations_2d(dummy_well):
dummy_well.get_z_spacing = lambda: None
dummy_well.get_yx_spacing = lambda: (2.0, 3.0)
ct = dummy_well.get_coordinate_transformations(max_layer=2, yx_binning=1, ndim=3)
Expand Down

0 comments on commit 1d63fe6

Please sign in to comment.