Skip to content

Commit a266545

Browse files
committed
bug fix
test on python 2
1 parent 6799ab9 commit a266545

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

rbp_setup_tools/code_generation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Created by Soldoskikh Kirill.
3-
# Copyright © 2018 Intuition. All rights reserved.
3+
# Copyright 2018 Intuition. All rights reserved.
44
#
55

66
# Generates templated source code for multiple types.

rbp_setup_tools/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Created by Soldoskikh Kirill.
3-
# Copyright © 2018 Intuition. All rights reserved.
3+
# Copyright 2018 Intuition. All rights reserved.
44
#
55

66
TYPES = [ 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t','uint96_t', 'uint128_t',

redblackpy/cython_source/__dtype_tree_processing.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ cdef void __erase_node_{DTYPE}(rb_tree_ptr& index, key) except*:
4040
index.erase(node)
4141

4242

43-
cdef inline void __set_value_{DTYPE}(node_ptr node, {DTYPE} value) nogil:
43+
cdef inline void __set_value_{DTYPE}(node_ptr node, {DTYPE} value) nogil except*:
4444

4545
if deref(node).value != NULL:
4646
(<{DTYPE}*>deref(node).value)[0] = value
@@ -50,7 +50,7 @@ cdef inline void __set_value_{DTYPE}(node_ptr node, {DTYPE} value) nogil:
5050
(<{DTYPE}*>deref(node).value)[0] = value
5151

5252

53-
cdef inline void __dealloc_value_{DTYPE}(node_ptr node) nogil:
53+
cdef inline void __dealloc_value_{DTYPE}(node_ptr node) nogil except*:
5454

5555
if deref(node).value != NULL:
5656
free(deref(node).value)

redblackpy/cython_source/object_tree_processing.pxi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ cdef inline object __deref_value_ptr_object(node_ptr node):
77
return <object>deref(node).value
88

99

10-
cdef inline void __insert_node_object(rb_tree_ptr& index, key, value):
10+
cdef inline void __insert_node_object(rb_tree_ptr& index, key, value) except*:
1111

1212
index.insert( rb_node_valued( to_c_pyobject(key),
1313
to_c_pyobject(value).data ) )
1414

1515

1616
cdef inline void __insert_node_by_ptr_object( rb_tree_ptr& index, node_ptr& position,
17-
key, value ):
17+
key, value ) except*:
1818

1919
index.insert( position, rb_node_valued( to_c_pyobject(key),
2020
to_c_pyobject(value).data ) )
2121

2222

23-
cdef void __erase_node_object(rb_tree_ptr& index, key):
23+
cdef void __erase_node_object(rb_tree_ptr& index, key) except*:
2424

2525
cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
2626
cdef node_ptr node = index.search(c_key)
@@ -33,12 +33,12 @@ cdef void __erase_node_object(rb_tree_ptr& index, key):
3333
index.erase(node)
3434

3535

36-
cdef void __set_value_object(node_ptr node, value):
36+
cdef void __set_value_object(node_ptr node, value) except*:
3737

3838
Py_XDECREF(<PyObject*>deref(node).value)
3939
deref(node).value = to_c_pyobject(value).data
4040

4141

42-
cdef inline void __dealloc_value_object(node_ptr node):
42+
cdef inline void __dealloc_value_object(node_ptr node) except*:
4343

4444
Py_XDECREF(<PyObject*>deref(node).value)

redblackpy/series/tree_series.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,9 @@ cdef class Series:
808808
"""
809809
Initialize Series object from pandas.Series.
810810
"""
811-
cdef Series result = Series( dtype=str(pd_series.dtype),
811+
cdef Series result = Series( index=pd_series.index,
812+
values=pd_series.data,
813+
dtype=str(pd_series.dtype),
812814
interpolate=interpolate,
813815
extrapolate=extrapolate,
814816
arithmetic=arithmetic )

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Created by Soldoskikh Kirill.
3-
# Copyright © 2018 Intuition. All rights reserved.
3+
# Copyright 2018 Intuition. All rights reserved.
44
#
55

66
import os
@@ -100,7 +100,7 @@
100100
ext_modules = cythonize(ext_modules),
101101
version='0.1.0.0',
102102
author='Solodskikh Kirill',
103-
author_email='solodskihkirill@gmail.com',
103+
author_email='hypo@intuition.engineering',
104104
maintainer='Intuition',
105105
maintainer_email='dev@intuition.engineering',
106106
install_requires=['cython>=0.27', 'pandas'],

0 commit comments

Comments
 (0)