Skip to content

[Feature] Data value rounding#89

Draft
sakari-malkki wants to merge 6 commits into
devfrom
feature/data-value-rounding
Draft

[Feature] Data value rounding#89
sakari-malkki wants to merge 6 commits into
devfrom
feature/data-value-rounding

Conversation

@sakari-malkki

Copy link
Copy Markdown
Member

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

Copilot AI review requested due to automatic review settings June 11, 2026 09:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ApplyContentPrecision to round numeric DoubleDataValue cells according to content-dimension precision.
  • Applies precision adjustment in DataController.GenerateResponse before 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.100.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.

Comment thread PxApi/Utilities/DataPrecisionUtils.cs Outdated
Comment thread PxApi.UnitTests/Utilities/DataPrecisionUtilsTests.cs Outdated
Copilot AI review requested due to automatic review settings June 11, 2026 09:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread PxApi/Utilities/DataPrecisionUtils.cs
@sakari-malkki sakari-malkki marked this pull request as ready for review June 11, 2026 10:36
Copilot AI review requested due to automatic review settings June 11, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Comment thread PxApi/Utilities/DataPrecisionUtils.cs
@sonarqubecloud

Copy link
Copy Markdown

@sakari-malkki sakari-malkki marked this pull request as draft June 15, 2026 07:46
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.

2 participants