Skip to content

Commit

Permalink
Update linter, do lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tayden committed Dec 2, 2024
1 parent 6762321 commit 610305f
Show file tree
Hide file tree
Showing 9 changed files with 807 additions and 818 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ repos:
rev: v0.5.1
hooks:
- id: ruff
args: [ --fix ]
args: [ '--fix', '--select', 'I']
- id: ruff-format
2 changes: 1 addition & 1 deletion docs/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ software.
*Still have a question?*

Get in touch by [sending us an email](mailto:[email protected])
or [file a GitHub issue](https://github.com/HakaiInstitute/kelp-o-matic/issues)
or [file a GitHub issue](https://github.com/HakaiInstitute/kelp-o-matic/issues)
3 changes: 1 addition & 2 deletions kelp_o_matic/hann.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import math
from abc import ABCMeta, abstractmethod
from typing import Type, Annotated
from typing import Annotated, Type

import numpy as np
import torch
from rasterio.windows import Window


# Implementation of paper:
# https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0229839#pone.0229839.ref007

Expand Down
6 changes: 3 additions & 3 deletions kelp_o_matic/lib.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import warnings
from pathlib import Path
from typing import Union, Optional
from typing import Optional, Union

import rasterio

from kelp_o_matic.managers import RichSegmentationManager
from kelp_o_matic.models import (
KelpRGBIPresenceSegmentationModel,
KelpRGBISpeciesSegmentationModel,
KelpRGBPresenceSegmentationModel,
KelpRGBSpeciesSegmentationModel,
MusselRGBPresenceSegmentationModel,
KelpRGBIPresenceSegmentationModel,
KelpRGBISpeciesSegmentationModel,
)


Expand Down
2 changes: 1 addition & 1 deletion kelp_o_matic/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rich.progress import Progress, SpinnerColumn, TimeElapsedColumn

from kelp_o_matic.geotiff_io import GeotiffReader, GeotiffWriter
from kelp_o_matic.hann import TorchMemoryRegister, BartlettHannKernel
from kelp_o_matic.hann import BartlettHannKernel, TorchMemoryRegister
from kelp_o_matic.models import _Model
from kelp_o_matic.utils import all_same

Expand Down
4 changes: 2 additions & 2 deletions kelp_o_matic/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import gc
from abc import ABC, abstractmethod, ABCMeta
from typing import Union, Type
from abc import ABC, ABCMeta, abstractmethod
from typing import Type, Union

import numpy as np
import torch
Expand Down
1,601 changes: 794 additions & 807 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ mkdocs = "^1.5.3"
mkdocs-material = "^9.5.2"
mkdocstrings-python = "^1.7.5"

[tool.ruff.lint.isort]
combine-as-imports = true

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion tests/test_TorchMemoryRegister.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rasterio.transform import from_origin
from rasterio.windows import Window

from kelp_o_matic.hann import TorchMemoryRegister, BartlettHannKernel, Kernel
from kelp_o_matic.hann import BartlettHannKernel, Kernel, TorchMemoryRegister


def create_dummy_tiff(
Expand Down

0 comments on commit 610305f

Please sign in to comment.