Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
navipy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Looking for advice? Join the
Matrix channel for GitLab users in Bielefeld
!
Show more breadcrumbs
Olivier Bertrand
navipy
Commits
1f283710
Commit
1f283710
authored
7 years ago
by
Luise Odenthal
Browse files
Options
Downloads
Patches
Plain Diff
finished properties for rest of files
parent
66fa83db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
navipy/database/__init__.py
+10
-5
10 additions, 5 deletions
navipy/database/__init__.py
with
10 additions
and
5 deletions
navipy/database/__init__.py
+
10
−
5
View file @
1f283710
...
...
@@ -116,8 +116,10 @@ It creates three sql table on initialisation.
def
__init__
(
self
,
filename
,
channels
=
[
'
R
'
,
'
G
'
,
'
B
'
,
'
D
'
]):
"""
Initialisation of the database
"""
assert
isinstance
(
filename
,
str
),
'
filename should be a string
'
assert
isinstance
(
channels
,
list
),
'
nb_channel should be an integer
'
if
not
isinstance
(
filename
,
str
):
raise
TypeError
(
'
filename should be a string
'
)
if
not
isinstance
(
channels
,
list
):
raise
TypeError
(
'
nb_channel should be an integer
'
)
self
.
filename
=
filename
self
.
channels
=
channels
self
.
normalisation_columns
=
list
()
...
...
@@ -151,7 +153,7 @@ It creates three sql table on initialisation.
assert
self
.
table_exist
(
tablename
),
\
'
{} does not contain a table named {}
'
.
format
(
filename
,
tablename
)
elif
self
.
create
()
:
elif
self
.
create
:
# Create database
self
.
db
=
sqlite3
.
connect
(
filename
,
detect_types
=
sqlite3
.
PARSE_DECLTYPES
)
...
...
@@ -244,7 +246,7 @@ It creates three sql table on initialisation.
WHERE {};
"""
.
format
(
where
),
params
)
return
self
.
db_cursor
.
fetchone
()[
0
]
elif
self
.
create
()
:
elif
self
.
create
:
self
.
db_cursor
.
execute
(
"""
INSERT
...
...
@@ -264,6 +266,7 @@ It creates three sql table on initialisation.
print
(
posorient
)
raise
ValueError
(
'
posorient not found
'
)
@property
def
create
(
self
):
return
False
...
...
@@ -276,6 +279,7 @@ class DataBaseLoad(DataBase):
"""
Initialise the DataBaseLoader
"""
DataBase
.
__init__
(
self
,
filename
,
channels
=
channels
)
@property
def
create
(
self
):
"""
use to decide weather to alter the database or not
return False because we do not want
...
...
@@ -300,7 +304,8 @@ class DataBaseLoad(DataBase):
toyield
.
drop
(
'
id
'
,
inplace
=
True
)
yield
toyield
def
get_posorients
(
self
):
@property
def
posorients
(
self
):
"""
Return the position orientations of all points in the
\
database
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment