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
23
Issues
23
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
50b292b4
Commit
50b292b4
authored
Jul 26, 2020
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
obi import: added --space-priority option to import a view line by line
parent
24a737aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
import.pyx
python/obitools3/commands/import.pyx
+12
-4
No files found.
python/obitools3/commands/import.pyx
View file @
50b292b4
...
...
@@ -77,6 +77,11 @@ def addOptions(parser):
help="Do a first readthrough of the dataset if it contains huge dictionaries (more than 100 keys) for "
"a much faster import. This option is not recommended and will slow down the import in any other case.")
group.add_argument('--space-priority',
action="store_true", dest="import:space_priority",
default=False,
help="If importing a view into another DMS, do it by importing each line, saving disk space if the original view "
"has a line selection associated.")
def run(config):
...
...
@@ -142,7 +147,7 @@ def run(config):
else:
v = None
if config['obi']['taxdump'] or
isinstance(input[1], View
):
if config['obi']['taxdump'] or
(isinstance(input[1], View) and not config['import']['space_priority']
):
dms_only=True
else:
dms_only=False
...
...
@@ -170,12 +175,15 @@ def run(config):
logger("info", "Done.")
return
# If importing a view between two DMS, use C API
if isinstance(input[1], View):
# If importing a view between two DMS
and not wanting to save space if line selection in original view
, use C API
if isinstance(input[1], View)
and not config['import']['space_priority']
:
if obi_import_view(input[0].name_with_full_path, o_dms.name_with_full_path, input[1].name, tobytes((config['obi']['outputURI'].split('/'))[-1])) < 0 :
input[0].close(force=True)
output[0].close(force=True)
raise Exception("Error importing a view in a DMS")
o_dms.record_command_line(" ".join(sys.argv[1:]))
o_dms.close()
input[0].close(force=True)
output[0].close(force=True)
logger("info", "Done.")
return
...
...
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