Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OBITools3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
OBITools
OBITools3
Commits
11a0945a
Commit
11a0945a
authored
Aug 28, 2020
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
obi cat: fixed open file descriptor leak and switch to version 3.0.0b34
parent
f23c40c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
cat.pyx
python/obitools3/commands/cat.pyx
+12
-6
version.py
python/obitools3/version.py
+1
-1
No files found.
python/obitools3/commands/cat.pyx
View file @
11a0945a
...
...
@@ -48,9 +48,9 @@ def run(config):
logger("info", "obi cat")
# Open the views to concatenate
iview_list = []
# Check the views to concatenate
idms_list = []
iview_list = []
total_len = 0
remove_qual = False
remove_rev_qual = False
...
...
@@ -68,8 +68,9 @@ def run(config):
if REVERSE_QUALITY_COLUMN not in i_view: # same as above for reverse quality
remove_rev_qual = True
total_len += len(i_view)
iview_list.append(i_view)
idms_list.append(i_dms)
iview_list.append(i_view.name)
i_view.close()
# Open the output: only the DMS
output = open_uri(config['obi']['outputURI'],
...
...
@@ -98,8 +99,10 @@ def run(config):
# Initialize multiple elements columns
if type(output_0)==BufferedWriter:
dict_cols = {}
for v in iview_list:
for v_uri in config["cat"]["views_to_cat"]:
v = open_uri(v_uri)[1]
for coln in v.keys():
col = v[coln]
if v[coln].nb_elements_per_line > 1:
if coln not in dict_cols:
dict_cols[coln] = {}
...
...
@@ -109,6 +112,7 @@ def run(config):
else:
dict_cols[coln]['eltnames'] = set(v[coln].elements_names + list(dict_cols[coln]['eltnames']))
dict_cols[coln]['nbelts'] = len(dict_cols[coln]['eltnames'])
v.close()
for coln in dict_cols:
Column.new_column(o_view, coln, dict_cols[coln]['obitype'],
nb_elements_per_line=dict_cols[coln]['nbelts'], elements_names=list(dict_cols[coln]['eltnames']))
...
...
@@ -120,7 +124,8 @@ def run(config):
pb = None
i = 0
for v in iview_list:
for v_uri in config["cat"]["views_to_cat"]:
v = open_uri(v_uri)[1]
for entry in v:
PyErr_CheckSignals()
if pb is not None:
...
...
@@ -131,6 +136,7 @@ def run(config):
else:
o_view[i] = entry
i+=1
v.close()
# Deletes quality columns if needed
if type(output_0)!=BufferedWriter:
...
...
@@ -145,7 +151,7 @@ def run(config):
# Save command config in DMS comments
command_line = " ".join(sys.argv[1:])
o_view.write_config(config, "cat", command_line, input_dms_name=[d.name for d in idms_list], input_view_name=[v
.name for v
in iview_list])
o_view.write_config(config, "cat", command_line, input_dms_name=[d.name for d in idms_list], input_view_name=[v
name for vname
in iview_list])
o_dms.record_command_line(command_line)
#print("\n\nOutput view:\n````````````", file=sys.stderr)
...
...
python/obitools3/version.py
View file @
11a0945a
major
=
3
minor
=
0
serial
=
'0b3
3
'
serial
=
'0b3
4
'
version
=
"
%
d.
%
d.
%
s"
%
(
major
,
minor
,
serial
)
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