Closed isond closed 1 year ago
There are a couple of functions within dwelling.py
that look similar to functions that we re-factored out of the immediate charging code in #266 (get_location
, consider_trip_number
, and get_charging_power
). It seems like we could move the code from lines 156-171 into its own function which take trips
as input and returns a boolean column which represents if charging is allowed or not, and then use this function both within the existing immediate_charging
and the new smart_charging
functions. What do you think?
It would be helpful to assess the validity of the input parameters, e.g., LDT
vs ldt
, etc. Raising some ValueError
would be helpful to guide the user.
Pull Request doc
Purpose
What is the larger goal of this change? To add the Python translation of the smart charging code
What the code is doing
How is the purpose executed? This calculates the smart charging profiles for either LDVs or LDTs by iterating through the NHTS data. For each vehicle, all of its trips will help determine the optimized charging by considering various factors such as dwelling activity and charging costs.
Testing
How did you test this change (unit/functional testing, manual testing, etc.)? This has not been tested yet but once it's been optimized to run faster, we can compare the output against the matlab output.
Where to look
It's helpful to clarify where your new code lives if you moved files around or there could be confusion/ The new code is located here: "PreREISE/prereise/gather/demanddata/transportation_electrification/".
What files are most important? There are two new files.
smart_charging.py
is the main file with the algorithm.dwelling.py
contains helper functions to calculate the charging power during a vehicle's dwelling period.Usage Example/Visuals
How the code can be used and/or images of any graphs, tables or other visuals (not always applicable).
Time estimate
How long will it take for reviewers and observers to understand this code change? It could about a few days for the reviewers to understand this code change.