mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
refacto: don't use regex for car model for performance reason
This commit is contained in:
committed by
Florian BEZANNIER
parent
0bbd8a1828
commit
8f0743fb42
@@ -1,7 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-autopep8
|
||||
rev: 'v2.0.4' # Use the sha / tag you want to point at
|
||||
language: system
|
||||
hooks:
|
||||
- id: autopep8
|
||||
language: system
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import re
|
||||
|
||||
DEFAULT_BATTERY_POWER = 46
|
||||
DEFAULT_FUEL_CAPACITY = 0
|
||||
DEFAULT_MAX_ELEC_CONSUMPTION = 70
|
||||
@@ -7,7 +5,7 @@ DEFAULT_MAX_FUEL_CONSUMPTION = 30
|
||||
|
||||
|
||||
class CarModel:
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-positional-arguments,too-many-arguments
|
||||
def __init__(self, name, battery_power, fuel_capacity, abrp_name=None, reg=None,
|
||||
max_elec_consumption=DEFAULT_MAX_ELEC_CONSUMPTION, max_fuel_consumption=DEFAULT_MAX_FUEL_CONSUMPTION):
|
||||
self.name = name
|
||||
@@ -21,11 +19,11 @@ class CarModel:
|
||||
def match(self, vin):
|
||||
if self.reg is None:
|
||||
return False
|
||||
return re.match(self.reg, vin) is not None
|
||||
return vin.startswith(self.reg)
|
||||
|
||||
|
||||
class ElecModel(CarModel):
|
||||
# pylint: disable=too-many-arguments
|
||||
# pylint: disable=too-many-positional-arguments,too-many-arguments
|
||||
def __init__(self, name, battery_power, abrp_name=None, reg=None,
|
||||
max_elec_consumption=DEFAULT_MAX_ELEC_CONSUMPTION):
|
||||
super().__init__(name, battery_power, 0, abrp_name, reg, max_elec_consumption, 0)
|
||||
|
||||
@@ -3,63 +3,63 @@
|
||||
battery_power: 73
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e3008:24:77
|
||||
reg: VR3KCZKZ7R.*
|
||||
reg: VR3KCZKZ7R
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: Vivaro-e panel van L3
|
||||
battery_power: 68
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:vivaroe:22:75:l
|
||||
reg: VXEV1ZKXZM.*
|
||||
reg: VXEV1ZKXZM
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: Vivaro-e panel van L1
|
||||
battery_power: 68
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:vivaroe:22:75:l
|
||||
reg: VXEV1ZKXZN.*
|
||||
reg: VXEV1ZKXZN
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-berlingo 2022+
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: Citroen;e-Berlingo;2022+ (alpha)
|
||||
reg: VR7EZZKXZP.*
|
||||
reg: VR7EZZKXZP
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-berlingo 2022+
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: Citroen;e-Berlingo;2022+ (alpha)
|
||||
reg: VR7EZZKXZM.*
|
||||
reg: VR7EZZKXZM
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-berlingo 2022+
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: Citroen;e-Berlingo;2022+ (alpha)
|
||||
reg: VR7EZZKXZN.*
|
||||
reg: VR7EZZKXZN
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-jumpy
|
||||
battery_power: 68
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ejumpy:20:75:m
|
||||
reg: VF7V1ZKXZM.*
|
||||
reg: VF7V1ZKXZM
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-208
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e208:20:50
|
||||
reg: VR3UHZK[WX].*
|
||||
reg: VR3UHZK
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-2008
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e2008:20:48
|
||||
reg: VR3UKZKX.*
|
||||
reg: VR3UKZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -67,7 +67,7 @@
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e2008:23:54
|
||||
reg: VR3UKZKW.*
|
||||
reg: VR3UKZKW
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -75,7 +75,7 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:etraveler:21:50:citroen
|
||||
reg: VF7VZZKX.*
|
||||
reg: VF7VZZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -83,7 +83,7 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:etraveler:21:50
|
||||
reg: VF3VZZKX.*
|
||||
reg: VF3VZZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -91,7 +91,7 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:corsae:20:50
|
||||
reg: VXKUHZKX.*
|
||||
reg: VXKUHZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -99,7 +99,7 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: ds:3crossback:20:48
|
||||
reg: VR1UJZKX.*
|
||||
reg: VR1UJZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -107,14 +107,14 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:mokkae:20:48
|
||||
reg: VXKUKZKX.*
|
||||
reg: VXKUKZKX
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: Zaphira-e
|
||||
battery_power: 68
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:etraveler:21:75:opel
|
||||
reg: VXEVZZKX.*
|
||||
reg: VXEVZZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -122,7 +122,7 @@
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ec4:21:50
|
||||
reg: VR7BCZKX.*
|
||||
reg: VR7BCZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -130,7 +130,7 @@
|
||||
battery_power: 54
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ec4x:24:54
|
||||
reg: VR7BFZKW1R.*
|
||||
reg: VR7BFZKW1R
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !ElecModel
|
||||
@@ -138,21 +138,21 @@
|
||||
battery_power: 45
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:comboe:22:50:peugeot
|
||||
reg: VR3EZZKXZ.*
|
||||
reg: VR3EZZKXZ
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: ION
|
||||
battery_power: 14.5
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:ion:12:14:other
|
||||
reg: VF31NZKY.*
|
||||
reg: VF31NZKY
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: SUV 3008 Hybrid 225
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VF3M4DGZ.*
|
||||
reg: VF3M4DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -160,7 +160,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 53
|
||||
abrp_name:
|
||||
reg: VF3MJEHZ.*
|
||||
reg: VF3MJEHZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -168,7 +168,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VF3L35GG.*
|
||||
reg: VF3L35GG
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -176,7 +176,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 46
|
||||
abrp_name:
|
||||
reg: VF3LCBHZHJ.*
|
||||
reg: VF3LCBHZHJ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -184,7 +184,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VR3UPHN[SEK].*
|
||||
reg: VR3UPHN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -192,7 +192,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VF3CCBHY6H.*
|
||||
reg: VF3CCBHY6H
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -200,7 +200,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VR3USHNS.*
|
||||
reg: VR3USHNS
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -208,7 +208,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VF3CU9HP.*
|
||||
reg: VF3CU9HP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -216,7 +216,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VF3CUBHY6F.*
|
||||
reg: VF3CUBHY6F
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -224,7 +224,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VR3USHNK.*
|
||||
reg: VR3USHNK
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -232,7 +232,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VF3MRHNS.*
|
||||
reg: VF3MRHNS
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -240,7 +240,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VF3MRHNYHH.*
|
||||
reg: VF3MRHNYHH
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -248,7 +248,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 53
|
||||
abrp_name:
|
||||
reg: VF3MRHNYHJ.*
|
||||
reg: VF3MRHNYHJ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -256,7 +256,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 60
|
||||
abrp_name:
|
||||
reg: VF3MCBHZ.*
|
||||
reg: VF3MCBHZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -264,7 +264,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR7A4DGZ.*
|
||||
reg: VR7A4DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -272,7 +272,7 @@
|
||||
battery_power: 11.5
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR1J45GB.*
|
||||
reg: VR1J45GB
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -280,7 +280,7 @@
|
||||
battery_power: 11.5
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VR3F4DGZ.*
|
||||
reg: VR3F4DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -288,7 +288,7 @@
|
||||
battery_power: 11.5
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR3F3DGZ.*
|
||||
reg: VR3F3DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -296,7 +296,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 72
|
||||
abrp_name:
|
||||
reg: VF38ERHH.*
|
||||
reg: VF38ERHH
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -304,7 +304,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 62
|
||||
abrp_name:
|
||||
reg: VR3F45GG.*
|
||||
reg: VR3F45GG
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -312,7 +312,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 55
|
||||
abrp_name:
|
||||
reg: VR3FBYHZ.*
|
||||
reg: VR3FBYHZ
|
||||
max_elec_consumption: 0
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -320,7 +320,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: W0VZ4DGZ.*
|
||||
reg: W0VZ4DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -328,7 +328,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: W0VZ45GB.*
|
||||
reg: W0VZ45GB
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -336,7 +336,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VF72RHNPXK.*
|
||||
reg: VF72RHNPXK
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -344,7 +344,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VF72RHNS1N.*
|
||||
reg: VF72RHNS1N
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -352,7 +352,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F3DGYT.*
|
||||
reg: VR3F3DGYT
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -360,7 +360,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F3DGXTP.*
|
||||
reg: VR3F3DGXTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -368,7 +368,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F4DGYTN.*
|
||||
reg: VR3F4DGYTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -376,7 +376,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR1J4DGZ.*
|
||||
reg: VR1J4DGZ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -384,7 +384,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 57
|
||||
abrp_name:
|
||||
reg: VF73ABHZMJ.*
|
||||
reg: VF73ABHZMJ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -392,7 +392,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 50
|
||||
abrp_name:
|
||||
reg: VR7BAHNSAM.*
|
||||
reg: VR7BAHNSAM
|
||||
max_elec_consumption: 0
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
@@ -400,14 +400,14 @@
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:comboe:22:50
|
||||
reg: W0VEAZKXZM.*
|
||||
reg: W0VEAZKXZM
|
||||
max_elec_consumption: 45
|
||||
- !CarModel
|
||||
name: Astra L Hybrid
|
||||
battery_power: 11.3
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VXKF3DGXTN.*
|
||||
reg: VXKF3DGXTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -415,7 +415,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VXKF3DGYTP.*
|
||||
reg: VXKF3DGYTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -423,7 +423,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VXKF4DGYTN.*
|
||||
reg: VXKF4DGYTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
@@ -431,14 +431,14 @@
|
||||
battery_power: 51
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:astrae:23:54
|
||||
reg: VXKFMZKWZP.*
|
||||
reg: VXKFMZKWZP
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: Astra L Hybrid
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VXKF3DGXTP.*
|
||||
reg: VXKF3DGXTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -446,7 +446,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VXKF4DGXTP.*
|
||||
reg: VXKF4DGXTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -454,7 +454,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F4DGXTN.*
|
||||
reg: VR3F4DGXTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -462,7 +462,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR1F4DGYT.*
|
||||
reg: VR1F4DGYT
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -470,7 +470,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VR3FPHNSTN.*
|
||||
reg: VR3FPHNSTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -478,7 +478,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 52
|
||||
abrp_name:
|
||||
reg: VR3FPHNSLN.*
|
||||
reg: VR3FPHNSLN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -486,7 +486,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR7NDDGYPN.*
|
||||
reg: VR7NDDGYPN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -494,7 +494,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VF3M45GBUK.*
|
||||
reg: VF3M45GBUK
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -502,7 +502,7 @@
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VF3M45GBUM.*
|
||||
reg: VF3M45GBUM
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -510,7 +510,7 @@
|
||||
battery_power: 11.5
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR3F35GBTM.*
|
||||
reg: VR3F35GBTM
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
@@ -518,14 +518,14 @@
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:comboe:22:50
|
||||
reg: W0VEZZKXZN.*
|
||||
reg: W0VEZZKXZN
|
||||
max_elec_consumption: 45
|
||||
- !CarModel
|
||||
name: New 308 SW
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VR3FRHNSTN.*
|
||||
reg: VR3FRHNSTN
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -533,7 +533,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 52
|
||||
abrp_name:
|
||||
reg: VR3FRHNSTP.*
|
||||
reg: VR3FRHNSTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -541,7 +541,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 56
|
||||
abrp_name:
|
||||
reg: VF3MCYHZRL.*
|
||||
reg: VF3MCYHZRL
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -549,7 +549,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 60
|
||||
abrp_name:
|
||||
reg: VF3MCYHZRJ.*
|
||||
reg: VF3MCYHZRJ
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -557,7 +557,7 @@
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F4DGYTP.*
|
||||
reg: VR3F4DGYTP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -565,7 +565,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VR7ARHNSSP.*
|
||||
reg: VR7ARHNSSP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
@@ -573,38 +573,38 @@
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name:
|
||||
reg: W0VEAZKXZP.*
|
||||
reg: W0VEAZKXZP
|
||||
max_elec_consumption: 46
|
||||
- !CarModel
|
||||
name: C4 SpaceTourer Shine Edition (2018)
|
||||
battery_power: 0
|
||||
fuel_capacity: 55
|
||||
abrp_name:
|
||||
reg: VF73DHNSPJ.*
|
||||
reg: VF73DHNSPJ
|
||||
- !CarModel
|
||||
name: C3 Feel Edition (2016)
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VF7SCHMZ6F.*
|
||||
reg: VF7SCHMZ6F
|
||||
- !CarModel
|
||||
name: Vauxhall Corsa (2020)
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VXKUPHNEKM.*
|
||||
reg: VXKUPHNEKM
|
||||
- !CarModel
|
||||
name: C5 Aircross Hybrid E Series
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 53
|
||||
abrp_name:
|
||||
reg: VR7ARHPYEP.*
|
||||
reg: VR7ARHPYEP
|
||||
- !CarModel
|
||||
name: Peugeot Rifter
|
||||
battery_power: 0
|
||||
fuel_capacity: 50
|
||||
abrp_name:
|
||||
reg: VR3ECYHYCK.*
|
||||
reg: VR3ECYHYCK
|
||||
max_elec_consumption: 0
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
@@ -612,7 +612,7 @@
|
||||
battery_power: 73
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e3008:24:77
|
||||
reg: VR3KCZKZ5R.*
|
||||
reg: VR3KCZKZ5R
|
||||
max_elec_consumption: 77
|
||||
max_fuel_consumption: 0
|
||||
- !CarModel
|
||||
@@ -620,7 +620,7 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 53
|
||||
abrp_name:
|
||||
reg: VF3M45GFUL.*
|
||||
reg: VF3M45GFUL
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -628,31 +628,31 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 55
|
||||
abrp_name:
|
||||
reg: VR3FHEHYRK.*
|
||||
reg: VR3FHEHYRK
|
||||
- !CarModel
|
||||
name: Citroen C3 Flair (2019)
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VF7SXHMRPK.*
|
||||
reg: VF7SXHMRPK
|
||||
- !CarModel
|
||||
name: C3 Saint james edition
|
||||
battery_power: 0
|
||||
fuel_capacity: 42
|
||||
abrp_name:
|
||||
reg: VF7SXHNP.*
|
||||
reg: VF7SXHNP
|
||||
- !CarModel
|
||||
name: C4 Shine 2023
|
||||
battery_power: 0
|
||||
fuel_capacity: 50
|
||||
abrp_name:
|
||||
reg: VR7BAHNSBP.*
|
||||
reg: VR7BAHNSBP
|
||||
- !CarModel
|
||||
name: C5 Aircross Hybrid 2024
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VR7A4DGL.*
|
||||
reg: VR7A4DGL
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
@@ -660,4 +660,180 @@
|
||||
battery_power: 0
|
||||
fuel_capacity: 52
|
||||
abrp_name:
|
||||
reg: VR3FPHNSTP.*
|
||||
reg: VR3FPHNSTP
|
||||
- !CarModel
|
||||
name: Citroën e-C3 IV
|
||||
battery_power: 44
|
||||
fuel_capacity: 0
|
||||
abrp_name:
|
||||
reg: VR7CBZYA0R
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: E-5008 73 kWh
|
||||
battery_power: 73
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e5008:25:77
|
||||
reg: VR3KCZKZ0S
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: 408 GT 1.2 Petrol
|
||||
battery_power: 0
|
||||
fuel_capacity: 52
|
||||
abrp_name:
|
||||
reg: VR3FPHPY0S
|
||||
- !CarModel
|
||||
name: SUV 3008 II
|
||||
battery_power: 0
|
||||
fuel_capacity: 53
|
||||
abrp_name:
|
||||
reg: VF3MRHNYWJ
|
||||
max_fuel_consumption: 30
|
||||
- !CarModel
|
||||
name: SUV 3008 Hybrid4 300-2
|
||||
battery_power: 13.2
|
||||
fuel_capacity: 43
|
||||
abrp_name:
|
||||
reg: VF3M45GBUP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: e-berlingo 2022+
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: Citroen;e-Berlingo;2022+
|
||||
reg: VR7EAZKXZM
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: e-3008
|
||||
battery_power: 73
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e3008:24:77
|
||||
reg: VR3KCZKZXR
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: Citroën C4 Piccasso
|
||||
battery_power: 0
|
||||
fuel_capacity: 55
|
||||
abrp_name:
|
||||
reg: VF73AHNSPJ
|
||||
- !ElecModel
|
||||
name: Astra L Sports Tourer Electric GS
|
||||
battery_power: 50.8
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:astrae:22:54:tour
|
||||
reg: VXKFNZKWXR
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: E-308 Allure
|
||||
battery_power: 50
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e308:23:54
|
||||
reg: VR3FMZKW3R
|
||||
- !ElecModel
|
||||
name: Citroen Ami
|
||||
battery_power: 5.35
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ami:20:5
|
||||
reg: VR79AZ2CAR
|
||||
max_elec_consumption: 6
|
||||
- !CarModel
|
||||
name: Spacetourer 2022 2.0 BlueHDi 140
|
||||
battery_power: 0
|
||||
fuel_capacity: 55
|
||||
abrp_name:
|
||||
reg: VF7VEEHTMN
|
||||
- !CarModel
|
||||
name: C5 Aircross 2020
|
||||
battery_power: 0
|
||||
fuel_capacity: 45
|
||||
abrp_name:
|
||||
reg: VR7ARHNSSM
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: corsa f electric
|
||||
battery_power: 48.1
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:corsae:23:54
|
||||
reg: VXKUHZKWZP
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !CarModel
|
||||
name: Opel Corsa F
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VXKUPHNSSP
|
||||
- !CarModel
|
||||
name: Opel Astra L
|
||||
battery_power: 0
|
||||
fuel_capacity: 52
|
||||
abrp_name:
|
||||
reg: VXKFPHNS2R
|
||||
- !CarModel
|
||||
name: 408 GT Hybrid 225
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F3DGY2R
|
||||
- !ElecModel
|
||||
name: E-C4X
|
||||
battery_power: 46
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ec4x:23:50
|
||||
reg: VR7BFZKX
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !CarModel
|
||||
name: E-308 SW
|
||||
battery_power: 50.8
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:e308:23:54
|
||||
reg: VR3FNZKW4R
|
||||
max_elec_consumption: 70
|
||||
- !CarModel
|
||||
name: 308 SW GT Hybrid
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F4DGY6R
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: Opel Astra Sports Tourer Electric
|
||||
battery_power: 50.5
|
||||
fuel_capacity: 0
|
||||
abrp_name: opel:astrae:22:54:tour
|
||||
reg: VXKFNZKW0R
|
||||
max_elec_consumption: 70
|
||||
- !ElecModel
|
||||
name: E-C4 54 kWh
|
||||
battery_power: 50.8
|
||||
fuel_capacity: 0
|
||||
abrp_name: citroen:ec4:23:54
|
||||
reg: VR7BCZKW
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !CarModel
|
||||
name: 408 GT 1.6 PHEV 225
|
||||
battery_power: 12.4
|
||||
fuel_capacity: 40
|
||||
abrp_name:
|
||||
reg: VR3F3DGY7
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 30
|
||||
- !ElecModel
|
||||
name: Zafira-e Life L3
|
||||
battery_power: 46.3
|
||||
fuel_capacity: 0
|
||||
abrp_name: peugeot:etraveler:21:50:opel
|
||||
reg: VXEVZZKXZM
|
||||
max_elec_consumption: 70
|
||||
max_fuel_consumption: 0
|
||||
- !CarModel
|
||||
name: Opel Corsa Facelift (2024)
|
||||
battery_power: 0
|
||||
fuel_capacity: 44
|
||||
abrp_name:
|
||||
reg: VXKUPHNEKR
|
||||
|
||||
+4
-6
@@ -346,12 +346,10 @@ class TestUnit(unittest.TestCase):
|
||||
|
||||
def test_regex(self):
|
||||
car_models = CarModelRepository().models
|
||||
for x in range(0, len(car_models)):
|
||||
for y in range(x + 1, len(car_models)):
|
||||
reg_a = car_models[x].reg
|
||||
reg_b = car_models[y].reg
|
||||
res: charclass = parse(reg_a) & parse(reg_b)
|
||||
self.assertTrue(res.empty(), msg=f"{reg_a} and {reg_b} can match the same string")
|
||||
model_by_reg = {}
|
||||
for model in car_models:
|
||||
self.assertFalse(model.reg in model_by_reg, f"duplicate vin prefix {model.reg}")
|
||||
model_by_reg[model.reg] = True
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user