Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloprobst committed Nov 6, 2024
1 parent 7dc9060 commit 8c762d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
12 changes: 6 additions & 6 deletions hyperon_das/tokenizers/dict_query_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
from typing import Any, Callable, Type, TypeAlias

from hyperon_das.tokenizers.elements import (
TOKENS_DELIMITER,
AndOperator,
ElementBuilder,
Node,
Variable,
Link,
OrOperator,
AndOperator,
Node,
NotOperator,
TOKENS_DELIMITER,
OrOperator,
Variable,
)


Expand Down Expand Up @@ -188,6 +188,6 @@ def untokenize(query_tokens: str) -> Query:
if to_query_callback := DictQueryTokenizer.to_query_mapping.get(type(element)):
query = to_query_callback(element)
if cursor != len(tokens):
raise ValueError(f"Wrong elements count")
raise ValueError("Wrong elements count")
return query
raise ValueError(f"Unsupported sequence of tokens: {tokens[cursor:]}")
2 changes: 1 addition & 1 deletion hyperon_das/tokenizers/elements.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
import dataclasses
from abc import ABC, abstractmethod
from typing import Any, Type, TypeAlias

TOKENS_DELIMITER = " "
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_dict_query_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import unittest

import pytest

from hyperon_das.tokenizers.dict_query_tokenizer import DictQueryTokenizer


Expand Down
12 changes: 7 additions & 5 deletions tests/unit/test_elements.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import unittest

import pytest

from hyperon_das.tokenizers.elements import (
Node,
Variable,
Link,
OrOperator,
AndOperator,
NotOperator,
ElementBuilder,
Link,
Node,
NotOperator,
OrOperator,
Variable,
)


Expand Down

0 comments on commit 8c762d5

Please sign in to comment.