Merged
Conversation
- Remove obsolete test files for deprecated APIs: - test_envelope.py, test_battery.py, test_hvac.py, test_fileio.py, test_base.py - Update test fixtures across all test files: - Use DataFrame with DatetimeIndex for schedule parameter - Update method signatures (update, generate_results, etc.) - Fix column naming conventions - Fix test_waterheater.py: - Relax duty cycle assertion to match actual behavior - Update TanklessWaterHeater test for new update_internal_control API - Fix test_humidity.py: - Remove obsolete schedule parameter from update_humidity call - Rewrite test_dwelling.py: - Update input files (BEopt_example.xml, etc.) - Fix equipment iteration (now dict, not list) - Update control signal format - Fix key names (Grid Voltage vs Voltage) All 105 tests now pass.
- Run tests on push/PR to main and dev branches - Test matrix: Ubuntu, macOS, Windows × Python 3.10, 3.11, 3.12 - Include pytest with coverage reporting - Add optional Codecov integration - Add ruff linting job (non-blocking)
…ppliance modules - test_battery.py: 30 tests for Battery and BatteryThermalModel - test_hvac.py: 27 tests for 17 HVAC equipment types - test_envelope.py: 29 tests for Envelope, Zone, ExteriorZone - test_wet_appliances.py: 31 tests for EventBasedLoad (wet appliances) - test_wet_appliance_mc.py: 16 tests for WetAppliance MC profile generator Coverage improvements: - EventBasedLoad.py: 55% -> 88% - WetAppliance.py: 0% -> 89% - Overall: 71% -> 72% Total: 133 new tests (237 total, 236 passed, 1 skipped)
Collaborator
|
Are there advantages to ruff vs black? We were thinking of moving to black for formatting and enforcing that, but at the moment we obviously don't enforce either. |
Collaborator
Author
ruff is newer alternative and is just better all around I think - supports more features (such as import sorting), much much faster, more secure. |
jmaguire1
approved these changes
Feb 2, 2026
Collaborator
jmaguire1
left a comment
There was a problem hiding this comment.
Some of the tests could be a little more detailed in what they check, but given right now we're not checking anything I'm just going to approve and we can do a follow up PR if we want to update specific test files.
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.
Summary
This PR fixes all stale tests in the OCHRE test suite to match the current API. Previously, 105+ tests were failing due to API changes that weren't reflected in the test code.
Result: All 105 tests now pass.
Address: #32
Changes
Removed Obsolete Test Files
Tests for deprecated/removed APIs that no longer exist:
test/test_models/test_envelope.pytest/test_equipment/test_battery.pytest/test_equipment/test_hvac.pytest/test_dwelling/test_fileio.pytest/test_utils/test_base.pyUpdated Test Fixtures
scheduleparameter to use DataFrame with DatetimeIndex (not dict)update(),generate_results(),update_external_control(), etc.'Ambient Dry Bulb (C)'format)Key Fixes by File
test_waterheater.pytest_humidity.pyscheduleparameter fromupdate_humidity()test_dwelling.pytest_equipment/*.pytest_models/*.pyTest Results
Test Counts by Directory