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
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ jobs:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- run: |
uv run ruff check .
uv run ruff check

Typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- run: |
uv run ty check

Test:
runs-on: ubuntu-latest
Expand Down
18 changes: 9 additions & 9 deletions examples/JupyterServer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "f1562cea-288f-4817-8ca7-606cd104630e",
"id": "3f95a08d",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -13,7 +13,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "db2277b1",
"id": "25f7dab3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -26,13 +26,13 @@
{
"cell_type": "code",
"execution_count": null,
"id": "2e2c753f-fb13-4d54-b031-10cf5865e138",
"id": "caf312ad",
"metadata": {},
"outputs": [],
"source": [
"from dataclasses import dataclass\n",
"\n",
"from clodius.tiles.cooler import tiles, tileset_info\n",
"from clodius.tiles.cooler import tiles, tileset_info # ty:ignore[unresolved-import]\n",
"\n",
"\n",
"@dataclass\n",
Expand All @@ -54,31 +54,31 @@
{
"cell_type": "code",
"execution_count": null,
"id": "d2b9ae4d-85d0-4545-aeef-073ad7d0d4e9",
"id": "866266ec",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "2a69dbe9-ad50-4e98-ac3b-b05285703760",
"id": "78d4ccb4",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f4ea4dec-135f-49c7-b7ef-ff0c0ece8b45",
"id": "fb5ee4a8",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "8e571a51-4b09-4da7-8d65-af28a5cf4703",
"id": "3f3151e0",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -105,4 +105,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ requires-python = ">=3.8"
urls = { homepage = "https://github.com/higlass/higlass-python" }

[dependency-groups]
dev = ["anywidget[dev]", "jupyterlab", "pytest", "ruff"]
dev = [
"anywidget[dev]>=0.9.13",
# TODO Add for typechecking after we drop 3.8 support
# "clodius>=0.20.4",
"jupyterlab>=4.3.5",
"pytest>=8.3.5",
"ruff>=0.15.4",
"ty>=0.0.19",
]

[tool.hatch.build.targets.wheel]
packages = ["src/higlass"]
Expand Down Expand Up @@ -65,5 +73,9 @@ extend-select = [
"examples/*.ipynb" = [
"F811", # redefintion
]

[tool.ty.src]
exclude = ["examples/Plugin.ipynb", "docs/conf.py", "docs/build.py"]

[tool.uv]
required-version = ">=0.10.0"
10 changes: 5 additions & 5 deletions src/higlass/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@

class _PropertiesMixin:
def properties(
self: utils.ModelT, # type: ignore
self: utils.ModelT,
inplace: bool = False,
**fields, # type: ignore
) -> utils.ModelT: # type: ignore
**fields,
) -> utils.ModelT:
"""Configures top-level properties.

Updates top-level properties for a Track, View, or Viewconf. This
Expand Down Expand Up @@ -85,10 +85,10 @@ def properties(

class _OptionsMixin:
def opts(
self: TrackT, # type: ignore
self: TrackT,
inplace: bool = False,
**options,
) -> TrackT: # type: ignore
) -> TrackT:
"""Configures options for a Track.

A convenience method to update `track.options`.
Expand Down
6 changes: 4 additions & 2 deletions src/higlass/tilesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,12 @@ def load(filepath: str | pathlib.Path) -> ClodiusTileset:


def chromsizes(filepath: str) -> ClodiusTileset:
from clodius.tiles.chromsizes import tileset_info
from clodius.tiles.chromsizes import tileset_info # ty:ignore[unresolved-import]

return ClodiusTileset(
datatype="chromsizes", tiles_impl=None, info_impl=lambda: tileset_info(filepath)
datatype="chromsizes",
tiles_impl=lambda _: {}, # chromsizes has no tiles endpoint
info_impl=lambda: tileset_info(filepath),
)


Expand Down
7 changes: 4 additions & 3 deletions test/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
)
def test_creates_correct_track(args: str | tuple, expected: hg.Track):
track_type, kwargs = (args, {}) if isinstance(args, str) else args
track = hg.track(track_type, **kwargs) # type: ignore
track = hg.track(track_type, **kwargs)
assert isinstance(track, expected) # type: ignore
assert track.type == track_type

Expand Down Expand Up @@ -227,15 +227,16 @@ class PileupTrack(hg.PluginTrack):
}

# Create and use the custom track
pileup_track = PileupTrack(data=pileup_data)
pileup_track = PileupTrack(data=pileup_data) # ty:ignore[unknown-argument]

view = hg.view((pileup_track, "top"))
uid1 = view.uid
assert view.tracks.top
assert view.tracks.top[0].plugin_url == some_url

# The .domain() function creates a copy of the view. We want to make sure
# that the plugin_url attribute of the PluginTrack is maintained
view = view.domain(x=[0, 10])
view = view.domain(x=(0, 10))
uid2 = view.uid
assert view.tracks.top[0].plugin_url == some_url

Expand Down
Loading