Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ repos:
- id: check-yaml
- id: detect-private-key
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.25.0"
rev: "v2.26.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/citation-file-format/cffconvert
rev: b6045d78aac9e02b039703b030588d54d53262ac
hooks:
- id: validate-cff
- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
exclude: |
Expand All @@ -39,7 +39,7 @@ repos:
- id: yamllint
exclude: pre-commit-config.yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.19"
rev: "v0.16.1"
hooks:
- id: ruff-format
- id: ruff-check
Expand Down
2 changes: 1 addition & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
sys.path.insert(0, basedir)

project = "OME-IRIS"
copyright = "2026, OME-IRIS contributors" # noqa: A001
copyright = "2026, OME-IRIS contributors"
author = "OME-IRIS contributors"

extensions = [
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ version_scheme = "guess-next-dev"
local_scheme = "node-and-date"
write_to = "src/OME_IRIS/_version.py"

[tool.ruff]
# OME_IRIS is an intentional uppercase package name mirrored by a lowercase
# `ome_iris` alias (see [tool.setuptools] packages above).
lint.ignore = [ "N999" ]
# Declare both names explicitly: isort's directory-based first-party
# detection is filesystem case-sensitivity dependent, and `ome_iris` only
# resolves as a real path on case-insensitive filesystems (e.g. macOS).
lint.isort.known-first-party = [ "OME_IRIS", "ome_iris" ]

[tool.pytest]
ini_options.pythonpath = [ "src" ]
ini_options.addopts = [ "-q" ]
2 changes: 1 addition & 1 deletion src/OME_IRIS/clean.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from pathlib import Path
import shutil
from pathlib import Path


def clean_local_data(data_dir: Path) -> None:
Expand Down
7 changes: 3 additions & 4 deletions src/OME_IRIS/datasets.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
from __future__ import annotations

from dataclasses import dataclass, field
import hashlib
import json
from pathlib import Path
import re
from dataclasses import dataclass, field
from pathlib import Path
from typing import Any
from urllib.request import urlopen

from PIL import Image
import yaml
from PIL import Image

from OME_IRIS.fetch import _download, _parse_github_tree_url


PRESET_SUBSETS: dict[str, dict[str, Any]] = {
"tiny": {"images": 5},
"small": {"images": 20},
Expand Down
15 changes: 6 additions & 9 deletions src/OME_IRIS/fetch.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
from __future__ import annotations

import argparse
from dataclasses import dataclass, field
import hashlib
import json
from pathlib import Path
import shutil
import subprocess
import tarfile
import tempfile
import zipfile
from dataclasses import dataclass, field
from pathlib import Path
from urllib.parse import urlparse
from urllib.request import urlopen, urlretrieve
import zipfile

from OME_IRIS.rocrate import write_rocrate_metadata
import yaml

from OME_IRIS.rocrate import write_rocrate_metadata


@dataclass
class FetchResult:
Expand Down Expand Up @@ -91,11 +92,7 @@ def _extract_archive(
suffixes = "".join(archive_path.suffixes).lower()
if suffixes.endswith(".zip"):
fmt = "zip"
elif (
suffixes.endswith(".tar.gz")
or suffixes.endswith(".tgz")
or suffixes.endswith(".tar")
):
elif suffixes.endswith((".tar.gz", ".tgz", ".tar")):
fmt = "tar"
else:
raise ValueError(f"Unable to infer archive format for {archive_path.name}")
Expand Down
3 changes: 1 addition & 2 deletions src/OME_IRIS/scaffold.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from __future__ import annotations

import re
from dataclasses import dataclass
from pathlib import Path
import re

import yaml


KNOWN_FORMATS = {
".csv": "csv",
".parquet": "parquet",
Expand Down
2 changes: 1 addition & 1 deletion src/OME_IRIS/verify.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

import argparse
from dataclasses import dataclass
import hashlib
from dataclasses import dataclass
from pathlib import Path

import yaml
Expand Down
2 changes: 1 addition & 1 deletion tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import json
from pathlib import Path

from PIL import Image
import yaml
from PIL import Image

from OME_IRIS import datasets
from ome_iris import datasets as lower_datasets
Expand Down
Loading