Skip to content

feat(rename_labels_template): add rename_labels_template function and…#376

Merged
fangliu117 merged 1 commit intodevfrom
template_rename_labels
Aug 3, 2025
Merged

feat(rename_labels_template): add rename_labels_template function and…#376
fangliu117 merged 1 commit intodevfrom
template_rename_labels

Conversation

@fangliu117
Copy link
Collaborator

… unit tests

Copilot AI review requested due to automatic review settings August 3, 2025 02:04
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 adds a new rename labels template functionality that allows renaming categorical labels in AnnData objects using a CSV mapping file. The implementation includes both the main template function and comprehensive unit tests.

  • Adds a platform-agnostic rename labels template converted from NIDAP
  • Implements CSV-based label mapping functionality with proper error handling
  • Provides comprehensive unit tests covering I/O workflows, error validation, and function calls

Reviewed Changes

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

File Description
src/spac/templates/rename_labels_template.py Main template implementation with JSON parameter parsing, CSV mapping loading, and label renaming logic
tests/templates/test_rename_labels_template.py Comprehensive unit tests including mock data generation, I/O workflows, error validation, and function call verification
Comments suppressed due to low confidence (2)

src/spac/templates/rename_labels_template.py:70

  • [nitpick] The variable name 'dict_list' is ambiguous. Consider renaming to 'mapping_records' to better describe that it contains records for label mapping.
    dict_list = rename_list.to_dict('records')

tests/templates/test_rename_labels_template.py:130

  • [nitpick] The function name 'side_effect_rename' is unclear. Consider renaming to 'mock_rename_implementation' to better indicate it's simulating the real rename function behavior.
        def side_effect_rename(adata, src_annotation, dest_annotation, 

@fangliu117 fangliu117 merged commit 47f028d into dev Aug 3, 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