Skip to content

Bugfix in check_inputs - #846

Open
elenya-grant wants to merge 6 commits into
NatLabRockies:developfrom
elenya-grant:debug/config_check
Open

Bugfix in check_inputs#846
elenya-grant wants to merge 6 commits into
NatLabRockies:developfrom
elenya-grant:debug/config_check

Conversation

@elenya-grant

@elenya-grant elenya-grant commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Bugfix in check_inputs

This was inspired by Issue #845. While resolving the error message, I wanted to make sure that all error messages were being properly tested in h2integrate/core/test/test_utilities.py::test_check_inputs. I temporarily modified the error messages being thrown in check_inputs to have numbers at the start (to see if they were being tested) and the tests still passed (which they shouldn't have - because I changed the error string). So - I realized that the assert statement paired with the pytest.raises command were indented one too many times and that the tests were not actually being ran. Anyway - I made it so that the tests do run (they all failed initially because of small differences in the error message strings).

I'm going to delete the test test_check_inputs_example01 that I added - since now test_check_inputs is actually working. I also fixed the error message described in Issue #845 so that it works properly.

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 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • Complete Section 8: New Model Checklist (if applicable)

TODO:

  • Remove test_check_inputs_example01 and h2integrate/core/test/inputs/buggy_battery_v0.yaml
  • Update changelog

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

Implementation feedback:

Other feedback:

Should the msg in check_inputs be added onto and have an error thrown at the end of the method or just have tests be raised immediately when the situation arises? (see my comment on Issue #845 for more info)

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

Intended to resolve #845

Section 5: Impacted Areas of the Software

Section 5.1: New Files

N/A

Section 5.2: Modified Files

  • ``h2integrate/core/dict_utils.py`
    • check_inputs: fixed error message
  • h2integrate/core/test/test_utilities.py::test_check_inputs: fixed tests

Section 6: Additional Supporting Information

Section 7: Test Results, if applicable

@elenya-grant
elenya-grant marked this pull request as ready for review August 14, 2026 23:40
@elenya-grant
elenya-grant requested a review from ZackTully August 14, 2026 23:40
@elenya-grant elenya-grant linked an issue Aug 14, 2026 that may be closed by this pull request
@elenya-grant
elenya-grant requested a review from johnjasa August 15, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buggy error message when checking tech config inputs

1 participant