Description
LocalLayerRepository.__str__ returns a string with an unclosed parenthesis. Every error message raised when using a local kernel (from _validate_layer, _get_kernel_layer, etc.) will contain a broken diagnostic string.
Steps to reproduce
from pathlib import Path
from kernels import LocalLayerRepository
repo = LocalLayerRepository(repo_path=Path("/tmp/my-kernel"), layer_name="MyLayer")
print(str(repo))
prints: /tmp/my-kernel (layer MyLayer
expected: /tmp/my-kernel (layer MyLayer)
Expected behavior
The string should end with ) to close the opening parenthesis:
/tmp/my-kernel (layer MyLayer)
This is consistent with how LayerRepository and LockedLayerRepository format their str output.
Environment
- kernels version: latest (main)
- Python version: 3.11
- PyTorch version: N/A (pure Python bug, no GPU needed)
- CUDA version: N/A
- GPU model: N/A
- OS: Windows 11
- If using the Nix builder, output of
nix-shell -p nix-info --run "nix-info -m": N/A
Additional context
Root cause: layer.py line 166.
Buggy: return f"{self._repo_path} (layer {self.layer_name}"
Fixed: return f"{self._repo_path} (layer {self.layer_name})"
The other two repository classes (LayerRepository line 115, LockedLayerRepository line 226) do not have this issue. One character fix — happy to open a PR if helpful.
Description
LocalLayerRepository.__str__returns a string with an unclosed parenthesis. Every error message raised when using a local kernel (from_validate_layer,_get_kernel_layer, etc.) will contain a broken diagnostic string.Steps to reproduce
from pathlib import Path
from kernels import LocalLayerRepository
repo = LocalLayerRepository(repo_path=Path("/tmp/my-kernel"), layer_name="MyLayer")
print(str(repo))
prints:
/tmp/my-kernel(layerMyLayerexpected:
/tmp/my-kernel(layerMyLayer)Expected behavior
The string should end with
)to close the opening parenthesis:/tmp/my-kernel(layerMyLayer)This is consistent with how LayerRepository and LockedLayerRepository format their str output.
Environment
nix-shell -p nix-info --run "nix-info -m": N/AAdditional context
Root cause:
layer.pyline 166.Buggy: return f"
{self._repo_path}(layer{self.layer_name}"Fixed: return f"
{self._repo_path}(layer{self.layer_name})"The other two repository classes (LayerRepository line 115, LockedLayerRepository line 226) do not have this issue. One character fix — happy to open a PR if helpful.