Fix: Minor update to EIA NG pricing#777
Conversation
elenya-grant
left a comment
There was a problem hiding this comment.
Hi Rob! I think this looks great! Had a few minor suggestions but nothing blocking.
One consideration/thought I want to run by ya! In the resource models, it downloads data from the API and each resource model has a specified file-naming convention. So, even if a user does not provide a filename, it will look to see if that filename already exists in the RESOURCE_DIR. If that filename does not exist, the resource data will be downloaded to the RESOURCE_DIR using the user-supplied filename instead of the default. This ends up having a bit of complicated logic but my main thought is would a built-in file naming convention be useful here so that duplicate files aren't downloaded? I also think that the EIA grid data you've uploaded for testing here could be saved in the resource_files folder in a subfolder named natural_gas_prices or similar (but maybe with a filename like EIA_ng_prices_MN_2001.csv). (I'll admit that I haven't run this myself so I'm not sure if there is already a file naming convention that I'm missing)
Again - nothing blocking from me at the moment! Thanks!
Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>
Co-authored-by: elenya-grant <116225007+elenya-grant@users.noreply.github.com>
I think this is a good idea in general. Is there a model example to base this off of? Based on perusing the current usage, I think the biggest lift will be adding the |
Fix: Minor update to EIA NG pricing
This fix provides a series of minor patches to the EIA natural gas feedstock cost model and preprocessing functionality.
discrete_inputsanddiscrete_outputsifSection 1: Type of Contribution
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessaryCHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.Section 4: Related Issues
Section 5: Impacted Areas of the Software
Section 5.1: New Files
N/A
Section 5.2: Modified Files
h2integrate/feedstocks/eia_ng_price.pyEIANaturalGasFeedstockConfig.price: Converted to the expected NumPy array type.EIANaturalGasFeedstockCostModel.setup: Passes thepricearray to the configuration instead of a dataframe.EIANaturalGasFeedstockCostModel.compute: Includes previously unnecessarydiscrete_inputsanddiscrete_outputs, and fixes theifcondition to anarray.all()in place of a truth array.h2integrate/preprocess/eia.pyget_eia_ng_data: URL creation is moved to after checking and using an existing file, a missing conditional is added, and missing function arguments are added.h2integrate/feedstocks/test/test_feedstocks.py: Adds a test to run the EIA NG feedstock model from a downloaded file, and updates for duplicatedplant_configusage.Section 6: Additional Supporting Information
Section 7: Test Results, if applicable
Tests pass.