Feature: Add feedstock_dir option for the EIA Natural Gas functionality#801
Merged
johnjasa merged 11 commits intoJul 8, 2026
Merged
Conversation
johnjasa
approved these changes
Jul 8, 2026
johnjasa
left a comment
Collaborator
There was a problem hiding this comment.
Thanks Rob! I like these changes and appreciate your patience as I merge in PRs at varied paces.
elenya-grant
reviewed
Jul 9, 2026
Comment on lines
+351
to
+357
| filename (str | Path | None): File name where the EIA data can either be loaded from | ||
| or should be saved to. If None, then data will be queried and returned with saving | ||
| left to the user. | ||
| left to the user. Should be used in conjunction with :py:attr:`feedstock_dir` or the | ||
| file will be expected in :py:attr:`h2integrate.FEEDSTOCK_DEFAULT_DIR` / "natural_gas" | ||
| feedstock_dir (str | Path | None): File path for where the the data should be saved to or | ||
| retrieved from. If None, and :py:attr:`filename` is used, then | ||
| ":py:attr:`h2integrate.FEEDSTOCK_DEFAULT_DIR` / "natural_gas" will be used. |
Collaborator
There was a problem hiding this comment.
I saw this just got merged but wanted to comment this anyway:
Is my understanding of the logic correct:
- if
filenameis a full filepath andfeedstock_diris None, then it loads or saves data tofilename - if
filenameis a file name (string) andfeedstock_diris None, then it loads or saves data toFEEDSTOCK_DEFAULT_DIR/"natural_gas"/filename? - if
filenameis None, data is pulled from the API (its not loaded from pre-existing data and not saved to a file) - if
feedstock_diris a full folder path andfilenameis a string, it saves the data tofeedstock_dir/filename
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
feedstock_diroption for the EIA Natural Gas functionalityThis PR adds the
feedstock_dirinput option for the EIA natural gas downloading and configuration in place of just thefilenameusing a complete file path. This change ensures the feedstocks and resources use similar APIs. In this case theFEEDSTOCK_DEFAULT_DIR/ "natural_gas" will always be used as a default when afilenameis provided.Section 1: Type of Contribution
Section 2: Draft PR Checklist
N/A
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
N/A
Section 5: Impacted Areas of the Software
Section 5.1: New Files
N/A
Section 5.2: Modified Files
h2integrate/core/utils/file_utils.pycheck_data_dir: Calls toPath.mkdir()now includeparents=Trueto enable the creation of a nonexistent series of "feedstock" and "natural_gas" subdirectories when required.h2integrate/preprocess/eia.pyget_eia_ng_data: addsfeedstock_dir, which if unprovided will default toh2integrate.FEEDSTOCK_DEFAULT_DIR/ "natural_gas"h2integrate/feedstocks/eia_ng_price.pyEIANaturalGasFeedstockConfig: addsfeedstock_dir, which if unprovided will default toh2integrate.FEEDSTOCK_DEFAULT_DIR/ "natural_gas"Section 6: Additional Supporting Information
Originally these changes were slated for #777, but the PR was merged prior to this addition following #791.
Section 7: Test Results, if applicable
Tests pass
Section 8 (Optional): New Model Checklist
N/A