ChaProEV 1.1.2__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. {chaproev-1.1.2 → chaproev-1.1.4}/.gitignore +1 -0
  2. {chaproev-1.1.2 → chaproev-1.1.4}/ChaProEV.toml +2 -3
  3. {chaproev-1.1.2/src/ChaProEV.egg-info → chaproev-1.1.4}/PKG-INFO +1 -1
  4. {chaproev-1.1.2 → chaproev-1.1.4}/pyproject.toml +1 -1
  5. {chaproev-1.1.2 → chaproev-1.1.4}/scenarios/Mopo/XX_bus.toml +25 -7
  6. {chaproev-1.1.2 → chaproev-1.1.4}/scenarios/Mopo/XX_car.toml +27 -9
  7. {chaproev-1.1.2 → chaproev-1.1.4}/scenarios/Mopo/XX_truck.toml +24 -6
  8. {chaproev-1.1.2 → chaproev-1.1.4}/scenarios/Mopo/XX_van.toml +24 -6
  9. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/ChaProEV.py +79 -79
  10. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/charging.py +61 -70
  11. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/consumption.py +66 -50
  12. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/define.py +118 -127
  13. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/make_variants.py +6 -0
  14. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/mobility.py +165 -170
  15. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/run_time.py +118 -69
  16. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/writing.py +19 -17
  17. {chaproev-1.1.2 → chaproev-1.1.4/src/ChaProEV.egg-info}/PKG-INFO +1 -1
  18. chaproev-1.1.4/tests/test_battery_space.py +59 -0
  19. chaproev-1.1.2/tests/test_battery_space.py +0 -50
  20. {chaproev-1.1.2 → chaproev-1.1.4}/.flake8 +0 -0
  21. {chaproev-1.1.2 → chaproev-1.1.4}/.vscode/ltex.dictionary.en-US.txt +0 -0
  22. {chaproev-1.1.2 → chaproev-1.1.4}/.vscode/settings.json +0 -0
  23. {chaproev-1.1.2 → chaproev-1.1.4}/ChaProEV.pptx +0 -0
  24. {chaproev-1.1.2 → chaproev-1.1.4}/Gemfile +0 -0
  25. {chaproev-1.1.2 → chaproev-1.1.4}/LICENCE +0 -0
  26. {chaproev-1.1.2 → chaproev-1.1.4}/MOPO_logo_chaproev on wht.svg +0 -0
  27. {chaproev-1.1.2 → chaproev-1.1.4}/MOPO_logo_chaproev.png +0 -0
  28. {chaproev-1.1.2 → chaproev-1.1.4}/MOPO_logo_chaproev.svg +0 -0
  29. {chaproev-1.1.2 → chaproev-1.1.4}/MOPO_logo_main.svg +0 -0
  30. {chaproev-1.1.2 → chaproev-1.1.4}/MOPO_logo_main_onwhite.svg +0 -0
  31. {chaproev-1.1.2 → chaproev-1.1.4}/README.md +0 -0
  32. {chaproev-1.1.2 → chaproev-1.1.4}/comparisons/comparison_template.toml +0 -0
  33. {chaproev-1.1.2 → chaproev-1.1.4}/docs/ChaProEV_workflow.png +0 -0
  34. {chaproev-1.1.2 → chaproev-1.1.4}/docs/Legs.png +0 -0
  35. {chaproev-1.1.2 → chaproev-1.1.4}/docs/Locations.png +0 -0
  36. {chaproev-1.1.2 → chaproev-1.1.4}/docs/Makefile +0 -0
  37. {chaproev-1.1.2 → chaproev-1.1.4}/docs/README.md +0 -0
  38. {chaproev-1.1.2 → chaproev-1.1.4}/docs/Trips.png +0 -0
  39. {chaproev-1.1.2 → chaproev-1.1.4}/docs/Vehicle_Temperature_correction_factor.svg +0 -0
  40. {chaproev-1.1.2 → chaproev-1.1.4}/docs/_config.yml +0 -0
  41. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/doctrees/environment.pickle +0 -0
  42. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/doctrees/index.doctree +0 -0
  43. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/.buildinfo +0 -0
  44. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_sources/index.rst.txt +0 -0
  45. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/alabaster.css +0 -0
  46. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/basic.css +0 -0
  47. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/custom.css +0 -0
  48. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/doctools.js +0 -0
  49. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/documentation_options.js +0 -0
  50. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/file.png +0 -0
  51. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/language_data.js +0 -0
  52. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/minus.png +0 -0
  53. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/plus.png +0 -0
  54. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/pygments.css +0 -0
  55. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/searchtools.js +0 -0
  56. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/_static/sphinx_highlight.js +0 -0
  57. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/genindex.html +0 -0
  58. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/index.html +0 -0
  59. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/objects.inv +0 -0
  60. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/search.html +0 -0
  61. {chaproev-1.1.2 → chaproev-1.1.4}/docs/build/html/searchindex.js +0 -0
  62. {chaproev-1.1.2 → chaproev-1.1.4}/docs/charging.md +0 -0
  63. {chaproev-1.1.2 → chaproev-1.1.4}/docs/consumption.md +0 -0
  64. {chaproev-1.1.2 → chaproev-1.1.4}/docs/define.md +0 -0
  65. {chaproev-1.1.2 → chaproev-1.1.4}/docs/index.md +0 -0
  66. {chaproev-1.1.2 → chaproev-1.1.4}/docs/make.bat +0 -0
  67. {chaproev-1.1.2 → chaproev-1.1.4}/docs/mobility.md +0 -0
  68. {chaproev-1.1.2 → chaproev-1.1.4}/docs/running_model,md +0 -0
  69. {chaproev-1.1.2 → chaproev-1.1.4}/docs/scenario.md +0 -0
  70. {chaproev-1.1.2 → chaproev-1.1.4}/docs/source/index.rst +0 -0
  71. {chaproev-1.1.2 → chaproev-1.1.4}/docs/using.md +0 -0
  72. {chaproev-1.1.2 → chaproev-1.1.4}/docs/weather.md +0 -0
  73. {chaproev-1.1.2 → chaproev-1.1.4}/eu-emblem-low-res.jpg +0 -0
  74. {chaproev-1.1.2 → chaproev-1.1.4}/mkdocs.yml +0 -0
  75. {chaproev-1.1.2 → chaproev-1.1.4}/requirements.txt +0 -0
  76. {chaproev-1.1.2 → chaproev-1.1.4}/scenarios/local_impact_BEVs/baseline.toml +0 -0
  77. {chaproev-1.1.2 → chaproev-1.1.4}/setup.cfg +0 -0
  78. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/__init__.py +0 -0
  79. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/py.typed +0 -0
  80. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV/weather.py +0 -0
  81. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/PKG-INFO-PC-28624 +0 -0
  82. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/PKG-INFO-PC-28624-2 +0 -0
  83. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/SOURCES-PC-28624-2.txt +0 -0
  84. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/SOURCES-PC-28624.txt +0 -0
  85. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/SOURCES.txt +0 -0
  86. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/dependency_links.txt +0 -0
  87. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/requires-PC-28624-2.txt +0 -0
  88. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/requires-PC-28624.txt +0 -0
  89. {chaproev-1.1.2 → chaproev-1.1.4}/src/ChaProEV.egg-info/top_level.txt +0 -0
  90. {chaproev-1.1.2 → chaproev-1.1.4}/tests/test_empty_values.py +0 -0
  91. {chaproev-1.1.2 → chaproev-1.1.4}/tests/test_same_output.py +0 -0
  92. {chaproev-1.1.2 → chaproev-1.1.4}/todo.txt +0 -0
  93. {chaproev-1.1.2 → chaproev-1.1.4}/variants/Mopo/XX_car.csv +0 -0
  94. {chaproev-1.1.2 → chaproev-1.1.4}/variants/Mopo.toml +0 -0
@@ -8,3 +8,4 @@ site/
8
8
  .venv/
9
9
  reference_run/
10
10
  reference_run_prev/
11
+ reference_run_previous/
@@ -5,10 +5,9 @@ csv_version = true
5
5
  use_years_in_profiles = true
6
6
 
7
7
  [parallel_processing]
8
- [parallel_processing.number_of_parallel_processes]
9
8
  set_amount_of_processes = false
10
- for_scenarios = 4
11
- for_pickle_saves = 4
9
+ amount_for_scenarios = 4
10
+ amount_for_pickle_saves = 4
12
11
 
13
12
  [interim_files]
14
13
  pickle = false
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ChaProEV
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: ChaProEV: Charging Profiles of Electric Vehicles
5
5
  Author-email: Omar Usmani <Omar.Usmani@TNO.nl>
6
6
  Project-URL: Homepage, https://github.com/TNO/ChaProEV
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'ChaProEV'
7
- version = '1.1.2'
7
+ version = '1.1.4'
8
8
  authors = [
9
9
  { name='Omar Usmani', email='Omar.Usmani@TNO.nl' },
10
10
  ]
@@ -11,13 +11,25 @@
11
11
  [run]
12
12
  use_day_types_in_charge_computing = true
13
13
  [run.start]
14
- year = 2020
15
- month = 1
16
- day = 1
14
+ year = 2017
15
+ month = 12
16
+ day = 31
17
17
  hour = 5
18
18
  minute = 0
19
19
  [run.end] # This is is not included in the run time
20
- year = 2021
20
+ year = 2019
21
+ month = 1
22
+ day = 1
23
+ hour = 0
24
+ minute = 0
25
+ [run.display_start]
26
+ year = 2018
27
+ month = 1
28
+ day = 1
29
+ hour = 0
30
+ minute = 0
31
+ [run.display_end] # This is is not included in the display time
32
+ year = 2019
21
33
  month = 1
22
34
  day = 1
23
35
  hour = 0
@@ -28,6 +40,12 @@ type = 'h' # 'min'
28
40
  # Put the interval type here, use 'H' for hours, 'min' for minutes,
29
41
  # 'S' for seconds, 'D' for days. For more info and other types, see here:
30
42
  # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
43
+ [run.display_frequency]
44
+ size = 1 # Put the size of the interval here
45
+ type = 'h' # 'min'
46
+ # Put the interval type here, use 'H' for hours, 'min' for minutes,
47
+ # 'S' for seconds, 'D' for days. For more info and other types, see here:
48
+ # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
31
49
  [run.get_extra_downloads]
32
50
  download_weather_data = false
33
51
  # Put true if you want to download the weather data. In principle,
@@ -59,7 +77,7 @@ percentage_in_location_at_run_start = 1
59
77
  # If filling it directly instead of computing it (controlled by
60
78
  # compute_start_location_split in mobility_module below)
61
79
  vehicle_discharge_power = 400 # kW
62
- proportion_of_discharge_going_to_network = 0.9
80
+ proportion_of_discharge_to_network = 0.9
63
81
  [locations.bus_route_start]
64
82
  vehicle = 'bus'
65
83
  connectivity = 1
@@ -74,7 +92,7 @@ percentage_in_location_at_run_start = 1
74
92
  # If filling it directly instead of computing it (controlled by
75
93
  # compute_start_location_split in mobility_module below)
76
94
  vehicle_discharge_power = 0 # kW
77
- proportion_of_discharge_going_to_network = 0.9
95
+ proportion_of_discharge_to_network = 0.9
78
96
  [locations.bus_route_end]
79
97
  vehicle = 'bus'
80
98
  connectivity = 1
@@ -89,7 +107,7 @@ percentage_in_location_at_run_start = 1
89
107
  # If filling it directly instead of computing it (controlled by
90
108
  # compute_start_location_split in mobility_module below)
91
109
  vehicle_discharge_power = 0 # kW
92
- proportion_of_discharge_going_to_network = 0.9
110
+ proportion_of_discharge_to_network = 0.9
93
111
 
94
112
  [legs]
95
113
  # You can add legs here by copying existing legs,
@@ -11,13 +11,25 @@
11
11
  [run]
12
12
  use_day_types_in_charge_computing = true
13
13
  [run.start]
14
- year = 2020
15
- month = 1
16
- day = 1
14
+ year = 2017
15
+ month = 12
16
+ day = 31
17
17
  hour = 5
18
18
  minute = 0
19
19
  [run.end] # This is is not included in the run time
20
- year = 2021
20
+ year = 2019
21
+ month = 1
22
+ day = 1
23
+ hour = 0
24
+ minute = 0
25
+ [run.display_start]
26
+ year = 2018
27
+ month = 1
28
+ day = 1
29
+ hour = 0
30
+ minute = 0
31
+ [run.display_end] # This is is not included in the display time
32
+ year = 2019
21
33
  month = 1
22
34
  day = 1
23
35
  hour = 0
@@ -28,6 +40,12 @@ type = 'h' # 'min'
28
40
  # Put the interval type here, use 'H' for hours, 'min' for minutes,
29
41
  # 'S' for seconds, 'D' for days. For more info and other types, see here:
30
42
  # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
43
+ [run.display_frequency]
44
+ size = 1 # Put the size of the interval here
45
+ type = 'h' # 'min'
46
+ # Put the interval type here, use 'H' for hours, 'min' for minutes,
47
+ # 'S' for seconds, 'D' for days. For more info and other types, see here:
48
+ # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
31
49
  [run.get_extra_downloads]
32
50
  download_weather_data = false
33
51
  # Put true if you want to download the weather data. In principle,
@@ -59,7 +77,7 @@ percentage_in_location_at_run_start = 1
59
77
  # If filling it directly instead of computing it (controlled by
60
78
  # compute_start_location_split in mobility_module below)
61
79
  vehicle_discharge_power = 4.2 # kW
62
- proportion_of_discharge_going_to_network = 0.9
80
+ proportion_of_discharge_to_network = 0.9
63
81
  [locations.work]
64
82
  vehicle = 'car'
65
83
  connectivity = 0.25
@@ -74,7 +92,7 @@ percentage_in_location_at_run_start = 0
74
92
  # If filling it directly instead of computing it (controlled by
75
93
  # compute_start_location_split in mobility_module below)
76
94
  vehicle_discharge_power = 6.6 # kW
77
- proportion_of_discharge_going_to_network = 0.9
95
+ proportion_of_discharge_to_network = 0.9
78
96
  [locations.leisure]
79
97
  vehicle = 'car'
80
98
  connectivity = 0.25
@@ -89,7 +107,7 @@ percentage_in_location_at_run_start = 0
89
107
  # If filling it directly instead of computing it (controlled by
90
108
  # compute_start_location_split in mobility_module below)
91
109
  vehicle_discharge_power = 0 # kW
92
- proportion_of_discharge_going_to_network = 0.9
110
+ proportion_of_discharge_to_network = 0.9
93
111
  [locations.weekend]
94
112
  vehicle = 'car'
95
113
  connectivity = 0.1
@@ -104,7 +122,7 @@ percentage_in_location_at_run_start = 0
104
122
  # If filling it directly instead of computing it (controlled by
105
123
  # compute_start_location_split in mobility_module below)
106
124
  vehicle_discharge_power = 0 # kW
107
- proportion_of_discharge_going_to_network = 0.9
125
+ proportion_of_discharge_to_network = 0.9
108
126
  [locations.holiday]
109
127
  vehicle = 'car'
110
128
  connectivity = 1
@@ -119,7 +137,7 @@ percentage_in_location_at_run_start = 0
119
137
  # If filling it directly instead of computing it (controlled by
120
138
  # compute_start_location_split in mobility_module below)
121
139
  vehicle_discharge_power = 11 # kW
122
- proportion_of_discharge_going_to_network = 0.9
140
+ proportion_of_discharge_to_network = 0.9
123
141
 
124
142
  [legs]
125
143
  # You can add legs here by copying existing legs,
@@ -11,13 +11,25 @@
11
11
  [run]
12
12
  use_day_types_in_charge_computing = true
13
13
  [run.start]
14
- year = 2020
15
- month = 1
16
- day = 1
14
+ year = 2017
15
+ month = 12
16
+ day = 31
17
17
  hour = 5
18
18
  minute = 0
19
19
  [run.end] # This is is not included in the run time
20
- year = 2021
20
+ year = 2019
21
+ month = 1
22
+ day = 1
23
+ hour = 0
24
+ minute = 0
25
+ [run.display_start]
26
+ year = 2018
27
+ month = 1
28
+ day = 1
29
+ hour = 0
30
+ minute = 0
31
+ [run.display_end] # This is is not included in the display time
32
+ year = 2019
21
33
  month = 1
22
34
  day = 1
23
35
  hour = 0
@@ -28,6 +40,12 @@ type = 'h' # 'min'
28
40
  # Put the interval type here, use 'H' for hours, 'min' for minutes,
29
41
  # 'S' for seconds, 'D' for days. For more info and other types, see here:
30
42
  # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
43
+ [run.display_frequency]
44
+ size = 1 # Put the size of the interval here
45
+ type = 'h' # 'min'
46
+ # Put the interval type here, use 'H' for hours, 'min' for minutes,
47
+ # 'S' for seconds, 'D' for days. For more info and other types, see here:
48
+ # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
31
49
  [run.get_extra_downloads]
32
50
  download_weather_data = false
33
51
  # Put true if you want to download the weather data. In principle,
@@ -59,7 +77,7 @@ percentage_in_location_at_run_start = 1
59
77
  # If filling it directly instead of computing it (controlled by
60
78
  # compute_start_location_split in mobility_module below)
61
79
  vehicle_discharge_power = 150 # kW
62
- proportion_of_discharge_going_to_network = 0.9
80
+ proportion_of_discharge_to_network = 0.9
63
81
  [locations.truck_customer]
64
82
  vehicle = 'truck'
65
83
  connectivity = 0.1
@@ -74,7 +92,7 @@ percentage_in_location_at_run_start = 1
74
92
  # If filling it directly instead of computing it (controlled by
75
93
  # compute_start_location_split in mobility_module below)
76
94
  vehicle_discharge_power = 0 # kW
77
- proportion_of_discharge_going_to_network = 0.9
95
+ proportion_of_discharge_to_network = 0.9
78
96
 
79
97
  [legs]
80
98
  # You can add legs here by copying existing legs,
@@ -11,13 +11,25 @@
11
11
  [run]
12
12
  use_day_types_in_charge_computing = true
13
13
  [run.start]
14
- year = 2020
15
- month = 1
16
- day = 1
14
+ year = 2017
15
+ month = 12
16
+ day = 31
17
17
  hour = 5
18
18
  minute = 0
19
19
  [run.end] # This is is not included in the run time
20
- year = 2021
20
+ year = 2019
21
+ month = 1
22
+ day = 1
23
+ hour = 0
24
+ minute = 0
25
+ [run.display_start]
26
+ year = 2018
27
+ month = 1
28
+ day = 1
29
+ hour = 0
30
+ minute = 0
31
+ [run.display_end] # This is is not included in the display time
32
+ year = 2019
21
33
  month = 1
22
34
  day = 1
23
35
  hour = 0
@@ -28,6 +40,12 @@ type = 'h' # 'min'
28
40
  # Put the interval type here, use 'H' for hours, 'min' for minutes,
29
41
  # 'S' for seconds, 'D' for days. For more info and other types, see here:
30
42
  # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
43
+ [run.display_frequency]
44
+ size = 1 # Put the size of the interval here
45
+ type = 'h' # 'min'
46
+ # Put the interval type here, use 'H' for hours, 'min' for minutes,
47
+ # 'S' for seconds, 'D' for days. For more info and other types, see here:
48
+ # https://pandas.pydata.org/docs/user_guide/timeseries.html#timeseries-offset-aliases
31
49
  [run.get_extra_downloads]
32
50
  download_weather_data = false
33
51
  # Put true if you want to download the weather data. In principle,
@@ -59,7 +77,7 @@ percentage_in_location_at_run_start = 1
59
77
  # If filling it directly instead of computing it (controlled by
60
78
  # compute_start_location_split in mobility_module below)
61
79
  vehicle_discharge_power = 100 # kW
62
- proportion_of_discharge_going_to_network = 0.9
80
+ proportion_of_discharge_to_network = 0.9
63
81
  [locations.van_customer]
64
82
  vehicle = 'van'
65
83
  connectivity = 0.1
@@ -74,7 +92,7 @@ percentage_in_location_at_run_start = 1
74
92
  # If filling it directly instead of computing it (controlled by
75
93
  # compute_start_location_split in mobility_module below)
76
94
  vehicle_discharge_power = 0 # kW
77
- proportion_of_discharge_going_to_network = 0.9
95
+ proportion_of_discharge_to_network = 0.9
78
96
 
79
97
 
80
98
  [legs]
@@ -11,6 +11,7 @@ from multiprocessing import Pool
11
11
 
12
12
  import numpy as np
13
13
  import pandas as pd
14
+ from box import Box
14
15
  from ETS_CookBook import ETS_CookBook as cook
15
16
 
16
17
  try:
@@ -106,29 +107,27 @@ except ModuleNotFoundError:
106
107
  # we are importing again
107
108
 
108
109
 
109
- def car_home_parking(case_name: str, general_parameters: ty.Dict) -> None:
110
- home_type_parameters: ty.Dict = general_parameters['home_type']
111
- input_root: str = general_parameters['files']['input_root']
110
+ def car_home_parking(case_name: str, general_parameters: Box) -> None:
111
+ home_type_parameters: Box = general_parameters.home_type
112
+ input_root: str = general_parameters.files.input_root
112
113
  input_folder: str = f'{input_root}/{case_name}'
113
- percentages_file_name: str = home_type_parameters['percentages_file']
114
+ percentages_file_name: str = home_type_parameters.percentages_file
114
115
  car_drivewway_percentages: pd.DataFrame = pd.read_csv(
115
116
  f'{input_folder}/{percentages_file_name}'
116
- ).set_index(home_type_parameters['index_name'])
117
+ ).set_index(home_type_parameters.index_name)
117
118
 
118
- profiles_index: ty.List[str] = home_type_parameters['profiles_index']
119
- own_driveway_name: str = home_type_parameters['own_driveway_name']
120
- on_street_name: str = home_type_parameters['on_street_name']
119
+ profiles_index: ty.List[str] = home_type_parameters.profiles_index
120
+ own_driveway_name: str = home_type_parameters.own_driveway_name
121
+ on_street_name: str = home_type_parameters.on_street_name
121
122
 
122
- output_root: ty.Dict = general_parameters['files']['output_root']
123
+ output_root: str = general_parameters.files.output_root
123
124
  output_folder: str = f'{output_root}/{case_name}'
124
125
 
125
- consumption_parameters: ty.Dict = general_parameters['consumption']
126
- consumption_table_name: str = consumption_parameters[
127
- 'consumption_table_name'
128
- ]
129
- use_years_in_profiles: bool = general_parameters['variants'][
130
- 'use_years_in_profiles'
131
- ]
126
+ consumption_parameters: Box = general_parameters.consumption
127
+ consumption_table_name: str = consumption_parameters.consumption_table_name
128
+ use_years_in_profiles: bool = (
129
+ general_parameters.variants.use_years_in_profiles
130
+ )
132
131
 
133
132
  variant_names: ty.List[str] = list(car_drivewway_percentages.index)
134
133
  for variant_name in variant_names:
@@ -191,47 +190,40 @@ def car_home_parking(case_name: str, general_parameters: ty.Dict) -> None:
191
190
  f'{output_folder}/{variant_name}_{consumption_table_name}.pkl'
192
191
  )
193
192
 
194
- do_fleet_tables: float = general_parameters['profile_dataframe'][
195
- 'do_fleet_tables'
196
- ]
193
+ do_fleet_tables: float = (
194
+ general_parameters.profile_dataframe.do_fleet_tables
195
+ )
197
196
  if do_fleet_tables:
198
197
  fleet_profiles(case_name, variant_name, general_parameters)
199
198
 
200
199
 
201
200
  def fleet_profiles(
202
- case_name: str, scenario_name: str, general_parameters: ty.Dict
201
+ case_name: str, scenario_name: str, general_parameters: Box
203
202
  ) -> None:
204
- home_type_parameters: ty.Dict = general_parameters['home_type']
205
- consumption_parameters: ty.Dict = general_parameters['consumption']
206
- consumption_table_name: str = consumption_parameters[
207
- 'consumption_table_name'
208
- ]
203
+ home_type_parameters: Box = general_parameters.home_type
204
+ consumption_parameters: Box = general_parameters.consumption
205
+ consumption_table_name: str = consumption_parameters.consumption_table_name
206
+
207
+ distance_header: str = consumption_parameters.distance_header
208
+ fleet_distance_header: str = consumption_parameters.fleet_distance_header
209
+
210
+ energy_carriers_consumption_names: ty.List[str] = (
211
+ consumption_parameters.energy_carriers_consumption_names
212
+ )
209
213
 
210
- distance_header: str = consumption_parameters['distance_header']
211
- fleet_distance_header: str = consumption_parameters[
212
- 'fleet_distance_header'
213
- ]
214
- energy_carriers_consumption_names: ty.List[str] = consumption_parameters[
215
- 'energy_carriers_consumption_names'
216
- ]
217
214
  fleet_energy_carriers_consumption_names: ty.List[str] = (
218
- consumption_parameters['fleet_energy_carriers_consumption_names']
215
+ consumption_parameters.fleet_energy_carriers_consumption_names
219
216
  )
220
- energy_carriers: ty.List[str] = consumption_parameters['energy_carriers']
221
- output_root: ty.Dict = general_parameters['files']['output_root']
217
+ energy_carriers: ty.List[str] = consumption_parameters.energy_carriers
218
+ output_root: str = general_parameters.files.output_root
222
219
  output_folder: str = f'{output_root}/{case_name}'
223
- profiles_index: ty.List[str] = home_type_parameters['profiles_index']
224
- profile_headers: ty.List = general_parameters['profile_dataframe'][
225
- 'headers'
226
- ]
227
- fleet_headers: ty.List = general_parameters['profile_dataframe'][
228
- 'fleet_headers'
229
- ]
230
- input_root: str = general_parameters['files']['input_root']
220
+ profiles_index: ty.List[str] = home_type_parameters.profiles_index
221
+ profile_headers: ty.List = general_parameters.profile_dataframe.headers
222
+ fleet_headers: ty.List = general_parameters.profile_dataframe.fleet_headers
223
+
224
+ input_root: str = general_parameters.files.input_root
231
225
  input_folder: str = f'{input_root}/{case_name}'
232
- fleet_file_name: str = general_parameters['profile_dataframe'][
233
- 'fleet_file_name'
234
- ]
226
+ fleet_file_name: str = general_parameters.profile_dataframe.fleet_file_name
235
227
 
236
228
  fleet_split: pd.DataFrame = pd.read_csv(
237
229
  f'{input_folder}/{fleet_file_name}'
@@ -241,7 +233,7 @@ def fleet_profiles(
241
233
  fleet_split.loc[scenario_name]['Total Fleet (thousands)']
242
234
  )
243
235
  consumption_table: pd.DataFrame = pd.read_pickle(
244
- f'{output_folder}/{scenario_name}_' f'{consumption_table_name}.pkl'
236
+ f'{output_folder}/{scenario_name}_{consumption_table_name}.pkl'
245
237
  )
246
238
  fleet_consumption_table: pd.DataFrame = pd.DataFrame(
247
239
  index=consumption_table.index
@@ -294,9 +286,9 @@ def fleet_profiles(
294
286
 
295
287
 
296
288
  def run_scenario(
297
- scenario: ty.Dict, case_name: str, general_parameters: ty.Dict
289
+ scenario: Box, case_name: str, general_parameters: Box
298
290
  ) -> None:
299
- scenario_name: str = scenario['scenario_name']
291
+ scenario_name: str = scenario.name
300
292
  print(scenario_name)
301
293
  decla_start: datetime.datetime = datetime.datetime.now()
302
294
  location_connections, legs, locations, trips = (
@@ -367,7 +359,7 @@ def run_scenario(
367
359
  (datetime.datetime.now() - charge_start).total_seconds(),
368
360
  )
369
361
 
370
- battery_capacity: float = scenario['vehicle']['battery_capacity']
362
+ battery_capacity: float = scenario.vehicle.battery_capacity
371
363
  battery_capacity_dataframe: pd.DataFrame = (
372
364
  battery_capacity * location_split
373
365
  )
@@ -377,7 +369,7 @@ def run_scenario(
377
369
 
378
370
  connectivities: np.ndarray = np.array(
379
371
  [
380
- scenario['locations'][dataframe_location]['connectivity']
372
+ scenario.locations[dataframe_location].connectivity
381
373
  for dataframe_location in battery_capacity_dataframe.columns
382
374
  ]
383
375
  )
@@ -404,9 +396,9 @@ def run_scenario(
404
396
  vehicle_discharge_power_per_location,
405
397
  discharge_power_to_network_per_location,
406
398
  ]
407
- profile_dataframe_headers: ty.List[str] = general_parameters[
408
- 'profile_dataframe'
409
- ]['headers']
399
+ profile_dataframe_headers: ty.List[str] = (
400
+ general_parameters.profile_dataframe.headers
401
+ )
410
402
  profile_dataframe: pd.DataFrame = run_time.get_time_stamped_dataframe(
411
403
  scenario, general_parameters, locations_as_columns=False
412
404
  )
@@ -416,18 +408,24 @@ def run_scenario(
416
408
 
417
409
  profile_dataframe[dataframe_header] = dataframe_for_profile.sum(axis=1)
418
410
 
419
- output_root: str = general_parameters['files']['output_root']
411
+ output_root: str = general_parameters.files.output_root
420
412
  output_folder: str = f'{output_root}/{case_name}'
413
+ display_range: pd.DatetimeIndex = run_time.get_time_range(
414
+ scenario, general_parameters
415
+ )[2]
416
+ profile_dataframe = profile_dataframe.loc[display_range]
417
+ profile_dataframe.index.name = 'Time Tag'
421
418
  profile_dataframe.to_pickle(f'{output_folder}/{scenario_name}_profile.pkl')
422
419
 
423
- do_fleet_tables: float = general_parameters['profile_dataframe'][
424
- 'do_fleet_tables'
425
- ]
420
+ do_fleet_tables: float = (
421
+ general_parameters.profile_dataframe.do_fleet_tables
422
+ )
423
+
426
424
  if do_fleet_tables:
427
425
  fleet_profiles(case_name, scenario_name, general_parameters)
428
426
 
429
427
 
430
- def load_scenarios(case_name: str) -> ty.List[ty.Dict]:
428
+ def load_scenarios(case_name: str) -> ty.List[Box]:
431
429
  scenario_folder_files: ty.List[str] = os.listdir(f'scenarios/{case_name}')
432
430
  scenario_files: ty.List[str] = [
433
431
  scenario_folder_file
@@ -438,49 +436,51 @@ def load_scenarios(case_name: str) -> ty.List[ty.Dict]:
438
436
  f'scenarios/{case_name}/{scenario_file}'
439
437
  for scenario_file in scenario_files
440
438
  ]
441
- scenarios: ty.List[ty.Dict] = [
442
- cook.parameters_from_TOML(scenario_file_path)
439
+ scenarios: ty.List[Box] = [
440
+ Box(cook.parameters_from_TOML(scenario_file_path))
443
441
  for scenario_file_path in scenario_file_paths
444
442
  ]
445
443
  for scenario, scenario_file in zip(scenarios, scenario_files):
446
- scenario['scenario_name'] = scenario_file.split('.')[0]
444
+ scenario.name = scenario_file.split('.')[0]
447
445
  return scenarios
448
446
 
449
447
 
450
448
  def run_ChaProEV(case_name: str) -> None:
451
449
  start_: datetime.datetime = datetime.datetime.now()
452
450
  general_parameters_file_name: str = 'ChaProEV.toml'
453
- general_parameters: ty.Dict = cook.parameters_from_TOML(
454
- general_parameters_file_name
451
+ general_parameters: Box = Box(
452
+ cook.parameters_from_TOML(general_parameters_file_name)
455
453
  )
456
- output_root: str = general_parameters['files']['output_root']
454
+ output_root: str = general_parameters.files.output_root
457
455
  cook.check_if_folder_exists(f'{output_root}/{case_name}')
458
- use_variants = general_parameters['variants']['use_variants']
456
+ variant_parameters: Box = general_parameters.variants
457
+ use_variants: bool = variant_parameters.use_variants
459
458
  if use_variants:
460
- csv_version = general_parameters['variants']['csv_version']
459
+ csv_version: bool = variant_parameters.csv_version
461
460
  make_variants.make_variants(case_name, csv_version)
462
461
 
463
- scenarios: ty.List[ty.Dict] = load_scenarios(case_name)
462
+ scenarios: ty.List[Box] = load_scenarios(case_name)
464
463
 
465
- set_amount_of_processes: bool = general_parameters['parallel_processing'][
466
- 'number_of_parallel_processes'
467
- ]['set_amount_of_processes']
464
+ set_amount_of_processes: bool = (
465
+ general_parameters.parallel_processing.set_amount_of_processes
466
+ )
468
467
  if set_amount_of_processes:
469
- number_of_parallel_processes: int | None = None
468
+ amount_of_parallel_processes: int | None = None
470
469
  else:
471
- number_of_parallel_processes = general_parameters[
472
- 'parallel_processing'
473
- ]['number_of_parallel_processes']['for_scenarios']
470
+ amount_of_parallel_processes = (
471
+ general_parameters.parallel_processing.amount_for_scenarios
472
+ )
474
473
 
475
- with Pool(number_of_parallel_processes) as scenarios_pool:
474
+ with Pool(amount_of_parallel_processes) as scenarios_pool:
476
475
  scenarios_pool.starmap(
477
476
  run_scenario,
478
477
  zip(scenarios, repeat(case_name), repeat(general_parameters)),
479
478
  )
480
479
 
481
- do_car_home_type_split: bool = general_parameters['home_type'][
482
- 'do_car_home_type_split'
483
- ]
480
+ do_car_home_type_split: bool = (
481
+ general_parameters.home_type.do_car_home_type_split
482
+ )
483
+
484
484
  if do_car_home_type_split:
485
485
  car_home_parking(case_name, general_parameters)
486
486