Breakthrough-Energy / PreREISE

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

fix: negative dwell time calculation in data processing #299

Closed isond closed 2 years ago

isond commented 2 years ago

Pull Request doc

Purpose

What is the larger goal of this change? To update the dwell time calculation in the original data processing code.

What the code is doing

How is the purpose executed? The dwell times are calculated by subtracting the current trip's end time from the next trip's start time. The last trip's dwell time is calculated by subtracting it's end time from the first trip's start time. This updated calculation also handles when start times begin past 12AM for all trips, which the previous version didn't handle and outputted negative times.

Testing

How did you test this change (unit/functional testing, manual testing, etc.)? Since the output should not contain negative values (which the original code produced), some of the trips with the negative values were manually recalculated. Those were then used as test cases to compare against the updated code 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 should take maybe 15 minutes to 30 minutes to understand.

BainanXia commented 2 years ago

Not related to this PR: should we regenerate the existing immediate charing profiles in the Dropbox folder with this fix?

isond commented 2 years ago

Not related to this PR: should we regenerate the existing immediate charing profiles in the Dropbox folder with this fix?

I think it would be a good idea to regenerate the existing profiles that way they're up-to-date.

BainanXia commented 2 years ago

@isond This is good to go and I will press the button once the linter doesn't complain. Thanks!