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
21
Issues
21
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
b45c2ee6
Commit
b45c2ee6
authored
Mar 13, 2019
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cython API: cleaner column rewriting API
parent
6afd1294
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
python/obitools3/commands/import.pyx
python/obitools3/commands/import.pyx
+2
-1
python/obitools3/dms/view/view.pxd
python/obitools3/dms/view/view.pxd
+2
-1
python/obitools3/dms/view/view.pyx
python/obitools3/dms/view/view.pyx
+6
-2
No files found.
python/obitools3/commands/import.pyx
View file @
b45c2ee6
...
...
@@ -237,7 +237,8 @@ def run(config):
dcols
[
tag
]
=
(
view
.
rewrite_column_with_diff_attributes
(
old_column
.
name
,
new_data_type
=
new_type
,
new_nb_elements_per_line
=
new_nb_elements_per_line
,
new_elements_names
=
new_elements_names
),
new_elements_names
=
new_elements_names
,
rewrite_last_line
=
False
),
value_obitype
)
# Update the dictionary:
...
...
python/obitools3/dms/view/view.pxd
View file @
b45c2ee6
...
...
@@ -32,7 +32,8 @@ cdef class View(OBIWrapper):
object
column_name
,
obitype_t
new_data_type
=*
,
index_t
new_nb_elements_per_line
=*
,
list
new_elements_names
=*
)
list
new_elements_names
=*
,
bint
rewrite_last_line
=*
)
cpdef
Line_selection
new_selection
(
self
,
list
lines
=*
)
...
...
python/obitools3/dms/view/view.pyx
View file @
b45c2ee6
...
...
@@ -267,13 +267,17 @@ cdef class View(OBIWrapper) :
object
column_name
,
obitype_t
new_data_type
=<
obitype_t
>
OBI_VOID
,
index_t
new_nb_elements_per_line
=
0
,
list
new_elements_names
=
None
)
:
list
new_elements_names
=
None
,
bint
rewrite_last_line
=
False
)
:
cdef
Column
old_column
cdef
Column
new_column
cdef
index_t
length
=
len
(
self
)
-
1
cdef
index_t
length
=
len
(
self
)
# TODO because last line triggered error that triggered rewriting, but needs a cleaner way, or at least good documentation
cdef
column_name_b
=
tobytes
(
column_name
)
if
rewrite_last_line
is
False
:
length
-=
1
if
not
self
.
active
()
:
raise
OBIDeactivatedInstanceError
()
...
...
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