ChaProEV 1.3.2__tar.gz → 1.3.3__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 (149) hide show
  1. {chaproev-1.3.2/src/ChaProEV.egg-info → chaproev-1.3.3}/PKG-INFO +2 -2
  2. {chaproev-1.3.2 → chaproev-1.3.3}/pyproject.toml +1 -1
  3. {chaproev-1.3.2 → chaproev-1.3.3}/requirements.txt +1 -1
  4. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/ChaProEV.py +3 -3
  5. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/charging.py +1 -0
  6. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/consumption.py +2 -2
  7. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/mobility.py +7 -31
  8. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/run_time.py +3 -2
  9. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/scenarios_module.py +2 -1
  10. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/writing.py +3 -2
  11. {chaproev-1.3.2 → chaproev-1.3.3/src/ChaProEV.egg-info}/PKG-INFO +2 -2
  12. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/SOURCES.txt +2 -2
  13. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/requires.txt +1 -1
  14. {chaproev-1.3.2 → chaproev-1.3.3}/tests/test_battery_space.py +6 -11
  15. {chaproev-1.3.2 → chaproev-1.3.3}/tests/test_charge_and_consumption.py +1 -2
  16. chaproev-1.3.3/tests/test_enough_power_next_leg.py +44 -0
  17. {chaproev-1.3.2 → chaproev-1.3.3}/tests/test_same_output.py +1 -3
  18. chaproev-1.3.2/scenarios/Mopo/XX_car_test.toml +0 -756
  19. {chaproev-1.3.2 → chaproev-1.3.3}/.flake8 +0 -0
  20. {chaproev-1.3.2 → chaproev-1.3.3}/.gitignore +0 -0
  21. {chaproev-1.3.2 → chaproev-1.3.3}/.vscode/ltex.dictionary.en-US.txt +0 -0
  22. {chaproev-1.3.2 → chaproev-1.3.3}/.vscode/settings.json +0 -0
  23. {chaproev-1.3.2 → chaproev-1.3.3}/ChaProEV.pptx +0 -0
  24. {chaproev-1.3.2 → chaproev-1.3.3}/ChaProEV.toml +0 -0
  25. {chaproev-1.3.2 → chaproev-1.3.3}/ChaProEV_test_case_configuration_files.zip +0 -0
  26. {chaproev-1.3.2 → chaproev-1.3.3}/Gemfile +0 -0
  27. {chaproev-1.3.2 → chaproev-1.3.3}/LICENCE +0 -0
  28. {chaproev-1.3.2 → chaproev-1.3.3}/MOPO_logo_chaproev on wht.svg +0 -0
  29. {chaproev-1.3.2 → chaproev-1.3.3}/MOPO_logo_chaproev.png +0 -0
  30. {chaproev-1.3.2 → chaproev-1.3.3}/MOPO_logo_chaproev.svg +0 -0
  31. {chaproev-1.3.2 → chaproev-1.3.3}/MOPO_logo_main.svg +0 -0
  32. {chaproev-1.3.2 → chaproev-1.3.3}/MOPO_logo_main_onwhite.svg +0 -0
  33. {chaproev-1.3.2 → chaproev-1.3.3}/README-PC-28624.md +0 -0
  34. {chaproev-1.3.2 → chaproev-1.3.3}/README.md +0 -0
  35. {chaproev-1.3.2 → chaproev-1.3.3}/chaproev-1.3.0/.flake8 +0 -0
  36. {chaproev-1.3.2 → chaproev-1.3.3}/chaproev-1.3.0/.gitignore +0 -0
  37. {chaproev-1.3.2 → chaproev-1.3.3}/comparisons/comparison_template.toml +0 -0
  38. {chaproev-1.3.2 → chaproev-1.3.3}/docs/ChaProEV_workflow.png +0 -0
  39. {chaproev-1.3.2 → chaproev-1.3.3}/docs/Legs.png +0 -0
  40. {chaproev-1.3.2 → chaproev-1.3.3}/docs/Locations.png +0 -0
  41. {chaproev-1.3.2 → chaproev-1.3.3}/docs/Makefile +0 -0
  42. {chaproev-1.3.2 → chaproev-1.3.3}/docs/Trips.png +0 -0
  43. {chaproev-1.3.2 → chaproev-1.3.3}/docs/Vehicle_Temperature_correction_factor.svg +0 -0
  44. {chaproev-1.3.2 → chaproev-1.3.3}/docs/_config.yml +0 -0
  45. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/doctrees/environment.pickle +0 -0
  46. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/doctrees/index.doctree +0 -0
  47. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/.buildinfo +0 -0
  48. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_sources/index.rst.txt +0 -0
  49. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/alabaster.css +0 -0
  50. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/basic.css +0 -0
  51. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/custom.css +0 -0
  52. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/doctools.js +0 -0
  53. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/documentation_options.js +0 -0
  54. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/file.png +0 -0
  55. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/language_data.js +0 -0
  56. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/minus.png +0 -0
  57. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/plus.png +0 -0
  58. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/pygments.css +0 -0
  59. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/searchtools.js +0 -0
  60. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/_static/sphinx_highlight.js +0 -0
  61. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/genindex.html +0 -0
  62. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/index.html +0 -0
  63. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/objects.inv +0 -0
  64. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/search.html +0 -0
  65. {chaproev-1.3.2 → chaproev-1.3.3}/docs/build/html/searchindex.js +0 -0
  66. {chaproev-1.3.2 → chaproev-1.3.3}/docs/charging.md +0 -0
  67. {chaproev-1.3.2 → chaproev-1.3.3}/docs/consumption-PC-28624.md +0 -0
  68. {chaproev-1.3.2 → chaproev-1.3.3}/docs/consumption.md +0 -0
  69. {chaproev-1.3.2 → chaproev-1.3.3}/docs/define-PC-28624.md +0 -0
  70. {chaproev-1.3.2 → chaproev-1.3.3}/docs/define.md +0 -0
  71. {chaproev-1.3.2 → chaproev-1.3.3}/docs/general_parameters-PC-28624.md +0 -0
  72. {chaproev-1.3.2 → chaproev-1.3.3}/docs/general_parameters.md +0 -0
  73. {chaproev-1.3.2 → chaproev-1.3.3}/docs/index-PC-28624.md +0 -0
  74. {chaproev-1.3.2 → chaproev-1.3.3}/docs/index.md +0 -0
  75. {chaproev-1.3.2 → chaproev-1.3.3}/docs/input.md +0 -0
  76. {chaproev-1.3.2 → chaproev-1.3.3}/docs/make.bat +0 -0
  77. {chaproev-1.3.2 → chaproev-1.3.3}/docs/make_variants.md +0 -0
  78. {chaproev-1.3.2 → chaproev-1.3.3}/docs/mobility-PC-28624.md +0 -0
  79. {chaproev-1.3.2 → chaproev-1.3.3}/docs/mobility.md +0 -0
  80. {chaproev-1.3.2 → chaproev-1.3.3}/docs/multiprocessing.md +0 -0
  81. {chaproev-1.3.2 → chaproev-1.3.3}/docs/non_road.md +0 -0
  82. {chaproev-1.3.2 → chaproev-1.3.3}/docs/outputs.md +0 -0
  83. {chaproev-1.3.2 → chaproev-1.3.3}/docs/parallel_processing.md +0 -0
  84. {chaproev-1.3.2 → chaproev-1.3.3}/docs/profiles.md +0 -0
  85. {chaproev-1.3.2 → chaproev-1.3.3}/docs/run_time.md +0 -0
  86. {chaproev-1.3.2 → chaproev-1.3.3}/docs/running_model.md +0 -0
  87. {chaproev-1.3.2 → chaproev-1.3.3}/docs/scenario-PC-28624.md +0 -0
  88. {chaproev-1.3.2 → chaproev-1.3.3}/docs/scenario.md +0 -0
  89. {chaproev-1.3.2 → chaproev-1.3.3}/docs/scenarios_module.md +0 -0
  90. {chaproev-1.3.2 → chaproev-1.3.3}/docs/source/index.rst +0 -0
  91. {chaproev-1.3.2 → chaproev-1.3.3}/docs/using-PC-28624.md +0 -0
  92. {chaproev-1.3.2 → chaproev-1.3.3}/docs/using.md +0 -0
  93. {chaproev-1.3.2 → chaproev-1.3.3}/docs/variants-PC-28624.md +0 -0
  94. {chaproev-1.3.2 → chaproev-1.3.3}/docs/variants.md +0 -0
  95. {chaproev-1.3.2 → chaproev-1.3.3}/docs/weather-PC-28624.md +0 -0
  96. {chaproev-1.3.2 → chaproev-1.3.3}/docs/weather.md +0 -0
  97. {chaproev-1.3.2 → chaproev-1.3.3}/docs/writing.md +0 -0
  98. {chaproev-1.3.2 → chaproev-1.3.3}/eu-emblem-low-res.jpg +0 -0
  99. {chaproev-1.3.2 → chaproev-1.3.3}/input/Mopo/car_own_driveway_percentage.csv +0 -0
  100. {chaproev-1.3.2 → chaproev-1.3.3}/input/Mopo/fleets.csv +0 -0
  101. {chaproev-1.3.2 → chaproev-1.3.3}/mkdocs-PC-28624.yml +0 -0
  102. {chaproev-1.3.2 → chaproev-1.3.3}/mkdocs.yml +0 -0
  103. {chaproev-1.3.2 → chaproev-1.3.3}/non-road/Mopo/NL_domestic-aviation_2040_Aviation gasoline.toml +0 -0
  104. {chaproev-1.3.2 → chaproev-1.3.3}/non-road/Mopo/NL_domestic-aviation_2050_Aviation gasoline.toml +0 -0
  105. {chaproev-1.3.2 → chaproev-1.3.3}/non-road/Mopo/growth_factors.csv +0 -0
  106. {chaproev-1.3.2 → chaproev-1.3.3}/non-road/Mopo/scenario_demands.csv +0 -0
  107. {chaproev-1.3.2 → chaproev-1.3.3}/non-road/Mopo/scenarios.toml +0 -0
  108. {chaproev-1.3.2 → chaproev-1.3.3}/non-road.toml +0 -0
  109. {chaproev-1.3.2 → chaproev-1.3.3}/ref_val.csv +0 -0
  110. {chaproev-1.3.2 → chaproev-1.3.3}/requirements_obsolete.txt +0 -0
  111. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/Latvia_car_own_driveway_2050.toml +0 -0
  112. /chaproev-1.3.2/scenarios/Mopo/Netherlands_urban_car.toml → /chaproev-1.3.3/scenarios/Mopo/Netherlands_urban_car_2030.toml +0 -0
  113. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/Switzerland_car_own_driveway_2050.toml +0 -0
  114. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/XX_bus.toml +0 -0
  115. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/XX_car.toml +0 -0
  116. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/XX_truck.toml +0 -0
  117. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/Mopo/XX_van.toml +0 -0
  118. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/bus_test/XX_bus.toml +0 -0
  119. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/cumulative_test/Spain_bus_2050.toml +0 -0
  120. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/cumulative_test/Spain_van_2050.toml +0 -0
  121. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/cumulative_test/XX_car.toml +0 -0
  122. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/cumulative_test/XX_truck.toml +0 -0
  123. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/cumulative_test/XX_van.toml +0 -0
  124. {chaproev-1.3.2 → chaproev-1.3.3}/scenarios/local_impact_BEVs/baseline.toml +0 -0
  125. {chaproev-1.3.2 → chaproev-1.3.3}/setup.cfg +0 -0
  126. {chaproev-1.3.2 → chaproev-1.3.3}/siec.csv +0 -0
  127. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/__init__.py +0 -0
  128. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/define.py +0 -0
  129. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/make_variants.py +0 -0
  130. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/non_road.py +0 -0
  131. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/profiles.py +0 -0
  132. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/py.typed +0 -0
  133. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV/weather.py +0 -0
  134. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/PKG-INFO-PC-28624 +0 -0
  135. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/PKG-INFO-PC-28624-2 +0 -0
  136. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/SOURCES-PC-28624-2.txt +0 -0
  137. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/SOURCES-PC-28624.txt +0 -0
  138. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/dependency_links.txt +0 -0
  139. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/requires-PC-28624-2.txt +0 -0
  140. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/requires-PC-28624.txt +0 -0
  141. {chaproev-1.3.2 → chaproev-1.3.3}/src/ChaProEV.egg-info/top_level.txt +0 -0
  142. {chaproev-1.3.2 → chaproev-1.3.3}/test_bus_moility_matrices/bus_weekday_in_holiday_week.csv +0 -0
  143. {chaproev-1.3.2 → chaproev-1.3.3}/test_bus_moility_matrices/bus_weekday_in_workweek.csv +0 -0
  144. {chaproev-1.3.2 → chaproev-1.3.3}/test_bus_moility_matrices/bus_weekend_in_holiday_week.csv +0 -0
  145. {chaproev-1.3.2 → chaproev-1.3.3}/test_bus_moility_matrices/bus_weekend_in_workweek.csv +0 -0
  146. {chaproev-1.3.2 → chaproev-1.3.3}/tests/test_empty_values.py +0 -0
  147. {chaproev-1.3.2 → chaproev-1.3.3}/todo.txt +0 -0
  148. {chaproev-1.3.2 → chaproev-1.3.3}/variants/Mopo/XX_car.csv +0 -0
  149. {chaproev-1.3.2 → chaproev-1.3.3}/variants/Mopo.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ChaProEV
3
- Version: 1.3.2
3
+ Version: 1.3.3
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
@@ -12,7 +12,7 @@ Description-Content-Type: text/markdown
12
12
  License-File: LICENCE
13
13
  Requires-Dist: bs4>=0.0.2
14
14
  Requires-Dist: cdsapi>=0.7.4
15
- Requires-Dist: ETS_CookBook>=1.1.2
15
+ Requires-Dist: ETS_CookBook>=1.2.4
16
16
  Requires-Dist: matplotlib>=3.9.2
17
17
  Requires-Dist: numpy>=2.1.3
18
18
  Requires-Dist: pandas>=2.2.3
@@ -4,7 +4,7 @@ build-backend = 'setuptools.build_meta'
4
4
 
5
5
  [project]
6
6
  name = 'ChaProEV'
7
- version = '1.3.2'
7
+ version = '1.3.3'
8
8
  authors = [
9
9
  { name='Omar Usmani', email='Omar.Usmani@TNO.nl' },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  bs4>=0.0.2
2
2
  cdsapi>=0.7.4
3
- ETS_CookBook>=1.1.2
3
+ ETS_CookBook>=1.2.4
4
4
  matplotlib>=3.9.2
5
5
  numpy>=2.1.3
6
6
  pandas>=2.2.3
@@ -7,9 +7,9 @@ import typing as ty
7
7
  from itertools import repeat
8
8
  from multiprocessing import Pool
9
9
 
10
- import tqdm
11
10
  from box import Box
12
11
  from ETS_CookBook import ETS_CookBook as cook
12
+ from tqdm.rich import tqdm
13
13
 
14
14
  try:
15
15
  import writing # type: ignore
@@ -103,7 +103,7 @@ def run_ChaProEV(case_name: str) -> None:
103
103
  progress_bars_parameters.scenario_run_description
104
104
  )
105
105
  if display_scenario_run:
106
- pool_inputs = tqdm.tqdm(
106
+ pool_inputs = tqdm(
107
107
  pool_inputs,
108
108
  desc=scenario_run_description,
109
109
  total=len(scenarios),
@@ -125,7 +125,7 @@ if __name__ == '__main__':
125
125
  # This is a case name, which is the grouping of all your scenarios.
126
126
  # This is principally used to label your output files.
127
127
  # case_name: str = 'Mopo'
128
- case_name: str = 'cumulative_test'
128
+ case_name: str = 'Mopo'
129
129
  run_ChaProEV(case_name)
130
130
 
131
131
  # print('Add sessions into next day')
@@ -5,6 +5,7 @@ import numpy as np
5
5
  import pandas as pd
6
6
  from box import Box
7
7
  from ETS_CookBook import ETS_CookBook as cook
8
+ from rich import print
8
9
 
9
10
  try:
10
11
  import run_time # type: ignore
@@ -230,8 +230,8 @@ def get_consumption_data(
230
230
 
231
231
  if __name__ == '__main__':
232
232
  general_parameters_file_name: str = 'ChaProEV.toml'
233
- general_parameters: Box = (
234
- cook.parameters_from_TOML(general_parameters_file_name)
233
+ general_parameters: Box = cook.parameters_from_TOML(
234
+ general_parameters_file_name
235
235
  )
236
236
  case_name = 'Mopo'
237
237
  scenario_name: str = 'XX_car'
@@ -20,6 +20,7 @@ import numpy as np
20
20
  import pandas as pd
21
21
  from box import Box
22
22
  from ETS_CookBook import ETS_CookBook as cook
23
+ from rich import print
23
24
 
24
25
  try:
25
26
  import run_time # type: ignore
@@ -122,35 +123,23 @@ class NextDayStartChargingSession:
122
123
  location_power_to_network: float,
123
124
  ) -> None:
124
125
 
125
- self.start_time: datetime.datetime = (
126
- next_day_start_session_start
127
- )
128
- self.end_time: datetime.datetime = (
129
- next_day_start_session_end
130
- )
126
+ self.start_time: datetime.datetime = next_day_start_session_start
127
+ self.end_time: datetime.datetime = next_day_start_session_end
131
128
  self.location: str = day_start_location
132
129
 
133
130
  self.previous_leg_consumption: float = (
134
131
  previous_leg_consumption * group_size
135
132
  )
136
- self.next_leg_consumption: float = (
137
- next_leg_consumption * group_size
138
- )
139
- self.connectivity: float = (
140
- location_connectivity * group_size
141
- )
142
- self.power_to_vehicle: float = (
143
- location_power_to_vehicle * group_size
144
- )
133
+ self.next_leg_consumption: float = next_leg_consumption * group_size
134
+ self.connectivity: float = location_connectivity * group_size
135
+ self.power_to_vehicle: float = location_power_to_vehicle * group_size
145
136
  self.power_from_network: float = (
146
137
  location_power_from_network * group_size
147
138
  )
148
139
  self.power_from_vehicle: float = (
149
140
  location_power_from_vehicle * group_size
150
141
  )
151
- self.power_to_network: float = (
152
- location_power_to_network * group_size
153
- )
142
+ self.power_to_network: float = location_power_to_network * group_size
154
143
 
155
144
 
156
145
  def get_run_charging_sessions(
@@ -1445,7 +1434,6 @@ def get_run_trip_probabilities(
1445
1434
  Gets a DataFrame containing the trip probabilities for the whole run.
1446
1435
  '''
1447
1436
 
1448
- # moo = datetime.datetime.now()
1449
1437
  day_types: list[str] = scenario.mobility_module.day_types
1450
1438
  scenario_vehicle: str = scenario.vehicle.name
1451
1439
  trip_list: list[str] = []
@@ -1461,8 +1449,6 @@ def get_run_trip_probabilities(
1461
1449
  scenario, general_parameters
1462
1450
  )[0]
1463
1451
 
1464
- # print((datetime.datetime.now() - moo).total_seconds())
1465
- # moo = datetime.datetime.now()
1466
1452
  run_trip_probabilities: pd.DataFrame = pd.DataFrame(index=run_range)
1467
1453
  run_trip_probabilities.index.name = 'Time Tag'
1468
1454
 
@@ -1470,38 +1456,28 @@ def get_run_trip_probabilities(
1470
1456
  run_trip_probabilities, scenario, general_parameters
1471
1457
  )
1472
1458
 
1473
- # print((datetime.datetime.now() - moo).total_seconds())
1474
- # moo = datetime.datetime.now()
1475
1459
  trip_probabilities_per_day_type: pd.DataFrame = (
1476
1460
  get_trip_probabilities_per_day_type(
1477
1461
  scenario, case_name, general_parameters
1478
1462
  )
1479
1463
  )
1480
1464
 
1481
- # print((datetime.datetime.now() - moo).total_seconds())
1482
- # moo = datetime.datetime.now()
1483
-
1484
1465
  for trip in trip_list:
1485
1466
  for day_type in day_types:
1486
1467
  run_trip_probabilities.loc[
1487
1468
  run_trip_probabilities['Day Type'] == day_type, trip
1488
1469
  ] = trip_probabilities_per_day_type.loc[trip, day_type]
1489
- # print((datetime.datetime.now() - moo).total_seconds())
1490
- # moo = datetime.datetime.now()
1491
1470
 
1492
1471
  table_name: str = f'{scenario.name}_run_trip_probabilities'
1493
1472
  pickle_interim_files: bool = general_parameters.interim_files.pickle
1494
1473
  if pickle_interim_files:
1495
1474
  run_trip_probabilities.to_pickle(f'{output_folder}/{table_name}.pkl')
1496
- # print((datetime.datetime.now() - moo).total_seconds())
1497
- # moo = datetime.datetime.now()
1498
1475
 
1499
1476
  vehicle_name: str = scenario.vehicle.name
1500
1477
  if vehicle_name == 'car':
1501
1478
  run_trip_probabilities = car_holiday_departures_returns_corrections(
1502
1479
  run_trip_probabilities, scenario, case_name, general_parameters
1503
1480
  )
1504
- # print('Weekend corrs', (datetime.datetime.now() - moo).total_seconds())
1505
1481
 
1506
1482
  return run_trip_probabilities
1507
1483
 
@@ -22,6 +22,7 @@ import numpy as np
22
22
  import pandas as pd
23
23
  from box import Box
24
24
  from ETS_CookBook import ETS_CookBook as cook
25
+ from rich import print
25
26
 
26
27
 
27
28
  def get_run_duration(
@@ -437,8 +438,8 @@ if __name__ == '__main__':
437
438
  scenario: Box = cook.parameters_from_TOML(scenario_file_name)
438
439
  scenario.name = test_scenario_name
439
440
  general_parameters_file_name: str = 'ChaProEV.toml'
440
- general_parameters: Box = (
441
- cook.parameters_from_TOML(general_parameters_file_name)
441
+ general_parameters: Box = cook.parameters_from_TOML(
442
+ general_parameters_file_name
442
443
  )
443
444
  run_range, run_hour_numbers, display_range = get_time_range(
444
445
  scenario, general_parameters
@@ -8,6 +8,7 @@ import os
8
8
  import pandas as pd
9
9
  from box import Box
10
10
  from ETS_CookBook import ETS_CookBook as cook
11
+ from rich import print
11
12
 
12
13
  try:
13
14
  import define # type: ignore
@@ -80,7 +81,7 @@ def run_scenario(
80
81
  scenario: Box, case_name: str, general_parameters: Box
81
82
  ) -> None:
82
83
  scenario_name: str = scenario.name
83
- print(scenario_name)
84
+ print(f'Running scenario {scenario_name}')
84
85
  location_connections, legs, locations, trips = (
85
86
  define.declare_all_instances(scenario, case_name, general_parameters)
86
87
  )
@@ -14,9 +14,10 @@ from itertools import repeat
14
14
  from multiprocessing import Pool
15
15
 
16
16
  import pandas as pd
17
- import tqdm
17
+ from tqdm.rich import tqdm
18
18
  from box import Box
19
19
  from ETS_CookBook import ETS_CookBook as cook
20
+ from rich import print
20
21
 
21
22
 
22
23
  @cook.function_timer
@@ -76,7 +77,7 @@ def extra_end_outputs(case_name: str, general_parameters: Box) -> None:
76
77
  progress_bars_parameters.saving_pool_run_description
77
78
  )
78
79
  if display_saving_pool_run:
79
- saving_pool_inputs = tqdm.tqdm(
80
+ saving_pool_inputs = tqdm(
80
81
  saving_pool_inputs,
81
82
  desc=saving_pool_run_description,
82
83
  total=len(tables_to_save),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ChaProEV
3
- Version: 1.3.2
3
+ Version: 1.3.3
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
@@ -12,7 +12,7 @@ Description-Content-Type: text/markdown
12
12
  License-File: LICENCE
13
13
  Requires-Dist: bs4>=0.0.2
14
14
  Requires-Dist: cdsapi>=0.7.4
15
- Requires-Dist: ETS_CookBook>=1.1.2
15
+ Requires-Dist: ETS_CookBook>=1.2.4
16
16
  Requires-Dist: matplotlib>=3.9.2
17
17
  Requires-Dist: numpy>=2.1.3
18
18
  Requires-Dist: pandas>=2.2.3
@@ -95,11 +95,10 @@ non-road/Mopo/growth_factors.csv
95
95
  non-road/Mopo/scenario_demands.csv
96
96
  non-road/Mopo/scenarios.toml
97
97
  scenarios/Mopo/Latvia_car_own_driveway_2050.toml
98
- scenarios/Mopo/Netherlands_urban_car.toml
98
+ scenarios/Mopo/Netherlands_urban_car_2030.toml
99
99
  scenarios/Mopo/Switzerland_car_own_driveway_2050.toml
100
100
  scenarios/Mopo/XX_bus.toml
101
101
  scenarios/Mopo/XX_car.toml
102
- scenarios/Mopo/XX_car_test.toml
103
102
  scenarios/Mopo/XX_truck.toml
104
103
  scenarios/Mopo/XX_van.toml
105
104
  scenarios/bus_test/XX_bus.toml
@@ -141,6 +140,7 @@ test_bus_moility_matrices/bus_weekend_in_workweek.csv
141
140
  tests/test_battery_space.py
142
141
  tests/test_charge_and_consumption.py
143
142
  tests/test_empty_values.py
143
+ tests/test_enough_power_next_leg.py
144
144
  tests/test_same_output.py
145
145
  variants/Mopo.toml
146
146
  variants/Mopo/XX_car.csv
@@ -1,6 +1,6 @@
1
1
  bs4>=0.0.2
2
2
  cdsapi>=0.7.4
3
- ETS_CookBook>=1.1.2
3
+ ETS_CookBook>=1.2.4
4
4
  matplotlib>=3.9.2
5
5
  numpy>=2.1.3
6
6
  pandas>=2.2.3
@@ -1,6 +1,6 @@
1
1
  import os
2
- import typing as ty
3
2
 
3
+ import box
4
4
  import pandas as pd
5
5
  from ETS_CookBook import ETS_CookBook as cook
6
6
 
@@ -9,25 +9,20 @@ def test_battery_space() -> None:
9
9
 
10
10
  case_name: str = 'Mopo'
11
11
  general_parameters_file: str = 'ChaProEV.toml'
12
- general_parameters: ty.Dict = cook.parameters_from_TOML(
12
+ general_parameters: box.Box = cook.parameters_from_TOML(
13
13
  general_parameters_file
14
14
  )
15
- save_interim_files: bool = general_parameters['interim_files']['pickle']
15
+ save_interim_files: bool = general_parameters.interim_files.pickle
16
16
 
17
17
  if save_interim_files:
18
- scenario_files: ty.List[str] = os.listdir(f'scenarios/{case_name}')
19
- scenario_names: ty.List[str] = []
18
+ scenario_files: list[str] = os.listdir(f'scenarios/{case_name}')
19
+ scenario_names: list[str] = []
20
20
 
21
21
  for scenario_file in scenario_files:
22
22
  file_extension: str = scenario_file.split('.')[1]
23
23
  if file_extension == 'toml':
24
24
  scenario_names.append(scenario_file.split('.')[0])
25
- # scenario_names = [
26
- # 'XX_truck',
27
- # 'XX_van',
28
- # 'XX_bus',
29
- # 'XX_car'
30
- # ]
25
+
31
26
  for scenario_name in scenario_names:
32
27
  location_split: pd.DataFrame = pd.read_pickle(
33
28
  f'output/{case_name}/{scenario_name}_location_split.pkl'
@@ -1,5 +1,4 @@
1
1
  import datetime
2
- import typing as ty
3
2
 
4
3
  import numpy as np
5
4
  import pandas as pd
@@ -36,7 +35,7 @@ def test_charge_and_consumption() -> None:
36
35
  test_range: pd.DatetimeIndex = pd.date_range(
37
36
  start=test_start_date, end=test_end_date, freq='1h', inclusive='both'
38
37
  )
39
- test_scenarios: ty.List[str] = [
38
+ test_scenarios: list[str] = [
40
39
  'XX_bus',
41
40
  'XX_van',
42
41
  'XX_truck',
@@ -0,0 +1,44 @@
1
+ import os
2
+
3
+ import pandas as pd
4
+ import pytest
5
+ from rich import print
6
+
7
+
8
+ def test_enough_power_next_leg() -> None:
9
+
10
+ case_name: str = 'Mopo'
11
+
12
+ folder_to_test: str = f'output/{case_name}'
13
+
14
+ profile_names: list[str] = [
15
+ test_file.split('.')[0]
16
+ for test_file in os.listdir(folder_to_test)
17
+ if (test_file.split('.')[1] == 'pkl')
18
+ and (test_file.split('.')[0].endswith('_profile'))
19
+ ]
20
+
21
+ profiles: list[pd.DataFrame] = [
22
+ pd.read_pickle(f'{folder_to_test}/{profile_name}.pkl')
23
+ for profile_name in profile_names
24
+ ]
25
+
26
+ for profile, profile_name in zip(profiles, profile_names):
27
+
28
+ print(profile_name)
29
+
30
+ for_next_leg_header: str = 'Demand for next leg (kWh) (from network)'
31
+ for_next_leg: pd.Series = profile[for_next_leg_header]
32
+
33
+ supply_power_header: str = 'Charging Power from Network (kW)'
34
+ supply_power: pd.Series = profile[supply_power_header]
35
+
36
+ power_gaps: pd.Series = supply_power - for_next_leg
37
+ power_gaps[power_gaps > 0] = 0
38
+
39
+ total_gap: float = power_gaps.sum()
40
+ assert total_gap == pytest.approx(0)
41
+
42
+
43
+ if __name__ == '__main__':
44
+ test_enough_power_next_leg()
@@ -1,6 +1,4 @@
1
1
  import os
2
- import typing as ty
3
-
4
2
  import pandas as pd
5
3
 
6
4
 
@@ -11,7 +9,7 @@ def test_all_files() -> None:
11
9
  folder_to_test: str = f'output/{case_name}'
12
10
  reference_folder: str = 'reference_run'
13
11
 
14
- test_quantities: ty.List[str] = [
12
+ test_quantities: list[str] = [
15
13
  test_file.split('.')[0]
16
14
  for test_file in os.listdir(folder_to_test)
17
15
  if test_file.split('.')[1] == 'pkl'