Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OBITools3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
872071b1
Commit
872071b1
authored
May 02, 2016
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed a list of column pointers kept in the OBIView class that was not
really needed
parent
32cc8968
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
48 deletions
+6
-48
python/obitools3/obidms/_obidms.pxd
python/obitools3/obidms/_obidms.pxd
+0
-1
python/obitools3/obidms/_obidms.pyx
python/obitools3/obidms/_obidms.pyx
+6
-47
No files found.
python/obitools3/obidms/_obidms.pxd
View file @
872071b1
...
...
@@ -45,7 +45,6 @@ cdef class OBIView:
cdef
str
name
cdef
str
comments
cdef
dict
columns
cdef
dict
columns_pp
# TODO this dict might be unnecessary
cdef
OBIDMS
dms
cpdef
delete_column
(
self
,
str
column_name
)
...
...
python/obitools3/obidms/_obidms.pyx
View file @
872071b1
...
...
@@ -84,7 +84,7 @@ cdef class OBIDMS_column :
cdef
OBIDMS_column_p
column_p
cdef
OBIDMS_column_p
*
column_pp
column_pp
=
<
OBIDMS_column_p
*>
PyCapsule_GetPointer
(((
view
.
columns_pp
)[
column_name
]),
NULL
)
# or use C function
column_pp
=
obi_view_get_pointer_on_column_in_view
(
view
.
pointer
,
str2bytes
(
column_name
))
column_p
=
column_pp
[
0
]
# TODO ugly cython dereferencing but can't find better
# Fill structure
...
...
@@ -243,10 +243,8 @@ cdef class OBIView :
cdef
str
col_name
cdef
OBIDMS_column
column
cdef
OBIDMS_column_p
column_p
cdef
OBIDMS_column_p
*
column_pp
cdef
OBIDMS_column_header_p
header
cdef
index_t
*
line_selection_p
cdef
object
col_capsule
self
.
dms
=
dms
...
...
@@ -280,18 +278,13 @@ cdef class OBIView :
# go through columns to build list and open python object (TODO make separate function?)
self
.
columns
=
{}
self
.
columns_pp
=
{}
i
=
0
while
i
<
view
.
column_count
:
column_pp
=
<
OBIDMS_column_p
*>
((
view
.
columns
)
+
i
)
column_p
=
<
OBIDMS_column_p
>
(
view
.
columns
)[
i
]
header
=
(
column_p
).
header
col_name
=
bytes2str
(
header
.
name
)
col_capsule
=
PyCapsule_New
(
column_pp
,
NULL
,
NULL
)
# TODO discuss
(
self
.
columns_pp
)[
col_name
]
=
col_capsule
col_name
=
bytes2str
(
header
.
name
)
subclass
=
OBIDMS_column
.
get_subclass_type
(
column_p
)
self
.
columns
[
col_name
]
=
subclass
(
self
,
col_name
)
...
...
@@ -319,7 +312,6 @@ cdef class OBIView :
cdef
Obiview_p
view
cdef
OBIDMS_column
column
cdef
OBIDMS_column_p
column_p
cdef
OBIDMS_column_p
*
column_pp
cdef
OBIDMS_column_header_p
header
cdef
str
column_n
...
...
@@ -330,18 +322,7 @@ cdef class OBIView :
# Update the dictionaries of column pointers and column objects, and update pointers in column objects (make function?):
(
self
.
columns
).
pop
(
column_name
)
(
self
.
columns_pp
).
pop
(
column_name
)
i
=
0
while
i
<
view
.
column_count
:
column_pp
=
<
OBIDMS_column_p
*>
((
view
.
columns
)
+
i
)
column_p
=
<
OBIDMS_column_p
>
(
view
.
columns
)[
i
]
header
=
(
column_p
).
header
col_name
=
bytes2str
(
header
.
name
)
col_capsule
=
PyCapsule_New
(
column_pp
,
NULL
,
NULL
)
(
self
.
columns_pp
)[
col_name
]
=
col_capsule
i
+=
1
for
column_n
in
self
.
columns
:
(
self
.
columns
[
column_n
]).
update_pointer
()
...
...
@@ -393,13 +374,8 @@ cdef class OBIView :
str2bytes
(
comments
),
create
)
<
0
)
:
raise
Exception
(
"Problem adding a column in a view"
)
#
Store
the column pointer
#
Get
the column pointer
column_pp
=
obi_view_get_pointer_on_column_in_view
(
self
.
pointer
,
column_name_b
)
if
column_pp
==
NULL
:
raise
Exception
(
"Problem getting a column in a view"
)
col_capsule
=
PyCapsule_New
(
column_pp
,
NULL
,
NULL
)
# TODO
(
self
.
columns_pp
)[
column_name
]
=
col_capsule
# Open and store the subclass
column_p
=
column_pp
[
0
]
# TODO ugly cython dereferencing
...
...
@@ -474,7 +450,6 @@ cdef class OBIView_NUC_SEQS(OBIView):
cdef
str
col_name
cdef
OBIDMS_column
column
cdef
OBIDMS_column_p
column_p
cdef
OBIDMS_column_p
*
column_pp
cdef
OBIDMS_column_header_p
header
cdef
index_t
*
line_selection_p
...
...
@@ -511,18 +486,14 @@ cdef class OBIView_NUC_SEQS(OBIView):
# go through columns to build list and open python object (TODO make separate function?)
self
.
columns
=
{}
self
.
columns_pp
=
{}
i
=
0
while
i
<
view
.
column_count
:
column_pp
=
<
OBIDMS_column_p
*>
((
view
.
columns
)
+
i
)
column_p
=
<
OBIDMS_column_p
>
(
view
.
columns
)[
i
]
header
=
(
column_p
).
header
col_name
=
bytes2str
(
header
.
name
)
col_capsule
=
PyCapsule_New
(
column_pp
,
NULL
,
NULL
)
# TODO discuss
(
self
.
columns_pp
)[
col_name
]
=
col_capsule
subclass
=
OBIDMS_column
.
get_subclass_type
(
column_p
)
self
.
columns
[
col_name
]
=
subclass
(
self
,
col_name
)
...
...
@@ -539,7 +510,6 @@ cdef class OBIView_NUC_SEQS(OBIView):
cdef
Obiview_p
view
cdef
OBIDMS_column
column
cdef
OBIDMS_column_p
column_p
cdef
OBIDMS_column_p
*
column_pp
cdef
OBIDMS_column_header_p
header
cdef
str
column_n
...
...
@@ -553,18 +523,7 @@ cdef class OBIView_NUC_SEQS(OBIView):
# Update the dictionaries of column pointers and column objects, and update pointers in column objects (make function?):
(
self
.
columns
).
pop
(
column_name
)
(
self
.
columns_pp
).
pop
(
column_name
)
i
=
0
while
i
<
view
.
column_count
:
column_pp
=
<
OBIDMS_column_p
*>
((
view
.
columns
)
+
i
)
column_p
=
<
OBIDMS_column_p
>
(
view
.
columns
)[
i
]
header
=
(
column_p
).
header
col_name
=
bytes2str
(
header
.
name
)
col_capsule
=
PyCapsule_New
(
column_pp
,
NULL
,
NULL
)
(
self
.
columns_pp
)[
col_name
]
=
col_capsule
i
+=
1
for
column_n
in
self
.
columns
:
(
self
.
columns
[
column_n
]).
update_pointer
()
...
...
@@ -572,7 +531,7 @@ cdef class OBIView_NUC_SEQS(OBIView):
def
__getitem__
(
self
,
object
item
)
:
if
type
(
item
)
==
str
:
return
(
self
.
columns
)[
item
]
elif
type
(
item
)
==
int
:
# TODO int?
elif
type
(
item
)
==
int
:
# TODO int?
(range problem)
return
OBI_Nuc_Seq_Stored
(
self
,
item
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment