Skip to content

Tuple to dataclass#2

Open
XLIU-hub wants to merge 149 commits into
masterfrom
tuple_to_dataclass
Open

Tuple to dataclass#2
XLIU-hub wants to merge 149 commits into
masterfrom
tuple_to_dataclass

Conversation

@XLIU-hub
Copy link
Copy Markdown
Contributor

Pull Request Details

This pull request replaces tuple-based return values with dictionaries across the crossmapper. This change introduces dictionaries with explicit keys, improving:

  • Readability of the codebase
  • API clarity for users, especially in documentation

For example, instead of:
position, offset, in_cds, in_transcript = func(...)
The API now returns:
pos_m = func(...)
pos_m['position']
pos_m['offset']
pos_m['region']
pos_m['position_in_codon']

Documentation has been updated to reflect these new return types.

Breaking Changes

Functions that previously returned positions in tuples now return dictionaries. This affects downstream code that:

  • Relies on tuple unpacking
  • Access values by index
  • Use position values without considering its region

Tests

  • All tests have been updated to reflect dictionary-based return values
  • All existing and new tests pass

Xiaoyun Liu added 30 commits February 19, 2026 16:16
Comment thread mutalyzer_crossmapper/crossmapper.py Outdated
Comment thread mutalyzer_crossmapper/crossmapper.py Outdated
Comment thread mutalyzer_crossmapper/crossmapper.py Outdated
Comment thread mutalyzer_crossmapper/crossmapper.py Outdated
Comment thread tests/test_crossmapper.py Outdated
@XLIU-hub XLIU-hub force-pushed the tuple_to_dataclass branch from 7e82770 to 136bb18 Compare May 26, 2026 14:58
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