values cannot be filled in the same way than quantitative ones
-abbreviation,name,unit,type,type
+abbreviation,name,unit,format,type
t,temperature,K,real,1
pres,pressure,Pa,integer,1
tend,pressureVariation,Pa,integer,1
t,temperature,K,real,1
pres,pressure,Pa,integer,1
tend,pressureVariation,Pa,integer,1
else:
self._features = set(chain.from_iterable([tuple(u.keys())
for u in [*dict_features.values()]]))
else:
self._features = set(chain.from_iterable([tuple(u.keys())
for u in [*dict_features.values()]]))
- for csv_file in listdir():
- with open(csv_file, "r") as f:
- reader = DictReader(f, delimiter=',')
- dico_features = {{row['name']: row['type'] # qualitative (2) or quantitative (1)
- }
- for row in reader if row['name'] in self._features}
-
+ csv_files = Path.cwd() / 'config' / 'features'
self._features = {feat : None for feat in self._features}
self._features = {feat : None for feat in self._features}
+ for csv_file in listdir(csv_files):
+ with open(csv_files / csv_file, "r") as f:
+ reader = DictReader(f, delimiter=',')
+ for row in reader:
+ if row['name'] in self._features:
+ self._features[row['name']] = row['type']
print(self._features)
exit()
print(self._features)
exit()
+from .source import Source
+
from configparser import ConfigParser
from csv import DictReader
from datetime import datetime, timedelta
from configparser import ConfigParser
from csv import DictReader
from datetime import datetime, timedelta
def __init__(self, config_file):
# Check for the integrity of feature names
def __init__(self, config_file):
# Check for the integrity of feature names
- super(Source, self).__init__()
self._config = ConfigParser()
self._config.read(config_file)
self._config = ConfigParser()
self._config.read(config_file)
'''
# Check for the integrity of feature names
'''
# Check for the integrity of feature names
- super(Source, self).__init__()
self._config = ConfigParser()
self._config.read(config_file)
self._config = ConfigParser()
self._config.read(config_file)
csv_files = Path.cwd() / 'config' / 'features'
list_of_names = []
for csv_file in listdir(csv_files):
csv_files = Path.cwd() / 'config' / 'features'
list_of_names = []
for csv_file in listdir(csv_files):
- with open(csv_file, "r") as f:
+ with open(csv_files / csv_file, "r") as f:
reader = DictReader(f, delimiter=',')
list_of_names.extend([row['name'] for row in reader])
if len(list_of_names) != len(set(list_of_names)):
reader = DictReader(f, delimiter=',')
list_of_names.extend([row['name'] for row in reader])
if len(list_of_names) != len(set(list_of_names)):