Repository navigation
Accept inline values in electricity_load_profile - #41
Merged
Merged
Conversation
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.
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
buem.inputs.electricity_load_profileaccepts inlinevalues(an hourly array in kWh or kW) as an alternative topath, exactly one of the two, for callers that cannot place files inBUEM_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 markeduse_provided_elecLoad. A service building accepts the profile with no thermal effect, as before.maincommit 2ab4ef4 (its pull request 82, merged; v6-draft:oneOfvalues or path, values non-negative with at least one item, unit kWh or kW with values).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.