Breakthrough-Energy / PreREISE

Generate input data for scenario framework
https://breakthrough-energy.github.io/docs/
MIT License
20 stars 28 forks source link

feat: generate profiles for smart charging #287

Closed isond closed 1 year ago

isond commented 2 years ago

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

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.

danielolsen commented 2 years 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?

rouille commented 2 years ago

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.