pencleanenergy / MATCH-model

MATCH model for planning time-coincident clean energy portfolios
GNU Affero General Public License v3.0
27 stars 10 forks source link

Example model_inputs.xlsx file? #65

Closed williamhobbs closed 1 year ago

williamhobbs commented 1 year ago

Is an example version of model_inputs.xlsx with generic inputs available? I think that would help new users get familiar with the package.

[Edit] Understanding that the example file would leave NREL API email and key fields blank and users would need to populate those values.

Thanks.

grgmiller commented 1 year ago

Hi William - thanks for this excellent suggestion. We'll look into this and see if we can get something added to the repo soon.

ktehranchi commented 1 year ago

Hi Greg... I'm finding that the example input file has an error. Seems like solar runs with SAM but we get an error on wind.

ValueError                                Traceback (most recent call last)
[/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/run_scenarios.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/run_scenarios.ipynb) Cell 6 line 3
     33             generate_input_files.generate_inputs(model_workspace)
     34     else:
...
--> 131         raise ValueError(field_name.lower() + " required for wind data")
    132     data_dict['fields'].append(field_names.index(field_name.lower()) + 1)
    134 data_dict['data'] = []

ValueError: 2012 required for wind data

Any tips?

ktehranchi commented 1 year ago

Full Traceback

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/run_scenarios.ipynb](https://file+.vscode-resource.vscode-cdn.net/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/run_scenarios.ipynb) Cell 6 line 3
     33             generate_input_files.generate_inputs(model_workspace)
     34     else:
---> 35         generate_input_files.generate_inputs(model_workspace)
     36 # if the directory does not exist, generate the input files
     37 else:
     38     print("Generating inputs now...")

File [~/Local_Documents/MATCH-model/match_model/generate_input_files.py:863](https://file+.vscode-resource.vscode-cdn.net/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/~/Local_Documents/MATCH-model/match_model/generate_input_files.py:863), in generate_inputs(model_workspace)
    860 elif sam_function == "windpower":
    861     # run PySAM to simulate the solar outputs
    862     import pdb; pdb.set_trace()
--> 863     wind_vcf = simulate_wind_generation(
    864         nrel_api_key,
    865         nrel_api_email,
    866         resource_dict,
    867         config_dict,
    868         resource_years,
    869         pysam_dir,
    870         tz_offset,
    871     )
    873     # add the data to the dataframe
    874     df_vcf = df_vcf.merge(
    875         wind_vcf, how="left", left_index=True, right_index=True
    876     )

File [~/Local_Documents/MATCH-model/match_model/generate_input_files.py:1643](https://file+.vscode-resource.vscode-cdn.net/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/~/Local_Documents/MATCH-model/match_model/generate_input_files.py:1643), in simulate_wind_generation(nrel_api_key, nrel_api_email, resource_dict, config_dict, resource_years, input_dir, tz_offset)
   1640 wtk_path_dict = wtkfetcher.resource_file_paths_dict
   1642 for filename in wtk_path_dict:
-> 1643     windResource = tools.SRW_to_wind_data(wtk_path_dict[filename])
   1645     # assign the wind resource input data to the model
   1646     system_model_wind.Resource.wind_resource_data = windResource

File [~/mambaforge/envs/match_model/lib/python3.10/site-packages/PySAM/ResourceTools.py:131](https://file+.vscode-resource.vscode-cdn.net/Users/kamrantehranchi/Local_Documents/MATCH-model/match_model/notebooks/~/mambaforge/envs/match_model/lib/python3.10/site-packages/PySAM/ResourceTools.py:131), in SRW_to_wind_data(filename)
    129 for field_name in fields:
    130     if field_name.lower() not in field_names:
--> 131         raise ValueError(field_name.lower() + " required for wind data")
    132     data_dict['fields'].append(field_names.index(field_name.lower()) + 1)
    134 data_dict['data'] = []