sandialabs / snl-quest

An open source, Python-based software platform for energy storage simulation and analysis developed by Sandia National Laboratories.
Other
128 stars 38 forks source link

V1.7 beta #46

Closed DavidRosewater closed 1 year ago

DavidRosewater commented 2 years ago

Description This pull-request adds the QuESt equity application, including a data_manager tool for downloading dispatch and pollution data from most US powerplants, to the version 1.6-beta branch.
The Power Plant Dispatch and Pollution Data button in the data manager enables a user to download all the relevant dispatch, PV resource, pollution, and demographical data required to perform the equity analysis. The QuESt equity wizard guides the user through the process of determining the size and power of energy storage and PV needed to replace the operation of a given powerplant. The program then calculates how the reduction in pollution would concretely benefit the health of disadvantaged communities and people with low incomes.

Message to code admin: As I construct this pull request for the QuESt Equity application, I am noticing many areas where the code is still sloppy. There are still several outstanding issues (discussed below) to be corrected before a final merge would be appropriate. However, I will need some help determining any other bugs or issues that require resolution so initiating the pull request is still beneficial. Please let me know if you identify any additional problems with this code to be resolved before merging. I may need some help fixing some of the known issues below.

Known issues: Added dependencies on numpy_financial and geopandas in results_viewer.py which have not been added to the installation or configuration files yet Most files do not have header information blocks Files have not been checked for PEP8 compliance README has not been updated to include equity information Export csv will only export timeseries data, not the maps or the cost-benefit There is no report template so the Create Report button does not work correctly, even if it does not error. The help menus have not been updated to help users with the powerplant data download page or the quest equity application.

Files and Changes: QuESt.kv – added include statements for additional files, changed layout of main page to have two rows of 3 buttons, added QuESt Equity app selection option. es_gui/apps/data_manager/_static/ - added three files: disadvantaged_pop_by_county_2010.csv, equity_analysis_params.json, and power_plant_model_params.json, disadvantaged_pop_by_county_2010.csv – list of population, disadvantaged population, and low income population by US county base on Justice40 data which is based on 2010 census data. equity_analysis_params.json – parameters for the peaker plant replacement analysis power_plant_model_params.json – parameters for the data_manager download page for powerplant data es_gui/apps/data_manager/ - added two files: power.kv, and power.py home.kv – added button to access download page for powerplant data and reorganized to 2 columns of three buttons each power.kv – layout file for the download page for powerplant data power.py – code for the download page for powerplant data, this is the part of the code that interacts with the EPA COBRA api. es_gui/apps/equity/ - added 8 files: home.kv, home.py, op_handler.py, peaker_rep.kv, peaker_rep.py, reporting.kv, ,reporting.py, and results_viewer.py home.kv – layout page that splits Peaker Plant Replacement and Results Viewer options home.py – code for home page op_handler.py – this is the optimization handler class that mages the user input selections, restructures data for use by pyomo, and then launches the optimization and collects results peaker_rep.kv – layout page for the multi-page powerplant replacement wizard
peaker_rep.py – code for the multi-page powerplant replacement wizard
reporting.kv – layout page for the report that is generated at the end of the analysis reporting.py– code for the report that is generated at the end of the analysis results_viewer.py - code for the results viewer page that displays the powerplant replacement data es_gui/resources/images/ - Added 3 figures to the images folder: Disadvantaged_Communities.png, Low_Income.png, equity_process_flow.png es_gui/resources/widgets/ changed two files: common.kv, common.py common.kv – added , , and classes to change functionality of the results viewer page common.py – added EquityResultsViewer(Screen), class EquityTimeSelector(MyPopup), EquityTimeSelectorRow(GridLayout), and EquityTimeTextInput(TextInput) classes. The last three were simply done to allow the user to input time-records up to 4 characters long. es_gui/tools/equity/ - added 4 files: constraints.py, equity_dms.py, equity_optimizer.py, and readdata.py constraints.py – this sets up the pyomo constraints and objective to find the minimum battery+PV to replace a powerplant equity_dms.py – makes a EquityDMS(DataManagementSystem) class to handle analysis data equity_optimizer.py – makes the EquityOptimizer(optimizer.Optimizer) class to handle the optimization with the instantiate_model, and populate_model methods readdata.py – not changes from BTM application but needed for local access main.py - the main file was changed to import all the new classes and files that are needed to make the equity app work