merge ranges.pyx + array.pyx -> base.pyx

This commit is contained in:
Christian Zimmermann 2023-05-07 21:45:41 +02:00
parent 33f7b0322d
commit e26a1622da
4 changed files with 20 additions and 13 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
build/ build/
cnorxz.egg-info/ cnorxz.egg-info/
*.so *.so
*.cpp

View file

@ -1,11 +0,0 @@
from libcpp.memory cimport shared_ptr, make_shared, dynamic_pointer_cast
from array cimport cpp_CArrayBase
cdef class Array:
cdef shared_ptr[cpp_CArrayBase[double]] cpp_array
def size(self):
return self.cpp_array.get().size()

View file

@ -2,6 +2,12 @@
from libcpp.memory cimport shared_ptr, make_shared, dynamic_pointer_cast from libcpp.memory cimport shared_ptr, make_shared, dynamic_pointer_cast
from range cimport cpp_RangeBase from range cimport cpp_RangeBase
from range_factory cimport cpp_RangeFactoryBase, cpp_CRangeFactory from range_factory cimport cpp_RangeFactoryBase, cpp_CRangeFactory
from array cimport cpp_CArrayBase
## ============
## Range
## ============
cdef class Range: cdef class Range:
cdef shared_ptr[cpp_RangeBase] cpp_range cdef shared_ptr[cpp_RangeBase] cpp_range
@ -30,3 +36,15 @@ cdef class RangeFactory:
r.cpp_range = self.cpp_rfactory.get().create() r.cpp_range = self.cpp_rfactory.get().create()
return r return r
## ===========
## Array
## ===========
cdef class Array:
cdef shared_ptr[cpp_CArrayBase[double]] cpp_array
def size(self):
return self.cpp_array.get().size()

View file

@ -58,8 +58,7 @@ if __name__ == "__main__":
setuptools.Extension( setuptools.Extension(
name = libname + ".base", name = libname + ".base",
sources = [ sources = [
"cnorxz/base/ranges.pyx", "cnorxz/base/base.pyx",
#"cnorxz/base/array.pyx",
], ],
**default_extension_args **default_extension_args
) )