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/
|
build/
|
||||||
cnorxz.egg-info/
|
cnorxz.egg-info/
|
||||||
*.so
|
*.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 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
|
||||||
|
@ -29,4 +35,16 @@ cdef class RangeFactory:
|
||||||
r = Range()
|
r = Range()
|
||||||
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()
|
||||||
|
|
||||||
|
|
3
setup.py
3
setup.py
|
@ -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
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue