Skip to content

Add io support for JSON and CBOR formats#129

Merged
RalfG merged 4 commits intomainfrom
feature/add-cbor-json-io
Oct 24, 2025
Merged

Add io support for JSON and CBOR formats#129
RalfG merged 4 commits intomainfrom
feature/add-cbor-json-io

Conversation

@RalfG
Copy link
Member

@RalfG RalfG commented Oct 24, 2025

Added

  • io: Add io support for JSON and CBOR formats, following the psm_utils PSM data structure.

@RalfG RalfG marked this pull request as ready for review October 24, 2025 13:44
@RalfG RalfG requested a review from Copilot October 24, 2025 13:45
@RalfG RalfG added the feature Add a new feature label Oct 24, 2025
@RalfG RalfG added this to the v1.5.0 milestone Oct 24, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for JSON and CBOR (Concise Binary Object Representation) formats to the psm_utils I/O module, providing lossless serialization of PSM data structures.

  • Implements JSON and CBOR reader/writer classes following the existing psm_utils I/O patterns
  • Adds comprehensive test coverage for both formats including roundtrip testing
  • Updates documentation and configuration to include the new formats

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_io/test_json.py Comprehensive test suite for JSON reader/writer with roundtrip validation
tests/test_io/test_cbor.py Comprehensive test suite for CBOR reader/writer with conditional import handling
pyproject.toml Adds optional dependencies for cbor2 package
psm_utils/io/json.py JSON reader/writer implementation with lossless PSM serialization
psm_utils/io/cbor.py CBOR reader/writer implementation with binary format support
psm_utils/io/init.py Registers JSON and CBOR as supported file types
example_files/example.psm_utils.tsv Example TSV data file for reference
example_files/example.psm_utils.json Example JSON output demonstrating the new format
docs/source/api/psm_utils.io.rst API documentation updates for new formats
README.rst Updates supported file formats table with JSON and CBOR entries

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 87.96992% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.86%. Comparing base (2f9a5c4) to head (59f9a06).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
psm_utils/io/cbor.py 85.29% 10 Missing ⚠️
psm_utils/io/json.py 90.47% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #129      +/-   ##
==========================================
+ Coverage   70.12%   70.86%   +0.74%     
==========================================
  Files          30       32       +2     
  Lines        3059     3192     +133     
==========================================
+ Hits         2145     2262     +117     
- Misses        914      930      +16     
Flag Coverage Δ
unittests 70.86% <87.96%> (+0.74%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RalfG RalfG merged commit d36a56e into main Oct 24, 2025
7 checks passed
@RalfG RalfG deleted the feature/add-cbor-json-io branch October 24, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Add a new feature

Development

Successfully merging this pull request may close these issues.

2 participants