Skip to content

Accept inline values in electricity_load_profile - #41

Merged
jravani merged 4 commits into
enerplanetfrom
feat/inline-electricity-values
Oct 12, 2026
Merged

jravani merged 4 commits into
enerplanetfrom
feat/inline-electricity-values

Conversation

@jravani

@jravani jravani commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

buem.inputs.electricity_load_profile accepts inline values (an hourly array in kWh or kW) as an alternative to path, exactly one of the two, for callers that cannot place files in BUEM_DATA_DIR. The values take the same route as a file: converted to kWh per hour, indexed hourly from 1 January of the resolved year, used unscaled as the building's electricity and marked use_provided_elecLoad. A service building accepts the profile with no thermal effect, as before.

  • One shared conversion serves both forms; both now reject an empty array and non-numeric, non-finite or negative values, reported as a 400 validation issue naming the field.
  • The pinned contract is re-synced to buem-gateway main commit 2ab4ef4 (its pull request 82, merged; v6-draft: oneOf values or path, values non-negative with at least one item, unit kWh or kW with values).
  • Fifteen tests in tests/test_inline_electricity_values.py, six of them end to end through the pinned schema.

Checks

ruff, mypy, pytest (343 passed, 29 skipped) in the pilot env.

buem.inputs.electricity_load_profile takes values (an hourly array)
as an alternative to path, exactly one of the two, because a caller
that cannot place files in BUEM_DATA_DIR still needs to supply a
metered profile. Both forms share one conversion to kWh per hour and
now reject an empty array and non-numeric, non-finite or negative
values. The pinned contract still requires path; it is re-synced when
buem-gateway publishes the schema change.
electricity_load_profile is now oneOf values or path, with values
non-negative and at least one item, and unit limited to kWh or kW
when values is given. The end-to-end tests send a values-only
request through the pinned schema. 31bc503 is the commit of the
gateway's pull request 82; the pin moves to the main commit once
that merges.
The gateway's pull request 82 is merged; its squash commit carries
the same schemas/v6-draft files as 31bc503, so only contract.txt,
the two provenance comments and the changelog line move.
@jravani jravani added this to the v6.9.0 milestone Oct 12, 2026
@jravani
jravani merged commit bcdcc35 into enerplanet Oct 12, 2026
1 check passed
@jravani
jravani deleted the feat/inline-electricity-values branch October 12, 2026 18:10
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.

1 participant