Skip to content
Snippets Groups Projects
Commit 1f283710 authored by Luise Odenthal's avatar Luise Odenthal
Browse files

finished properties for rest of files

parent 66fa83db
No related branches found
No related tags found
No related merge requests found
......@@ -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
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment