POIDataset.summer_su_c()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
0 ignored issues
show
introduced by
Missing module docstring
Loading history...
2
__author__ = 'kami911'
3
4
try:
5
    import logging
6
    import sys
7
    import pandas as pd
8
    from osm_poi_matchmaker.utils.enums import WeekDaysShort, OpenClose
9
    from osm_poi_matchmaker.libs.opening_hours import OpeningHours
10
    from osm_poi_matchmaker.libs.geo import check_geom
11
    from osm_poi_matchmaker.libs.address import clean_string, clean_url, clean_branch
12
    from osm_poi_matchmaker.dao import poi_array_structure
13
    from osm_poi_matchmaker.utils import config
14
    from osm_poi_matchmaker.dao.poi_base import POIBase
15
    from osm_poi_matchmaker.libs.poi_qc import POIQC
16
except ImportError as err:
17
    logging.error('Error %s import module: %s', module=__name__, error=err)
18
    logging.exception('Exception occurred')
19
20
    sys.exit(128)
21
22
__program__ = 'poi_dataset'
23
__version__ = '0.0.5'
24
25
POI_COLS = poi_array_structure.POI_COLS
26
27
28
class POIDataset:
0 ignored issues
show
best-practice introduced by
Too many public methods (93/20)
Loading history...
best-practice introduced by
Too many instance attributes (57/7)
Loading history...
29
    """Contains all handled OSM tags
30
    """    
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
31
    def __init__(self):
32
        """
33
        """        
0 ignored issues
show
Coding Style introduced by
Trailing whitespace
Loading history...
34
        self.insert_data = []
35
        self.__db = POIBase(
36
            '{}://{}:{}@{}:{}/{}'.format(config.get_database_type(), config.get_database_writer_username(),
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (107/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
37
                                         config.get_database_writer_password(),
38
                                         config.get_database_writer_host(),
39
                                         config.get_database_writer_port(),
40
                                         config.get_database_poi_database()))
41
        self.__code = None
42
        self.__postcode = None
43
        self.__city = None
44
        self.__name = None
45
        self.__branch = None
46
        self.__website = None
47
        self.__description = None
48
        self.__fuel_adblue = None
49
        self.__fuel_octane_100 = None
50
        self.__fuel_octane_98 = None
51
        self.__fuel_octane_95 = None
52
        self.__fuel_diesel_gtl = None
53
        self.__fuel_diesel = None
54
        self.__fuel_lpg = None
55
        self.__fuel_e85 = None
56
        self.__rent_lpg_bottles = None
57
        self.__compressed_air = None
58
        self.__restaurant = None
59
        self.__food = None
60
        self.__truck = None
61
        self.__authentication_app = None
62
        self.__authentication_membership_card = None
63
        self.__capacity = None
64
        self.__fee = None
65
        self.__parking_fee = None
66
        self.__motorcar = None
67
        self.__socket_chademo = None
68
        self.__socket_chademo_output = None
69
        self.__socket_type2_combo = None
70
        self.__socket_type2_combo_output = None
71
        self.__socket_type2_cable = None
72
        self.__socket_type2_cable_output = None
73
        self.__socket_type2 = None
74
        self.__socket_type2_output = None
75
        self.__manufacturer = None
76
        self.__model = None
77
        self.__original = None
78
        self.__street = None
79
        self.__housenumber = None
80
        self.__conscriptionnumber = None
81
        self.__ref = None
82
        self.__phone = None
83
        self.__email = None
84
        self.__geom = None
85
        self.__lat = None
86
        self.__lon = None
87
        self.__nonstop = None
88
        self.__oh = pd.DataFrame(index=WeekDaysShort, columns=OpenClose)
89
        self.__lunch_break_start = None
90
        self.__lunch_break_stop = None
91
        self.__opening_hours = None
92
        self.__public_holiday_open = None
93
        self.__good = []
94
        self.__bad = []
95
96
    def clear_all(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
97
        self.__code = None
98
        self.__postcode = None
99
        self.__city = None
100
        self.__name = None
101
        self.__branch = None
102
        self.__website = None
103
        self.__description = None
104
        self.__fuel_adblue = None
105
        self.__fuel_octane_100 = None
106
        self.__fuel_octane_98 = None
107
        self.__fuel_octane_95 = None
108
        self.__fuel_diesel_gtl = None
109
        self.__fuel_diesel = None
110
        self.__fuel_lpg = None
111
        self.__fuel_e85 = None
112
        self.__rent_lpg_bottles = None
113
        self.__compressed_air = None
114
        self.__restaurant = None
115
        self.__food = None
116
        self.__truck = None
117
        self.__authentication_app = None
118
        self.__authentication_membership_card = None
119
        self.__capacity = None
120
        self.__fee = None
121
        self.__parking_fee = None
122
        self.__motorcar = None
123
        self.__socket_chademo = None
124
        self.__socket_chademo_output = None
125
        self.__socket_type2_combo = None
126
        self.__socket_type2_combo_output = None
127
        self.__socket_type2_cable = None
128
        self.__socket_type2_cable_output = None
129
        self.__socket_type2 = None
130
        self.__socket_type2_output = None
131
        self.__manufacturer = None
132
        self.__model = None
133
        self.__original = None
134
        self.__street = None
135
        self.__housenumber = None
136
        self.__conscriptionnumber = None
137
        self.__ref = None
138
        self.__phone = None
139
        self.__email = None
140
        self.__geom = None
141
        self.__lat = None
142
        self.__lon = None
143
        self.__nonstop = None
144
        self.__oh = pd.DataFrame(index=WeekDaysShort, columns=OpenClose)
145
        self.__lunch_break_start = None
146
        self.__lunch_break_stop = None
147
        self.__opening_hours = None
148
        self.__public_holiday_open = None
149
        self.__good = []
150
        self.__bad = []
151
152
    @property
153
    def code(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
154
        return self.__code
155
156
    @code.setter
157
    def code(self, data: str):
158
        self.__code = data
159
160
    @property
161
    def postcode(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
162
        return self.__postcode
163
164
    @postcode.setter
165
    def postcode(self, data: int):
166
        self.__postcode = data
167
168
    @property
169
    def city(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
170
        return self.__city
171
172
    @city.setter
173
    def city(self, data: str):
174
        self.__city = data
175
176
    @property
177
    def name(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
178
        return self.__name
179
180
    @name.setter
181
    def name(self, data: str):
182
        self.__name = data
183
184
    @property
185
    def branch(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
186
        return self.__branch
187
188
    @branch.setter
189
    def branch(self, data: str):
190
        self.__branch = clean_branch(data)
191
192
    @property
193
    def website(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
194
        return self.__website
195
196
    @website.setter
197
    def website(self, data: str):
198
        self.__website = clean_url(data)
199
200
    @property
201
    def description(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
202
        return self.__description
203
204
    @description.setter
205
    def description(self, data: str):
206
        self.__description = data
207
208
    @property
209
    def fuel_adblue(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
210
        return self.__fuel_adblue
211
212
    @fuel_adblue.setter
213
    def fuel_adblue(self, data: bool):
214
        self.__fuel_adblue = data
215
216
    @property
217
    def fuel_octane_100(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
218
        return self.__fuel_octane_100
219
220
    @fuel_octane_100.setter
221
    def fuel_octane_100(self, data: bool):
222
        self.__fuel_octane_100 = data
223
224
    @property
225
    def fuel_octane_98(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
226
        return self.__fuel_octane_98
227
228
    @fuel_octane_98.setter
229
    def fuel_octane_98(self, data: bool):
230
        self.__fuel_octane_98 = data
231
232
    @property
233
    def fuel_octane_95(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
234
        return self.__fuel_octane_95
235
236
    @fuel_octane_95.setter
237
    def fuel_octane_95(self, data: bool):
238
        self.__fuel_octane_95 = data
239
240
    @property
241
    def fuel_diesel_gtl(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
242
        return self.__fuel_diesel_gtl
243
244
    @fuel_diesel_gtl.setter
245
    def fuel_diesel_gtl(self, data: bool):
246
        self.__fuel_diesel_gtl = data
247
248
    @property
249
    def fuel_diesel(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
250
        return self.__fuel_diesel
251
252
    @fuel_diesel.setter
253
    def fuel_diesel(self, data: bool):
254
        self.__fuel_diesel = data
255
256
    @property
257
    def fuel_lpg(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
258
        return self.__fuel_lpg
259
260
    @fuel_lpg.setter
261
    def fuel_lpg(self, data: bool):
262
        self.__fuel_lpg = data
263
264
    @property
265
    def fuel_e85(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
266
        return self.__fuel_e85
267
268
    @fuel_e85.setter
269
    def fuel_e85(self, data: bool):
270
        self.__fuel_e85 = data
271
272
    @property
273
    def rent_lpg_bottles(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
274
        return self.__rent_lpg_bottles
275
276
    @rent_lpg_bottles.setter
277
    def rent_lpg_bottles(self, data: bool):
278
        self.__rent_lpg_bottles = data
279
280
    @property
281
    def compressed_air(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
282
        return self.__compressed_air
283
284
    @compressed_air.setter
285
    def compressed_air(self, data: bool):
286
        self.__compressed_air = data
287
288
    @property
289
    def restaurant(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
290
        return self.__restaurant
291
292
    @restaurant.setter
293
    def restaurant(self, data: bool):
294
        self.__restaurant = data
295
296
    @property
297
    def food(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
298
        return self.__food
299
300
    @food.setter
301
    def food(self, data: bool):
302
        self.__food = data
303
304
    @property
305
    def truck(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
306
        return self.__truck
307
308
    @truck.setter
309
    def truck(self, data: bool):
310
        self.__truck = data
311
312
    @property
313
    def authentication_app(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
314
        return self.__authentication_app
315
316
    @authentication_app.setter
317
    def authentication_app(self, data: bool):
318
        self.__authentication_app = data
319
320
    @property
321
    def authentication_membership_card(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
322
        return self.__authentication_membership_card
323
324
    @authentication_membership_card.setter
325
    def authentication_membership_card(self, data: bool):
326
        self.__authentication_membership_card = data
327
328
    @property
329
    def capacity(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
330
        return self.__capacity
331
332
    @capacity.setter
333
    def capacity(self, data: int):
334
        self.__capacity = data
335
336
    @property
337
    def fee(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
338
        return self.__fee
339
340
    @fee.setter
341
    def fee(self, data: bool):
342
        self.__fee = data
343
344
    @property
345
    def parking_fee(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
346
        return self.__parking_fee
347
348
    @parking_fee.setter
349
    def parking_fee(self, data: bool):
350
        self.__parking_fee = data
351
352
    @property
353
    def motorcar(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
354
        return self.__motorcar
355
356
    @motorcar.setter
357
    def motorcar(self, data: bool):
358
        self.__motorcar = data
359
360
    @property
361
    def socket_chademo(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
362
        return self.__socket_chademo
363
364
    @socket_chademo.setter
365
    def socket_chademo(self, data: int):
366
        self.__socket_chademo = data
367
368
    @property
369
    def socket_chademo_output(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
370
        return self.__socket_chademo_output
371
372
    @socket_chademo_output.setter
373
    def socket_chademo_output(self, data: str):
374
        self.__socket_chademo_output = data
375
376
    @property
377
    def socket_type2_combo(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
378
        return self.__socket_type2_combo
379
380
    @socket_type2_combo.setter
381
    def socket_type2_combo(self, data: int):
382
        self.__socket_type2_combo = data
383
384
    @property
385
    def socket_type2_combo_output(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
386
        return self.__socket_type2_combo_output
387
388
    @socket_type2_combo_output.setter
389
    def socket_type2_combo_output(self, data: str):
390
        self.__socket_type2_combo_output = data
391
392
    @property
393
    def socket_type2_cable(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
394
        return self.__socket_type2_cable
395
396
    @socket_type2_cable.setter
397
    def socket_type2_cable(self, data: int):
398
        self.__socket_type2_cable = data
399
400
    @property
401
    def socket_type2_cable_output(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
402
        return self.__socket_type2_cable_output
403
404
    @socket_type2_cable_output.setter
405
    def socket_type2_cable_output(self, data: str):
406
        self.__socket_type2_cable_output = data
407
408
    @property
409
    def socket_type2(self) -> int:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
410
        return self.__socket_type2
411
412
    @socket_type2.setter
413
    def socket_type2(self, data: int):
414
        self.__socket_type2 = data
415
416
    @property
417
    def socket_type2_output(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
418
        return self.__socket_type2_output
419
420
    @socket_type2_output.setter
421
    def socket_type2_output(self, data: str):
422
        self.__socket_type2_output = data
423
424
    @property
425
    def manufacturer(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
426
        return self.__manufacturer
427
428
    @manufacturer.setter
429
    def manufacturer(self, data: str):
430
        self.__manufacturer = data
431
432
    @property
433
    def model(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
434
        return self.__model
435
436
    @model.setter
437
    def model(self, data: str):
438
        self.__model = data
439
440
    @property
441
    def original(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
442
        return self.__original
443
444
    @original.setter
445
    def original(self, data: str):
446
        self.__original = data
447
448
    @property
449
    def street(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
450
        return self.__street
451
452
    @street.setter
453
    def street(self, data: str):
454
        # Try to find street name around
455
        try:
456
            if self.lat is not None and self.lon is not None:
457
                query = self.__db.query_name_road_around(self.lon, self.lat, data, True, 'name')
458
                if query is None or query.empty:
459
                    query = self.__db.query_name_road_around(self.lon, self.lat, data, True, 'metaphone')
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (105/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
460
                    if query is None or query.empty:
461
                        logging.warning('There is no street around named or metaphone named: %s', data)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (103/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
462
                        self.__street = data
463
                    else:
464
                        new_data = query.at[0, 'name']
465
                        logging.info('There is a metaphone street around named: %s, original was: %s.', new_data, data)
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (119/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
466
                        self.__street = new_data
467
                else:
468
                    logging.info('There is a street around named: %s.', data)
469
                    self.__street = data
470
            else:
471
                self.__street = data
472
        except Exception as e:
0 ignored issues
show
Best Practice introduced by
Catching very general exceptions such as Exception is usually not recommended.

Generally, you would want to handle very specific errors in the exception handler. This ensure that you do not hide other types of errors which should be fixed.

So, unless you specifically plan to handle any error, consider adding a more specific exception.

Loading history...
Coding Style Naming introduced by
Variable name "e" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
473
            logging.error(e)
474
            logging.exception('Exception occurred')
475
476
    @property
477
    def housenumber(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
478
        return self.__housenumber
479
480
    @housenumber.setter
481
    def housenumber(self, data: str):
482
        self.__housenumber = data
483
484
    @property
485
    def conscriptionnumber(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
486
        return self.__conscriptionnumber
487
488
    @conscriptionnumber.setter
489
    def conscriptionnumber(self, data: str):
490
        self.__conscriptionnumber = data
491
492
    @property
493
    def ref(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
494
        return self.__ref
495
496
    @ref.setter
497
    def ref(self, data: str):
498
        self.__ref = data
499
500
    @property
501
    def phone(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
502
        return self.__phone
503
504
    @phone.setter
505
    def phone(self, data: str):
506
        if data == 'NULL':
507
            self.__phone = None
508
        else:
509
            self.__phone = data
510
511
    @property
512
    def email(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
513
        return self.__email
514
515
    @email.setter
516
    def email(self, data: str):
517
        if data == 'NULL':
518
            self.__email = None
519
        else:
520
            self.__email = data
521
522
    @property
523
    def geom(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
524
        return self.__geom
525
526
    @geom.setter
527
    def geom(self, data: str):
528
        self.__geom = data
529
530
    @property
531
    def lat(self) -> float:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
532
        return self.__lat
533
534
    @lat.setter
535
    def lat(self, lat: float):
536
        self.__lat = lat
537
538
    @property
539
    def lon(self) -> float:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
540
        return self.__lon
541
542
    @lon.setter
543
    def lon(self, lon: float):
544
        self.__lon = lon
545
546
    def process_geom(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
547
        self.geom = check_geom(self.__lat, self.__lon)
548
549
    @property
550
    def opening_hours_table(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
551
        return self.__oh
552
553
    @opening_hours_table.setter
554
    def opening_hours_table(self, data):
555
        self.__oh = pd.DataFrame(data, index=WeekDaysShort, columns=OpenClose)
556
557
    @property
558
    def nonstop(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
559
        return self.__nonstop
560
561
    @nonstop.setter
562
    def nonstop(self, data: bool):
563
        self.__nonstop = data
564
565
    @property
566
    def mo_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
567
        return self.__oh.at[WeekDaysShort.mo, OpenClose.open]
568
569
    @mo_o.setter
570
    def mo_o(self, data: str):
571
        self.__oh.at[WeekDaysShort.mo, OpenClose.open] = data
572
573
    @property
574
    def tu_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
575
        return self.__oh.at[WeekDaysShort.tu, OpenClose.open]
576
577
    @tu_o.setter
578
    def tu_o(self, data: str):
579
        self.__oh.at[WeekDaysShort.tu, OpenClose.open] = data
580
581
    @property
582
    def we_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
583
        return self.__oh.at[WeekDaysShort.we, OpenClose.open]
584
585
    @we_o.setter
586
    def we_o(self, data: str):
587
        self.__oh.at[WeekDaysShort.we, OpenClose.open] = data
588
589
    @property
590
    def th_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
591
        return self.__oh.at[WeekDaysShort.th, OpenClose.open]
592
593
    @th_o.setter
594
    def th_o(self, data: str):
595
        self.__oh.at[WeekDaysShort.th, OpenClose.open] = data
596
597
    @property
598
    def fr_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
599
        return self.__oh.at[WeekDaysShort.fr, OpenClose.open]
600
601
    @fr_o.setter
602
    def fr_o(self, data: str):
603
        self.__oh.at[WeekDaysShort.fr, OpenClose.open] = data
604
605
    @property
606
    def sa_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
607
        return self.__oh.at[WeekDaysShort.sa, OpenClose.open]
608
609
    @sa_o.setter
610
    def sa_o(self, data: str):
611
        self.__oh.at[WeekDaysShort.sa, OpenClose.open] = data
612
613
    @property
614
    def su_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
615
        return self.__oh.at[WeekDaysShort.su, OpenClose.open]
616
617
    @su_o.setter
618
    def su_o(self, data: str):
619
        self.__oh.at[WeekDaysShort.su, OpenClose.open] = data
620
621
    @property
622
    def mo_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
623
        return self.__oh.at[WeekDaysShort.mo, OpenClose.close]
624
625
    @mo_c.setter
626
    def mo_c(self, data: str):
627
        self.__oh.at[WeekDaysShort.mo, OpenClose.close] = data
628
629
    @property
630
    def tu_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
631
        return self.__oh.at[WeekDaysShort.tu, OpenClose.close]
632
633
    @tu_c.setter
634
    def tu_c(self, data: str):
635
        self.__oh.at[WeekDaysShort.tu, OpenClose.close] = data
636
637
    @property
638
    def we_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
639
        return self.__oh.at[WeekDaysShort.we, OpenClose.close]
640
641
    @we_c.setter
642
    def we_c(self, data: str):
643
        self.__oh.at[WeekDaysShort.we, OpenClose.close] = data
644
645
    @property
646
    def th_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
647
        return self.__oh.at[WeekDaysShort.th, OpenClose.close]
648
649
    @th_c.setter
650
    def th_c(self, data: str):
651
        self.__oh.at[WeekDaysShort.th, OpenClose.close] = data
652
653
    @property
654
    def fr_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
655
        return self.__oh.at[WeekDaysShort.fr, OpenClose.close]
656
657
    @fr_c.setter
658
    def fr_c(self, data: str):
659
        self.__oh.at[WeekDaysShort.fr, OpenClose.close] = data
660
661
    @property
662
    def sa_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
663
        return self.__oh.at[WeekDaysShort.sa, OpenClose.close]
664
665
    @sa_c.setter
666
    def sa_c(self, data: str):
667
        self.__oh.at[WeekDaysShort.sa, OpenClose.close] = data
668
669
    @property
670
    def su_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
671
        return self.__oh.at[WeekDaysShort.su, OpenClose.close]
672
673
    @su_c.setter
674
    def su_c(self, data: str):
675
        self.__oh.at[WeekDaysShort.su, OpenClose.close] = data
676
677
    @property
678
    def summer_mo_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
679
        return self.__oh.at[WeekDaysShort.mo, OpenClose.summer_open]
680
681
    @summer_mo_o.setter
682
    def summer_mo_o(self, data: str):
683
        self.__oh.at[WeekDaysShort.mo, OpenClose.summer_open] = data
684
685
    @property
686
    def summer_tu_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
687
        return self.__oh.at[WeekDaysShort.tu, OpenClose.summer_open]
688
689
    @summer_tu_o.setter
690
    def summer_tu_o(self, data: str):
691
        self.__oh.at[WeekDaysShort.tu, OpenClose.summer_open] = data
692
693
    @property
694
    def summer_we_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
695
        return self.__oh.at[WeekDaysShort.we, OpenClose.summer_open]
696
697
    @summer_we_o.setter
698
    def summer_we_o(self, data: str):
699
        self.__oh.at[WeekDaysShort.we, OpenClose.summer_open] = data
700
701
    @property
702
    def summer_th_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
703
        return self.__oh.at[WeekDaysShort.th, OpenClose.summer_open]
704
705
    @summer_th_o.setter
706
    def summer_th_o(self, data: str):
707
        self.__oh.at[WeekDaysShort.th, OpenClose.summer_open] = data
708
709
    @property
710
    def summer_fr_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
711
        return self.__oh.at[WeekDaysShort.fr, OpenClose.summer_open]
712
713
    @summer_fr_o.setter
714
    def summer_fr_o(self, data: str):
715
        self.__oh.at[WeekDaysShort.fr, OpenClose.summer_open] = data
716
717
    @property
718
    def summer_sa_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
719
        return self.__oh.at[WeekDaysShort.sa, OpenClose.summer_open]
720
721
    @summer_sa_o.setter
722
    def summer_sa_o(self, data: str):
723
        self.__oh.at[WeekDaysShort.sa, OpenClose.summer_open] = data
724
725
    @property
726
    def summer_su_o(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
727
        return self.__oh.at[WeekDaysShort.su, OpenClose.summer_open]
728
729
    @summer_su_o.setter
730
    def summer_su_o(self, data: str):
731
        self.__oh.at[WeekDaysShort.su, OpenClose.summer_open] = data
732
733
    @property
734
    def summer_mo_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
735
        return self.__oh.at[WeekDaysShort.mo, OpenClose.summer_close]
736
737
    @summer_mo_c.setter
738
    def summer_mo_c(self, data: str):
739
        self.__oh.at[WeekDaysShort.mo, OpenClose.summer_close] = data
740
741
    @property
742
    def summer_tu_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
743
        return self.__oh.at[WeekDaysShort.tu, OpenClose.summer_close]
744
745
    @summer_tu_c.setter
746
    def summer_tu_c(self, data: str):
747
        self.__oh.at[WeekDaysShort.tu, OpenClose.summer_close] = data
748
749
    @property
750
    def summer_we_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
751
        return self.__oh.at[WeekDaysShort.we, OpenClose.summer_close]
752
753
    @summer_we_c.setter
754
    def summer_we_c(self, data: str):
755
        self.__oh.at[WeekDaysShort.we, OpenClose.summer_close] = data
756
757
    @property
758
    def summer_th_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
759
        return self.__oh.at[WeekDaysShort.th, OpenClose.summer_close]
760
761
    @summer_th_c.setter
762
    def summer_th_c(self, data: str):
763
        self.__oh.at[WeekDaysShort.th, OpenClose.summer_close] = data
764
765
    @property
766
    def summer_fr_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
767
        return self.__oh.at[WeekDaysShort.fr, OpenClose.summer_close]
768
769
    @summer_fr_c.setter
770
    def summer_fr_c(self, data: str):
771
        self.__oh.at[WeekDaysShort.fr, OpenClose.summer_close] = data
772
773
    @property
774
    def summer_sa_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
775
        return self.__oh.at[WeekDaysShort.sa, OpenClose.summer_close]
776
777
    @summer_sa_c.setter
778
    def summer_sa_c(self, data: str):
779
        self.__oh.at[WeekDaysShort.sa, OpenClose.summer_close] = data
780
781
    @property
782
    def summer_su_c(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
783
        return self.__oh.at[WeekDaysShort.su, OpenClose.summer_close]
784
785
    @summer_su_c.setter
786
    def summer_su_c(self, data: str):
787
        self.__oh.at[WeekDaysShort.su, OpenClose.summer_close] = data
788
789
    @property
790
    def lunch_break_start(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
791
        return self.__lunch_break_start
792
793
    @lunch_break_start.setter
794
    def lunch_break_start(self, data: str):
795
        self.__lunch_break_start = data
796
797
    @property
798
    def lunch_break_stop(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
799
        return self.__lunch_break_stop
800
801
    @lunch_break_stop.setter
802
    def lunch_break_stop(self, data: str):
803
        self.__lunch_break_stop = data
804
805
    def day_open(self, day, data):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
806
        self.__oh.at[WeekDaysShort(day), OpenClose.open] = data
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
807
808
    def day_close(self, day, data):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
809
        self.__oh.at[WeekDaysShort(day), OpenClose.close] = data
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
810
811
    def day_summer_open(self, day, data):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
812
        self.__oh.at[WeekDaysShort(day), OpenClose.summer_open] = data
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
813
814
    def day_summer_close(self, day, data):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
815
        self.__oh.at[WeekDaysShort(day), OpenClose.summer_close] = data
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
816
817
    def day_open_close(self, day, opening, closing):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
818
        self.__oh.at[WeekDaysShort(day), OpenClose.open] = opening
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
819
        self.__oh.at[WeekDaysShort(day), OpenClose.close] = closing
820
821
    def day_summer_open_close(self, day, opening, closing):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
822
        self.__oh.at[WeekDaysShort(day), OpenClose.summer_open] = opening
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable WeekDaysShort does not seem to be defined.
Loading history...
823
        self.__oh.at[WeekDaysShort(day), OpenClose.summer_close] = closing
824
825
    @property
826
    def opening_hours(self) -> str:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
827
        return self.__opening_hours
828
829
    @opening_hours.setter
830
    def opening_hours(self, data: str):
831
        self.__opening_hours = data
832
833
    @property
834
    def public_holiday_open(self) -> bool:
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
835
        return self.__public_holiday_open
836
837
    @public_holiday_open.setter
838
    def public_holiday_open(self, data: bool):
839
        self.__public_holiday_open = data
840
841
    def process_opening_hours(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
842
        self.__oh = self.__oh.where((pd.notnull(self.__oh)), None)
843
        t = OpeningHours(self.__nonstop, self.__oh.at[WeekDaysShort.mo, OpenClose.open],
0 ignored issues
show
Coding Style Naming introduced by
Variable name "t" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
844
                         self.__oh.at[WeekDaysShort.tu, OpenClose.open],
845
                         self.__oh.at[WeekDaysShort.we, OpenClose.open],
846
                         self.__oh.at[WeekDaysShort.th, OpenClose.open],
847
                         self.__oh.at[WeekDaysShort.fr, OpenClose.open],
848
                         self.__oh.at[WeekDaysShort.sa, OpenClose.open],
849
                         self.__oh.at[WeekDaysShort.su, OpenClose.open],
850
                         self.__oh.at[WeekDaysShort.mo, OpenClose.close],
851
                         self.__oh.at[WeekDaysShort.tu, OpenClose.close],
852
                         self.__oh.at[WeekDaysShort.we, OpenClose.close],
853
                         self.__oh.at[WeekDaysShort.th, OpenClose.close],
854
                         self.__oh.at[WeekDaysShort.fr, OpenClose.close],
855
                         self.__oh.at[WeekDaysShort.sa, OpenClose.close],
856
                         self.__oh.at[WeekDaysShort.su, OpenClose.close],
857
                         self.__oh.at[WeekDaysShort.mo, OpenClose.summer_open],
858
                         self.__oh.at[WeekDaysShort.tu, OpenClose.summer_open],
859
                         self.__oh.at[WeekDaysShort.we, OpenClose.summer_open],
860
                         self.__oh.at[WeekDaysShort.th, OpenClose.summer_open],
861
                         self.__oh.at[WeekDaysShort.fr, OpenClose.summer_open],
862
                         self.__oh.at[WeekDaysShort.sa, OpenClose.summer_open],
863
                         self.__oh.at[WeekDaysShort.su, OpenClose.summer_open],
864
                         self.__oh.at[WeekDaysShort.mo, OpenClose.summer_close],
865
                         self.__oh.at[WeekDaysShort.tu, OpenClose.summer_close],
866
                         self.__oh.at[WeekDaysShort.we, OpenClose.summer_close],
867
                         self.__oh.at[WeekDaysShort.th, OpenClose.summer_close],
868
                         self.__oh.at[WeekDaysShort.fr, OpenClose.summer_close],
869
                         self.__oh.at[WeekDaysShort.sa, OpenClose.summer_close],
870
                         self.__oh.at[WeekDaysShort.su, OpenClose.summer_close],
871
                         self.__lunch_break_start, self.__lunch_break_stop,
872
                         self.__public_holiday_open)
873
        self.__opening_hours = t.process()
874
875
    def dump_opening_hours(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
876
        print(self.__opening_hours)
877
878
    def add(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
879
        try:
880
            self.process_opening_hours()
881
            self.process_geom()
882
            pqc = POIQC(self.__db, self.__lon, self.__lat, self.__opening_hours, self.__street)
883
            self.__good, self.__bad = pqc.process()
884
            self.insert_data.append(
885
                [self.__code, self.__postcode, self.__city, self.__name, clean_string(self.__branch), self.__website,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (117/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
886
                 self.__description, self.__fuel_adblue, self.__fuel_octane_100, self.__fuel_octane_98,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (103/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
887
                 self.__fuel_octane_95, self.__fuel_diesel_gtl, self.__fuel_diesel, self.__fuel_lpg,
888
                 self.__fuel_e85, self.__rent_lpg_bottles, self.__compressed_air, self.__restaurant, self.__food,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (113/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
889
                 self.__truck,
890
                 self.__authentication_app, self.__authentication_membership_card, self.__capacity, self.__fee,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (111/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
891
                 self.__parking_fee, self.__motorcar, self.__socket_chademo, self.__socket_chademo_output,
0 ignored issues
show
Coding Style introduced by
This line is too long as per the coding-style (106/100).

This check looks for lines that are too long. You can specify the maximum line length.

Loading history...
892
                 self.__socket_type2_combo, self.__socket_type2_combo_output,
893
                 self.__socket_type2_cable, self.__socket_type2_cable_output,
894
                 self.__socket_type2, self.__socket_type2_output, self.__manufacturer, self.__model,
895
                 self.__original, self.__street, self.__housenumber, self.__conscriptionnumber,
896
                 self.__ref, self.__phone, self.__email, self.__geom, self.__nonstop,
897
                 self.__oh.at[WeekDaysShort.mo, OpenClose.open],
898
                 self.__oh.at[WeekDaysShort.tu, OpenClose.open],
899
                 self.__oh.at[WeekDaysShort.we, OpenClose.open],
900
                 self.__oh.at[WeekDaysShort.th, OpenClose.open],
901
                 self.__oh.at[WeekDaysShort.fr, OpenClose.open],
902
                 self.__oh.at[WeekDaysShort.sa, OpenClose.open],
903
                 self.__oh.at[WeekDaysShort.su, OpenClose.open],
904
                 self.__oh.at[WeekDaysShort.mo, OpenClose.close],
905
                 self.__oh.at[WeekDaysShort.tu, OpenClose.close],
906
                 self.__oh.at[WeekDaysShort.we, OpenClose.close],
907
                 self.__oh.at[WeekDaysShort.th, OpenClose.close],
908
                 self.__oh.at[WeekDaysShort.fr, OpenClose.close],
909
                 self.__oh.at[WeekDaysShort.sa, OpenClose.close],
910
                 self.__oh.at[WeekDaysShort.su, OpenClose.close],
911
                 self.__oh.at[WeekDaysShort.mo, OpenClose.summer_open],
912
                 self.__oh.at[WeekDaysShort.tu, OpenClose.summer_open],
913
                 self.__oh.at[WeekDaysShort.we, OpenClose.summer_open],
914
                 self.__oh.at[WeekDaysShort.th, OpenClose.summer_open],
915
                 self.__oh.at[WeekDaysShort.fr, OpenClose.summer_open],
916
                 self.__oh.at[WeekDaysShort.sa, OpenClose.summer_open],
917
                 self.__oh.at[WeekDaysShort.su, OpenClose.summer_open],
918
                 self.__oh.at[WeekDaysShort.mo, OpenClose.summer_close],
919
                 self.__oh.at[WeekDaysShort.tu, OpenClose.summer_close],
920
                 self.__oh.at[WeekDaysShort.we, OpenClose.summer_close],
921
                 self.__oh.at[WeekDaysShort.th, OpenClose.summer_close],
922
                 self.__oh.at[WeekDaysShort.fr, OpenClose.summer_close],
923
                 self.__oh.at[WeekDaysShort.sa, OpenClose.summer_close],
924
                 self.__oh.at[WeekDaysShort.su, OpenClose.summer_close], self.__lunch_break_start,
925
                 self.__lunch_break_stop,
926
                 self.__public_holiday_open, self.__opening_hours, self.__good, self.__bad])
927
            self.clear_all()
928
        except Exception as e:
0 ignored issues
show
Best Practice introduced by
Catching very general exceptions such as Exception is usually not recommended.

Generally, you would want to handle very specific errors in the exception handler. This ensure that you do not hide other types of errors which should be fixed.

So, unless you specifically plan to handle any error, consider adding a more specific exception.

Loading history...
Coding Style Naming introduced by
Variable name "e" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
929
            logging.error(e)
930
            logging.exception('Exception occurred')
931
932
    def process(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
933
        df = pd.DataFrame(self.insert_data)
0 ignored issues
show
Coding Style Naming introduced by
Variable name "df" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
934
        df.columns = POI_COLS
935
        return df.where((pd.notnull(df)), None)
936
937
    def lenght(self):
0 ignored issues
show
introduced by
Missing function or method docstring
Loading history...
938
        return len(self.insert_data)
939