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
bc2ca890
Commit
bc2ca890
authored
Aug 10, 2015
by
celinemercier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Basis for OBIDMS columns with the type OBI_IDX
parent
a5ed8f0e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
152 additions
and
0 deletions
+152
-0
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/__init__.py
...bitools3/obidms/obidmscolumn/obidmscolumn_idx/__init__.py
+0
-0
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.cfiles
...ms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.cfiles
+16
-0
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pxd
...bidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pxd
+7
-0
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pyx
...bidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pyx
+30
-0
src/obidmscolumn_idx.c
src/obidmscolumn_idx.c
+40
-0
src/obidmscolumn_idx.h
src/obidmscolumn_idx.h
+59
-0
No files found.
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/__init__.py
0 → 100644
View file @
bc2ca890
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.cfiles
0 → 100644
View file @
bc2ca890
../../../../../src/obidmscolumn_idx.c
../../../../../src/obidmscolumn_idx.h
../../../../../src/obidmscolumn.h
../../../../../src/obidmscolumn.c
../../../../../src/obidmscolumndir.h
../../../../../src/obidmscolumndir.c
../../../../../src/obidms.h
../../../../../src/obidms.c
../../../../../src/obierrno.h
../../../../../src/obierrno.c
../../../../../src/obilittlebigman.h
../../../../../src/obilittlebigman.c
../../../../../src/obitypes.h
../../../../../src/obitypes.c
../../../../../src/private_at_functions.h
../../../../../src/private_at_functions.c
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pxd
0 → 100644
View file @
bc2ca890
from
obitools3.obidms.obidmscolumn.capidmscolumn
cimport
*
cdef
extern
from
"obidmscolumn_idx.h"
nogil
:
int
obi_column_set_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
,
obiidx_t
value
)
obiidx_t
obi_column_get_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
)
python/obitools3/obidms/obidmscolumn/obidmscolumn_idx/capidmscolumn_idx.pyx
0 → 100644
View file @
bc2ca890
#cython: language_level=3
from
.capidmscolumn_idx
cimport
*
cdef
class
OBIDMS_column_idx
(
OBIDMS_column
)
:
def
set_item
(
self
,
line_nb
,
element_name
,
value
):
if
element_name
!=
""
:
element_idx
=
self
.
get_element_index_from_name
(
element_name
)
else
:
if
obi_column_get_nb_elements_per_line
(
self
.
pointer
)
==
1
:
element_idx
=
0
else
:
print
(
"An element name must be specified"
)
return
-
1
return
obi_column_set_idx
(
self
.
pointer
,
line_nb
,
element_idx
,
value
)
def
get_item
(
self
,
line_nb
,
element_name
):
if
element_name
!=
""
:
element_idx
=
self
.
get_element_index_from_name
(
element_name
)
else
:
if
obi_column_get_nb_elements_per_line
(
self
.
pointer
)
==
1
:
element_idx
=
0
else
:
print
(
"An element name must be specified"
)
return
-
1
return
obi_column_get_idx
(
self
.
pointer
,
line_nb
,
element_idx
)
\ No newline at end of file
src/obidmscolumn_idx.c
0 → 100644
View file @
bc2ca890
/****************************************************************************
* OBIDMS_column_idx functions *
****************************************************************************/
/**
* @file obidsmcolumn_idx.c
* @author Celine Mercier
* @date August 10th 2015
* @brief Functions handling OBIColumns containing data with the OBIType OBI_IDX.
*/
#include <stdlib.h>
#include <stdio.h>
#include "obidmscolumn.h"
#include "obitypes.h"
#include "obierrno.h"
#include "obidebug.h"
/**********************************************************************
*
* D E F I N I T I O N O F T H E P U B L I C F U N C T I O N S
*
**********************************************************************/
int
obi_column_set_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
,
obiidx_t
value
)
{
// when/where check if can write?
*
(((
obiidx_t
*
)
(
column
->
data
))
+
(
line_nb
*
((
column
->
header
)
->
nb_elements_per_line
))
+
element_idx
)
=
value
;
return
0
;
}
obiidx_t
obi_column_get_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
)
{
return
*
(((
obiidx_t
*
)
(
column
->
data
))
+
(
line_nb
*
((
column
->
header
)
->
nb_elements_per_line
))
+
element_idx
);
}
src/obidmscolumn_idx.h
0 → 100644
View file @
bc2ca890
/****************************************************************************
* OBIDMS_column_idx header file *
****************************************************************************/
/**
* @file obidsmcolumn_idx.h
* @author Celine Mercier
* @date August 10th 2015
* @brief Header file for the functions handling OBIColumns containing data with the OBIType OBI_IDX.
*/
#include <stdlib.h>
#include <stdio.h>
#include "obidmscolumn.h"
#include "obitypes.h"
/**
* @brief Sets a value in an OBIDMS column containing data with the type OBI_IDX.
*
* @param column a pointer as returned by obi_create_column()
* @warning Pointers returned by obi_open_column() don't allow writing.
*
* @param line_nb the number of the line where the value should be set
*
* @param element_idx the index of the element that should be set in the line
*
* @param value the value that should be set
*
* @return an integer value indicating the success of the operation.
*
* @retvalue 0 on success
* @retvalue -1 on failure and the `obi_errno` variable is set.
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
int
obi_column_set_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
,
obiidx_t
value
);
/**
* @brief Recovers a value in an OBIDMS column containing data with the type OBI_IDX.
*
* @param column a pointer as returned by obi_create_column()
*
* @param line_nb the number of the line where the value should be recovered
*
* @param element_idx the index of the element that should be recovered in the line
*
* @return the recovered value
*
* @since August 2015
* @author Celine Mercier (celine.mercier@metabarcoding.org)
*/
obiidx_t
obi_column_get_idx
(
OBIDMS_column_p
column
,
size_t
line_nb
,
size_t
element_idx
);
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