Skip to content

Commit

Permalink
q
Browse files Browse the repository at this point in the history
  • Loading branch information
kszucs committed Jul 30, 2024
1 parent 490004f commit a0a744f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 44 deletions.
4 changes: 1 addition & 3 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
from __future__ import annotations

import multiprocessing
import os
import shutil
from pathlib import Path

import Cython.Compiler.Options
from Cython.Build import cythonize
from Cython.Distutils import build_ext
from setuptools import Distribution, Extension
from setuptools import Distribution

Cython.Compiler.Options.cimport_from_pyx = True

SOURCE_DIR = Path("koerce")
BUILD_DIR = Path("cython_build")


# extension_modules = get_extension_modules()
cythonized_modules = cythonize(
[
"koerce/patterns.py",
Expand Down
80 changes: 39 additions & 41 deletions koerce/tests/test_patterns.py
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
from __future__ import annotations
import pytest

import sys
from dataclasses import dataclass
from typing import (
Annotated,
Any,
Generic,
List,
Literal,
Optional,
Sequence,
TypeVar,
Union,
)

import pytest

from koerce.builders import Call, Deferred, Variable
from koerce.patterns import (
NoMatch,
AllOf,
AnyOf,
Anything,
Nothing,
IdenticalTo,
AsType,
Capture,
CoercedTo,
CoercionError,
DictOf,
EqualTo,
InstanceOf,
LazyInstanceOf,
GenericCoercedTo,
GenericInstanceOf,
GenericInstanceOf1,
Replace,
GenericInstanceOf2,
GenericInstanceOfN,
SomeChunksOf,
Option,
ObjectOf,
IdenticalTo,
If,
InstanceOf,
IsIn,
LazyInstanceOf,
ListOf,
MappingOf,
NoMatch,
NoneOf,
Not,
Nothing,
ObjectOf,
ObjectOfX,
Option,
Pattern,
SomeOf,
ListOf,
PatternList,
Not,
Replace,
SequenceOf,
AnyOf,
If,
AllOf,
SomeChunksOf,
SomeOf,
TupleOf,
TypeOf,
IsIn,
AsType,
GenericCoercedTo,
pattern,
CoercedTo,
TupleOf,
DictOf,
CoercionError,
Capture,
)
from koerce.builders import Variable, Call, Deferred
from dataclasses import dataclass
from typing import (
TypeVar,
Generic,
Any,
Literal,
Sequence,
Optional,
Union,
List,
Annotated,
)
from koerce.sugar import match

Expand Down Expand Up @@ -347,10 +349,6 @@ def __init__(self, value, dtype):
def dtype(self) -> T:
return self._dtype

@property
def shape(self) -> DataShape:
return Scalar()

def __eq__(self, other):
return (
type(self) is type(other)
Expand Down

0 comments on commit a0a744f

Please sign in to comment.