From a0a744f612a9822f9d32c2546045cabbc112f2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kriszti=C3=A1n=20Sz=C5=B1cs?= Date: Tue, 30 Jul 2024 12:33:35 +0200 Subject: [PATCH] q --- build.py | 4 +- koerce/tests/test_patterns.py | 80 +++++++++++++++++------------------ 2 files changed, 40 insertions(+), 44 deletions(-) diff --git a/build.py b/build.py index cbdc465..04a0e2b 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,5 @@ from __future__ import annotations -import multiprocessing import os import shutil from pathlib import Path @@ -8,7 +7,7 @@ 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 @@ -16,7 +15,6 @@ BUILD_DIR = Path("cython_build") -# extension_modules = get_extension_modules() cythonized_modules = cythonize( [ "koerce/patterns.py", diff --git a/koerce/tests/test_patterns.py b/koerce/tests/test_patterns.py index 4233aa3..bf49781 100644 --- a/koerce/tests/test_patterns.py +++ b/koerce/tests/test_patterns.py @@ -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 @@ -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)