Skip to content

Commit

Permalink
some more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Seher Karakuzu authored and Seher Karakuzu committed Apr 15, 2024
1 parent 6df4bfc commit 15ebb1b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ disallow_incomplete_defs = True
disallow_untyped_calls = True
disallow_untyped_decorators = True

[mypy-tiled._tests.test_protocols.py]
[mypy-tiled._tests.test_protocols]
ignore_errors = False
ignore_missing_imports = False
check_untyped_defs = True
Expand Down
2 changes: 1 addition & 1 deletion tiled/_tests/test_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


class MyArrayAdapter:
structure_family = Literal[StructureFamily.array]
structure_family: Literal[StructureFamily.array] = StructureFamily.array

def __init__(
self,
Expand Down
6 changes: 4 additions & 2 deletions tiled/adapters/protocols.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import collections.abc
from abc import abstractmethod
from typing import Any, Dict, List, Optional, Protocol, Tuple, Union
from typing import Any, Dict, List, Literal, Optional, Protocol, Tuple, Union

import pandas
import sparse
Expand All @@ -9,7 +9,7 @@
from ..server.schemas import Principal
from ..structures.array import ArrayStructure
from ..structures.awkward import AwkwardStructure
from ..structures.core import Spec
from ..structures.core import Spec, StructureFamily
from ..structures.sparse import SparseStructure
from ..structures.table import TableStructure
from .type_alliases import JSON, Filters, NDSlice, Scopes
Expand All @@ -32,6 +32,8 @@ def structure(self) -> None:


class ArrayAdapter(BaseAdapter, Protocol):
structure_family: Literal[StructureFamily.array]

@abstractmethod
def structure(self) -> ArrayStructure:
pass
Expand Down
5 changes: 2 additions & 3 deletions tiled/adapters/type_alliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
if sys.version_info < (3, 10):
from enum import Enum

class EllipsisType(Enum):
class ellipsis(Enum):
Ellipsis = "..."

Ellipsis = ellipsis.Ellipsis
EllipsisType = type(Ellipsis)
EllipsisType = ellipsis.Ellipsis
else:
from types import EllipsisType

Expand Down

0 comments on commit 15ebb1b

Please sign in to comment.