Skip to content

Enhancement: Make check_resource_dir a general data folder routine#791

Open
RHammond2 wants to merge 7 commits into
NatLabRockies:developfrom
RHammond2:feature/resourece-dir-to-file-utils
Open

Enhancement: Make check_resource_dir a general data folder routine#791
RHammond2 wants to merge 7 commits into
NatLabRockies:developfrom
RHammond2:feature/resourece-dir-to-file-utils

Conversation

@RHammond2

@RHammond2 RHammond2 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Enhancement: Make check_resource_dir a general data folder routine

This PR is in service of #777 to enable the usage of the functionality in h2integrate/resource/utilities/file_tools.py::check_resource_dir more broadly applicable to other data types (e.g. feedstocks). By creating the general check_data_dir with a thin wrapper for check_resource_dir that populates the data_type arg with "resource" much of the same usage is maintained through the resource data classes. Similarly the existing tests are able to be used with comparable test coverage and minimal changed code.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • Examples have been updated (if applicable)
  • CHANGELOG.md
    • At least one complete sentence has been provided to describe the changes made in this PR
    • After the above, a hyperlink has been provided to the PR using the following format:
      "A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
      XYZ should 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/resource/utilities/file_tools.py: removed in favor of moving check_resource_dir to the below modified file.
  • h2integrate/core/utilities/file_utils.py:
    • check_data_dir: General data_type checking data directory checking with default handling, exactly as prescribed from the previous check_resource_dir, except with the flexibility of working with multiple data_type, e.g. "resource", "feedstock", or whatever types of data might be used later.
    • check_resource_dir: partial function of check_data_dir with data_type="resource" pre-populated.
    • check_feedstock_dir: Same as above, but for "feedstock".

Section 6: Additional Supporting Information

This PR stems from a tangential issue in #777 where there is a need to reuse existing functionality, but is hard-coded for a specific use case making this work worthy of its own PR.

Section 7: Test Results, if applicable

@RHammond2 RHammond2 requested a review from elenya-grant June 23, 2026 23:37
@RHammond2 RHammond2 added enhancement New feature or request Tools/Utilities Tools and utilities that are used in H2I or for pre-processing or post-processing labels Jun 23, 2026
@RHammond2 RHammond2 requested review from johnjasa and removed request for johnjasa June 25, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Tools/Utilities Tools and utilities that are used in H2I or for pre-processing or post-processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant