Skip to content

Commit dadf54b

Browse files
committed
Merge branch 'develop'
2 parents 602bcea + 6f5a89f commit dadf54b

File tree

11 files changed

+117
-103
lines changed

11 files changed

+117
-103
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
3+
exclude: ^.*\.lock$
34
repos:
45
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.4.0
6+
rev: v5.0.0
67
hooks:
78
- id: trailing-whitespace
89
- id: end-of-file-fixer
9-
- id: check-added-large-files
1010
- repo: https://github.com/python-poetry/poetry
11-
rev: 1.4.0
11+
rev: 1.8.0
1212
hooks:
1313
- id: poetry-check
1414
- id: poetry-lock
15-
- repo: https://github.com/charliermarsh/ruff-pre-commit
16-
rev: v0.0.265
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.8.1
1717
hooks:
1818
- id: ruff
19-
args: [ --fix ]
20-
- repo: https://github.com/psf/black
21-
rev: 23.3.0
22-
hooks:
23-
- id: black
19+
args: [ '--fix', '--select', 'I']
20+
- id: ruff-format

glint_mask_generator/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"""
66

77
from .maskers import (
8+
CIRThresholdMasker,
89
Masker,
9-
RGBThresholdMasker,
10-
P4MSThresholdMasker,
1110
MicasenseRedEdgeThresholdMasker,
12-
CIRThresholdMasker,
11+
P4MSThresholdMasker,
12+
RGBThresholdMasker,
1313
)
1414

1515
__all__ = [

glint_mask_generator/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Date: 2020-05-30
55
Description: Command line interface to the glint-mask-tools.
66
"""
7+
78
import os
89
import sys
910
from typing import List
@@ -12,11 +13,11 @@
1213
from tqdm import tqdm
1314

1415
from .maskers import (
16+
CIRThresholdMasker,
1517
Masker,
1618
MicasenseRedEdgeThresholdMasker,
1719
P4MSThresholdMasker,
1820
RGBThresholdMasker,
19-
CIRThresholdMasker,
2021
)
2122

2223

glint_mask_generator/glint_algorithms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Organization: Hakai Institute
44
Date: 2020-09-18
55
"""
6+
67
import math
78
from abc import ABC, abstractmethod
89
from typing import Sequence

glint_mask_generator/image_loaders.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
Organization: Hakai Institute
44
Date: 2020-09-18
55
"""
6+
67
import re
78
from abc import ABC, ABCMeta, abstractmethod
89
from functools import singledispatchmethod
910
from pathlib import Path
10-
from typing import Iterable, List, Union, TYPE_CHECKING
11+
from typing import TYPE_CHECKING, Iterable, List, Union
1112

1213
import numpy as np
1314
from PIL import Image
@@ -72,9 +73,7 @@ def save_mask(mask: np.ndarray, out_path: str):
7273
mask_img = Image.fromarray(mask, mode="L")
7374
mask_img.save(str(out_path))
7475

75-
def apply_masker(
76-
self, img_paths: Union[List[str], str], masker: "Masker"
77-
): # noqa: F821
76+
def apply_masker(self, img_paths: Union[List[str], str], masker: "Masker"): # noqa: F821
7877
img = self.load_image(img_paths)
7978
img = self.preprocess_image(img)
8079
mask = masker.algorithm(img)
@@ -105,9 +104,7 @@ class CIRLoader(SingleFileImageLoader):
105104
_bit_depth = 8
106105
_crop_size = 256
107106

108-
def apply_masker(
109-
self, img_paths: Union[List[str], str], masker: "Masker"
110-
): # noqa: F821
107+
def apply_masker(self, img_paths: Union[List[str], str], masker: "Masker"): # noqa: F821
111108
"""Compute the image mask by moving a window over the input.
112109
These CIR images are too large to be read into memory simultaneously so this
113110
image masking routine is special.

glint_mask_generator/maskers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Organization: Hakai Institute
44
Date: 2020-09-18
55
"""
6+
67
import concurrent.futures
78
import os
89
from typing import Callable, List, Optional, Sequence, Union

glint_mask_generator/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Organization: Hakai Institute
44
Date: 2020-09-18
55
"""
6+
67
from pathlib import Path
78
from typing import Iterable
89

gui/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
Organization: Hakai Institute
44
Date: 2020-09-16
55
"""
6+
67
import os
78
import sys
89
from typing import List, Sequence
910

11+
from loguru import logger
1012
from PyQt6 import QtWidgets, uic
1113
from PyQt6.QtCore import QObject, QRunnable, QThreadPool, pyqtSignal, pyqtSlot
1214
from PyQt6.QtGui import QIcon
13-
from loguru import logger
1415

1516
from glint_mask_generator import (
1617
CIRThresholdMasker,

poetry.lock

Lines changed: 89 additions & 77 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ packages = [
1414
glint-mask = 'glint_mask_generator.cli:main'
1515

1616
[tool.poetry.dependencies]
17-
python = ">=3.9,<3.12"
17+
python = ">=3.9,<3.13"
1818
numpy = "~=1.25.1"
1919
fire = "~=0.5.0"
20-
Pillow = ">=9.3,<10.4"
20+
Pillow = "~=10.4"
2121
scipy = "~=1.11.1"
22-
tqdm = ">=4.65,<4.67"
22+
tqdm = "~=4.65"
2323
loguru = "~=0.7.0"
2424
pyqt6 = "^6.4.0"
2525

@@ -29,6 +29,8 @@ pyinstaller = "^5.6.2"
2929
pre-commit = "^3.3.3"
3030
ruff = "^0.8.1"
3131

32+
[tool.ruff.lint.isort]
33+
combine-as-imports = true
3234

3335
[build-system]
3436
requires = ["poetry-core"]

0 commit comments

Comments
 (0)