merge ranges.pyx + array.pyx -> base.pyx
This commit is contained in:
parent
33f7b0322d
commit
e26a1622da
4 changed files with 20 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -2,3 +2,4 @@
|
|||
build/
|
||||
cnorxz.egg-info/
|
||||
*.so
|
||||
*.cpp
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
@ -2,6 +2,12 @@
|
|||
from libcpp.memory cimport shared_ptr, make_shared, dynamic_pointer_cast
|
||||
from range cimport cpp_RangeBase
|
||||
from range_factory cimport cpp_RangeFactoryBase, cpp_CRangeFactory
|
||||
from array cimport cpp_CArrayBase
|
||||
|
||||
|
||||
## ============
|
||||
## Range
|
||||
## ============
|
||||
|
||||
cdef class Range:
|
||||
cdef shared_ptr[cpp_RangeBase] cpp_range
|
||||
|
@ -30,3 +36,15 @@ cdef class RangeFactory:
|
|||
r.cpp_range = self.cpp_rfactory.get().create()
|
||||
return r
|
||||
|
||||
|
||||
## ===========
|
||||
## Array
|
||||
## ===========
|
||||
|
||||
cdef class Array:
|
||||
cdef shared_ptr[cpp_CArrayBase[double]] cpp_array
|
||||
|
||||
def size(self):
|
||||
return self.cpp_array.get().size()
|
||||
|
||||
|
3
setup.py
3
setup.py
|
@ -58,8 +58,7 @@ if __name__ == "__main__":
|
|||
setuptools.Extension(
|
||||
name = libname + ".base",
|
||||
sources = [
|
||||
"cnorxz/base/ranges.pyx",
|
||||
#"cnorxz/base/array.pyx",
|
||||
"cnorxz/base/base.pyx",
|
||||
],
|
||||
**default_extension_args
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue