Breakthrough-Energy / PreREISE

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

refactor: LDV uses bev_vmt scaling; performance improvement; simplify model_year_profile updates #321

Closed dmuldrew closed 1 year ago

dmuldrew commented 1 year ago

Pull Request doc

Purpose

This PR:

  1. scales LDV model year profiles by bev_vmt similar to HDV implementation
  2. further continues merging functionality of LDV and HDV implementations
  3. improves performance by removing unused data frame copying
  4. simplifies addition to model_year_profile by using modulo arithmetic

What the code is doing

  1. further consolidates LDV/HDV file loading code
  2. LDV implementation uses the get_kwhmi helper function
  3. column order more similar for LDV/HDV dataframes
  4. removes unused copy back of individual dataframe
  5. uses modulo arithmetic in the following:
    profile_window_indices = np.arange(day_iter * 24, day_iter * 24 + 72) % len(model_year_profile)

    to simply model_year_profile updates

Testing

automated integration tests

Time estimate

~20min