Skip to content

Can 27#18

Merged
kyoung73 merged 3 commits into
mainfrom
CAN-27
Nov 12, 2025
Merged

Can 27#18
kyoung73 merged 3 commits into
mainfrom
CAN-27

Conversation

@kyoung73
Copy link
Copy Markdown
Contributor

This pull request focuses on improving code readability, maintainability, and flexibility in the somadata package, especially in metadata handling and ADAT concatenation. The main changes include significant refactoring for code clarity, better error and warning messaging, and enhanced functionality for concatenating ADAT files.

Refactoring and readability improvements:

  • Refactored the AdatMetaHelpers class in adat_meta_helpers.py for better readability: reformatted long method signatures, improved error messages, and replaced some warnings with logging for better traceability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15]

Enhanced ADAT concatenation functionality:

  • Added a merge_strategy parameter to smart_adat_concatenation in adat_concatenation.py, allowing users to choose between 'inner' and 'outer' merge strategies for the RFU matrix, increasing flexibility when combining ADATs with different SOMAmer sets. [1] [2] [3]
  • Improved handling of CalReference and PlateScale_Reference metadata during concatenation: now merges unique values using a pipe delimiter and logs a warning if differences are found across ADATs, helping users track potential downstream issues.

Logging improvements:

  • Introduced module-level loggers in both adat_meta_helpers.py and adat_concatenation.py to replace some warnings and improve diagnostic output. [1] [2] [3]

Version bump:

  • Updated the package version from 1.2.4 to 1.2.5 in pyproject.toml.

Copy link
Copy Markdown
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 pull request enhances the somadata package by improving code maintainability, adding flexible ADAT concatenation options, and upgrading diagnostic logging. The changes focus on refactoring for readability while adding new functionality for handling different SOMAmer sets during concatenation.

Key Changes:

  • Introduced merge_strategy parameter ('inner' or 'outer') to smart_adat_concatenation for flexible RFU matrix merging
  • Replaced warnings with structured logging for better diagnostics and traceability
  • Enhanced CalReference and PlateScale_Reference handling during concatenation with pipe-delimited merging

Reviewed Changes

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

Show a summary per file
File Description
pyproject.toml Version bump from 1.2.4 to 1.2.5
somadata/base/adat_meta_helpers.py Reformatted method signatures and replaced warnings with logging for missing metadata
somadata/tools/adat_concatenation.py Added merge_strategy parameter and special handling for CalReference/PlateScale_Reference fields
somadata/tools/adat_concatenation_utils.py Added prepare_rfu_matrix_for_outer_merge function and replaced warnings with logging
tests/base/test_adat_metadata_helpers.py Updated tests to use assertLogs instead of pytest.warns
tests/tools/test_adat_concatenation.py Updated tests for logging changes and added coverage for new concatenation behavior
tests/tools/test_adat_concatenation_utils.py Comprehensive test coverage for outer merge functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread somadata/tools/adat_concatenation.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@kyoung73 kyoung73 merged commit b414b6a into main Nov 12, 2025
5 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.

3 participants