Repository navigation
docs(api): state c_m in Wh/(m²K), the unit the pipeline uses - #53
Merged
Merged
Conversation
The TABULA workbook gives c_m in Wh/(m²K) and the time constant tau in hours, and the pipeline follows it: tau = c_m / (H_tr + H_ve) (calc_level_12.go) and a_H = 0.8 + tau/30 (calc_level_13.go) only hold with tau in hours. The stored values are correct; a typical row holds 45, which is 162 kJ/(m²K). Four places said otherwise. The field metadata served by GET /api/v1/fields and the OpenAPI description said J/(m²K), the request schema said J/K, and the example request sent 165000, a J/(m²K) value about 3,600 times too large as an override. All four now say Wh/(m²K) and the example sends 45. Validation is unchanged. Closes #52
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Closes #52.
The TABULA workbook gives
c_min Wh/(m²K) andtauin hours, and the pipeline follows it:tau = c_m / (H_tr + H_ve)(calc_level_12.go:52) anda_H = 0.8 + tau/30(calc_level_13.go:48) only hold withtauin hours. The stored values are correct. Four places described the field in other units:internal/models/field_metadata.go(served byGET /api/v1/fields)docs/openapi/openapi.yamlschemas/request_schema.jsonschemas/example_request.jsonValidation of
c_mis unchanged (must be greater than 0). Only the documented unit and the examples move.The handler test fixture in
internal/api/handler/calculation_test.go:141still usesC_m: 165000as its default. It is test input for a mocked repository, not documentation, andTestCalculateHeatDemand_cMOverride_changesResultoverrides it with 45, so it is left as it is.Checks
go vet ./internal/...andgo test ./internal/...pass.python3 test/schema_check.py: all 2 example payloads match their schema.docs/openapi/openapi.yamlparses as YAML;mkdocs build --strictpasses.