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
b408a4f6
Commit
b408a4f6
authored
Sep 22, 2016
by
Celine Mercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed file name limits to adapt to system limits + minor changes
parent
b083745f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
23 deletions
+43
-23
python/obitools3/commands/test.pyx
python/obitools3/commands/test.pyx
+22
-6
src/obiavl.h
src/obiavl.h
+2
-2
src/obidms.h
src/obidms.h
+4
-4
src/obidmscolumn.h
src/obidmscolumn.h
+1
-1
src/obiview.c
src/obiview.c
+13
-9
src/obiview.h
src/obiview.h
+1
-1
No files found.
python/obitools3/commands/test.pyx
View file @
b408a4f6
...
...
@@ -20,10 +20,8 @@ QUALITY_COLUMN = "QUALITY"
SPECIAL_COLUMNS
=
[
NUC_SEQUENCE_COLUMN
,
ID_COLUMN
,
DEFINITION_COLUMN
,
QUALITY_COLUMN
]
NAME_MAX_LEN
=
5
0
NAME_MAX_LEN
=
20
0
COL_COMMENTS_MAX_LEN
=
2048
MAX_NB_ELEMENTS_PER_LINE
=
20
ELEMENT_NAME_MAX_LEN
=
int
(
2048
/
MAX_NB_ELEMENTS_PER_LINE
)
MAX_INT
=
2147483647
# used to generate random float values
...
...
@@ -78,6 +76,14 @@ def random_unique_name(infos):
return
name
def
random_unique_element_name
(
config
,
infos
):
name
=
""
while
name
==
""
or
name
in
infos
[
'unique_names'
]
:
name
=
random_str_with_max_len
(
config
[
'test'
][
'elt_name_max_len'
])
infos
[
'unique_names'
].
append
(
name
)
return
name
def
print_test
(
config
,
sentence
):
if
config
[
'test'
][
'verbose'
]
:
print
(
sentence
)
...
...
@@ -180,10 +186,10 @@ def fill_column(config, infos, col) :
def
create_random_column
(
config
,
infos
)
:
alias
=
random
.
choice
([
''
,
random_unique_name
(
infos
)])
nb_elements_per_line
=
random
.
randint
(
1
,
MAX_NB_ELEMENTS_PER_LINE
)
nb_elements_per_line
=
random
.
randint
(
1
,
config
[
'test'
][
'maxelts'
]
)
elements_names
=
[]
for
i
in
range
(
nb_elements_per_line
)
:
elements_names
.
append
(
random_unique_
name
(
infos
))
elements_names
.
append
(
random_unique_
element_name
(
config
,
infos
))
name
=
random_unique_name
(
infos
)
infos
[
'view'
].
add_column
(
name
,
alias
=
alias
,
...
...
@@ -317,6 +323,14 @@ def addOptions(parser):
help
=
"Maximum number of lines in a column."
"Default: 10000"
)
group
.
add_argument
(
'--max_elts_per_line'
,
'-e'
,
action
=
"store"
,
dest
=
"test:maxelts"
,
metavar
=
'<MAX_ELTS_PER_LINE>'
,
default
=
20
,
type
=
int
,
help
=
"Maximum number of elements per line in a column."
"Default: 20"
)
group
.
add_argument
(
'--verbose'
,
'-v'
,
action
=
"store_true"
,
dest
=
"test:verbose"
,
default
=
False
,
...
...
@@ -333,8 +347,10 @@ def run(config):
'tests'
:
[
test_set_and_get
,
test_add_col
,
test_delete_col
,
test_col_alias
,
test_new_view
]
}
config
[
'test'
][
'elt_name_max_len'
]
=
int
((
COL_COMMENTS_MAX_LEN
-
config
[
'test'
][
'maxelts'
])
/
config
[
'test'
][
'maxelts'
])
print
(
"Initializing the DMS and the first view..."
)
ini_dms_and_first_view
(
config
,
infos
)
i
=
0
...
...
src/obiavl.h
View file @
b408a4f6
...
...
@@ -30,7 +30,7 @@
#include "encode.h"
#define MAX_NB_OF_AVLS_IN_GROUP (100)
/**< The maximum number of AVL trees in a group. // TODO discuss
#define MAX_NB_OF_AVLS_IN_GROUP (100
0
)
/**< The maximum number of AVL trees in a group. // TODO discuss
*/
#define MAX_NODE_COUNT_PER_AVL (10000000)
/**< The maximum number of nodes in an AVL tree.
* Only used to decide when to create a new AVL in a group, and to initialize the bloom filter // TODO discuss.
...
...
@@ -42,7 +42,7 @@
*/
#define AVL_MAX_DEPTH (1024)
/**< The maximum depth of an AVL tree. Used to save paths through the tree.
*/
#define AVL_MAX_NAME (
1024)
/**< The maximum length of an AVL tree name.
#define AVL_MAX_NAME (
250)
/**< The maximum length of an AVL tree name.
*/
#define AVL_GROWTH_FACTOR (2)
/**< The growth factor when an AVL tree is enlarged.
*/
...
...
src/obidms.h
View file @
b408a4f6
...
...
@@ -26,7 +26,7 @@
#include "obitypes.h"
#define OBIDMS_MAX_NAME (2
048
)
/**< The maximum length of an OBIDMS name.
#define OBIDMS_MAX_NAME (2
47
)
/**< The maximum length of an OBIDMS name.
*/
#define INDEXER_DIR_NAME "OBIBLOB_INDEXERS"
/**< The name of the Obiblob indexer directory.
*/
...
...
@@ -34,11 +34,11 @@
*/
#define TAXONOMY_DIR_NAME "TAXONOMY"
/**< The name of the taxonomy directory.
*/
#define MAX_NB_OPENED_COLUMNS (100)
/**< The maximum number of columns open at the same time.
#define MAX_NB_OPENED_COLUMNS (100
0
)
/**< The maximum number of columns open at the same time.
*/
#define MAX_NB_OPENED_INDEXERS (100)
/**< The maximum number of indexers open at the same time.
#define MAX_NB_OPENED_INDEXERS (100
0
)
/**< The maximum number of indexers open at the same time.
*/
#define MAX_PATH_LEN
4096
/**< Maximum length for the character string defining a
#define MAX_PATH_LEN
(1024)
/**< Maximum length for the character string defining a
* file or directory path.
*/
...
...
src/obidmscolumn.h
View file @
b408a4f6
...
...
@@ -28,7 +28,7 @@
#include "obiblob_indexer.h"
#define ELEMENTS_NAMES_MAX (2048)
/**< The maximum length of the list of elements names.
#define ELEMENTS_NAMES_MAX (2048)
/**< The maximum length of the list of elements names.
// TODO Discuss
*/
#define COLUMN_GROWTH_FACTOR (2)
/**< The growth factor when a column is enlarged.
*/
...
...
src/obiview.c
View file @
b408a4f6
...
...
@@ -1645,7 +1645,6 @@ int obi_view_add_column(Obiview_p view,
int
i
;
OBIDMS_column_p
column
;
OBIDMS_column_p
column_buffer
;
OBIDMS_column_p
current_line_selection
;
// Check that the view is not read-only
if
(
view
->
read_only
)
...
...
@@ -1702,19 +1701,24 @@ int obi_view_add_column(Obiview_p view,
if
(
create
)
{
// Create column
column
=
obi_create_column
(
view
->
dms
,
column_name
,
data_type
,
nb_lines
,
nb_elements_per_line
,
elements_names
,
indexer_name
,
associated_column_name
,
associated_column_version
,
comments
);
if
(
column
==
NULL
)
{
obidebug
(
1
,
"
\n
Error creating a column to add to a view"
);
return
-
1
;
}
(
column
->
header
)
->
lines_used
=
nb_lines
;
}
else
{
// Open column
// TODO do we require that the column's line count is equal to the view's line count?
// or do we enlarge the column or the view as needed?
column
=
obi_open_column
(
view
->
dms
,
column_name
,
version_number
);
}
if
(
column
==
NULL
)
{
obidebug
(
1
,
"
\n
Error creating or opening a column to add to a view"
);
return
-
1
;
if
(
column
==
NULL
)
{
obidebug
(
1
,
"
\n
Error opening a column to add to a view"
);
return
-
1
;
}
// Check that the column's line count is equal to the view's line count if there is no line selection.
// TODO But what if there is a line selection ??? imo should just check that col_line_count > line_selection_count
//if ()
}
// Store column pointer in the view structure
...
...
src/obiview.h
View file @
b408a4f6
...
...
@@ -28,7 +28,7 @@
#include "hashtable.h"
#define OBIVIEW_NAME_MAX_LENGTH (2
55)
/**< The maximum length of an OBIDMS view name
.
#define OBIVIEW_NAME_MAX_LENGTH (2
49)
/**< The maximum length of an OBIDMS view name, without the extension
.
*/
#define VIEW_TYPE_MAX_LENGTH (1024)
/**< The maximum length of the type name of a view.
*/
...
...
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