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
4 changes: 2 additions & 2 deletions src/semble/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from semble.index import SembleIndex
from semble.types import Chunk, EmbeddingMatrix, Encoder, IndexStats, SearchMode, SearchResult
from semble.version import __version__, __version_triple__
from semble.version import __version__

__all__ = [
"SembleIndex",
"Chunk",
"EmbeddingMatrix",
"Encoder",
"IndexStats",
"SearchMode",
"SearchResult",
"SembleIndex",
"__version__",
]
2 changes: 0 additions & 2 deletions src/semble/index/create.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import contextlib
from pathlib import Path

Expand Down
2 changes: 0 additions & 2 deletions src/semble/index/dense.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import numpy as np
import numpy.typing as npt
from huggingface_hub.utils.tqdm import disable_progress_bars
Expand Down
2 changes: 0 additions & 2 deletions src/semble/index/sparse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import annotations

import contextlib
from pathlib import Path

Expand Down
5 changes: 1 addition & 4 deletions src/semble/mcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,7 @@ def __init__(self, model: Encoder) -> None:
async def get(self, source: str, ref: str | None = None) -> SembleIndex:
"""Return an index for the requested source, building and caching it on first access."""
is_git = _is_git_url(source)
if is_git:
cache_key = f"{source}@{ref}" if ref else source
else:
cache_key = str(Path(source).resolve())
cache_key = (f"{source}@{ref}" if ref else source) if is_git else str(Path(source).resolve())

if cache_key not in self._tasks:
if is_git:
Expand Down
4 changes: 2 additions & 2 deletions src/semble/tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ def _split_identifier(token: str) -> list[str]:
lower = token.lower()
parts: list[str] = []

# snake_case splitting
if "_" in token:
# snake_case splitting
parts = [p for p in lower.split("_") if p]
else:
# camelCase / PascalCase splitting
parts = [m.lower() for m in _CAMEL_RE.findall(token)]

if len(parts) >= 2:
return [lower] + parts
return [lower, *parts]
return [lower]


Expand Down