Skip to content

Fix meter results returning key='None' for NULL KeyValue (#12) - #21

Merged
voightp merged 1 commit into
mainfrom
fix/12-meter-null-keyvalue
Jul 15, 2026
Merged

Fix meter results returning key='None' for NULL KeyValue (#12)#21
voightp merged 1 commit into
mainfrom
fix/12-meter-null-keyvalue

Conversation

@Tokarzewski

Copy link
Copy Markdown
Collaborator

Summary

Fixes#12 — meter results came back with the literal string key='None'.

Since EnergyPlus 23.1, the KeyValue of meter outputs is stored as NULL in the .sql file instead of an empty string. to_string() mapped str() over every field, so a NULL KeyValue surfaced as the string "None":

Variable(key='None', type='EnergyTransfer:Facility', units='J') # beforeVariable(key='', type='EnergyTransfer:Facility', units='J') # after

Fix

to_string() now normalizes a None field to an empty string, restoring the prior meter representation (key=""). Wildcard matching with Variable(None, ...) is unaffected — None fields are still skipped in the query builder.

Tests

Added test_meter_null_keyvalue_is_empty_string asserting a meter request returns key == "" with non-empty data. Full suite green; ruff check / format --check clean.

🤖 Generated with Claude Code

Since EnergyPlus 23.1 the KeyValue of meter outputs is stored as NULL
instead of an empty string. to_string() ran str() over every field, so a
NULL KeyValue surfaced as the literal string 'None' in the returned
Variable. Normalize None fields to an empty string so meters present a
key of '' as before.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@voightp
voightp merged commit ef254d9 into mainJul 15, 2026
7 checks passed
@Tokarzewski
Tokarzewski deleted the fix/12-meter-null-keyvalue branch July 28, 2026 08:08
Sign up for freeto 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.

Update Meter requests to handle EnergyPlus 23.1

2 participants

@Tokarzewski@voightp