[Feature] Data value rounding#89
Draft
sakari-malkki wants to merge 6 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automatic rounding of returned data values based on the selected content value’s metadata precision (ContentDimensionValue.Precision), ensuring consistent numeric formatting across JSON-stat and CSV responses.
Changes:
- Introduces
DataPrecisionUtils.ApplyContentPrecisionto round numericDoubleDataValuecells according to content-dimension precision. - Applies precision adjustment in
DataController.GenerateResponsebefore building CSV/JSON-stat responses. - Updates unit tests, test metadata builders, and documentation; bumps package version to
0.5.11.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| PxApi/Utilities/DataPrecisionUtils.cs | New utility to round flattened matrix data using content-dimension precision. |
| PxApi/PxApi.csproj | Version bump 0.5.10 → 0.5.11. |
| PxApi/Controllers/DataController.cs | Applies precision rounding before CSV/JSON-stat formatting. |
| PxApi.UnitTests/Utilities/DataPrecisionUtilsTests.cs | Adds unit tests covering precision rounding behavior and indexing. |
| PxApi.UnitTests/ModelBuilderTests/TestMockMetaBuilder.cs | Extends mock content-dimension builder to support configurable precisions. |
| PxApi.UnitTests/ControllerTests/DataControllerTests.cs | Updates expected values to reflect precision rounding in controller responses. |
| docs/README.md | Documents automatic rounding behavior in returned data values. |
| docs/architecture/models-and-builders.md | Adds architecture documentation for DataPrecisionUtils. |
| docs/architecture/controllers.md | Notes precision adjustment in GenerateResponse prior to formatting. |
|
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.



Automatic data value rounding based on content value precision from Px.Utils metadata
Test coverage, architecture and user document updated