Skip to content

feat(append_annotation_template): add append_annotation_template func…#388

Merged
fangliu117 merged 1 commit intodevfrom
template_append_annotation
Aug 4, 2025
Merged

feat(append_annotation_template): add append_annotation_template func…#388
fangliu117 merged 1 commit intodevfrom
template_append_annotation

Conversation

@fangliu117
Copy link
Collaborator

…tion and unit tests

Copilot AI review requested due to automatic review settings August 4, 2025 06:36
Copy link
Contributor

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 introduces a new append_annotation_template function that converts a NIDAP template to a platform-agnostic format. The template allows users to append annotation key-value pairs to existing DataFrames with support for multiple input formats (CSV, pickle) and flexible output options.

Key changes:

  • Added append_annotation_template.py with the main run_from_json function
  • Comprehensive unit test suite covering input/output scenarios, error handling, and edge cases
  • Support for DataFrame, CSV, and pickle input formats with appropriate error handling

Reviewed Changes

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

File Description
src/spac/templates/append_annotation_template.py Core template implementation with JSON parameter parsing, multi-format data loading, and annotation appending
tests/templates/test_append_annotation_template.py Comprehensive test suite covering functionality, error cases, and input format validation
Comments suppressed due to low confidence (1)

tests/templates/test_append_annotation_template.py:178

  • The test expects the error message to list .csv, .pickle, .pkl but the actual code supports .p extension as well. This test will fail if the error message is corrected to include all supported formats.
        self.assertIn("Supported formats: .csv, .pickle, .pkl", 

@fangliu117 fangliu117 merged commit 19543a7 into dev Aug 4, 2025
19 checks passed
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