Replace pandas with polars for better efficiency in core data processing modules#2
Draft
Replace pandas with polars for better efficiency in core data processing modules#2
Conversation
Co-authored-by: jcharkow <47336288+jcharkow@users.noreply.github.com>
Co-authored-by: jcharkow <47336288+jcharkow@users.noreply.github.com>
Co-authored-by: jcharkow <47336288+jcharkow@users.noreply.github.com>
…ndas Co-authored-by: jcharkow <47336288+jcharkow@users.noreply.github.com>
…ntation Co-authored-by: jcharkow <47336288+jcharkow@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Create a PR which replaces pandas functionality with polars for better efficiency
Replace pandas with polars for better efficiency in core data processing modules
Aug 11, 2025
jcharkow
pushed a commit
that referenced
this pull request
Nov 13, 2025
…cores Add export_feature_scores method supporting OSW, Parquet, and Split Parquet formats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates pyprophet's core data processing functionality from pandas to polars, delivering significant performance improvements for large-scale proteomics data analysis.
Performance Benefits
Polars provides several key advantages over pandas:
Modules Converted
Core Foundation (5 modules, 39 pandas usages)
io/_base.py(21 usages) - Abstract base classes for data readers/writersscoring/data_handling.py(8 usages) - Core ML data processing and Experiment classreport.py(5 usages) - Analysis reporting and visualizationstats.py(4 usages) - Statistical calculations and metricssplit.py(1 usage) - File processing operationsKey Changes
DataFrame Operations
Data Access
Backward Compatibility
A new compatibility layer (
pyprophet/util/compat.py) ensures smooth transitions:External libraries requiring pandas (e.g., scikit-learn) use conversion bridges:
Testing and Documentation
test_polars_compat.pyvalidates conversion utilitiesPOLARS_MIGRATION.mddocuments all changes and benefitsImpact
This migration affects the most performance-critical data processing operations in pyprophet while maintaining full backward compatibility. Users will see immediate performance improvements for large datasets without any code changes required.
The remaining modules (export, glyco, IPF) can be migrated incrementally in future updates as this establishes the foundation and patterns for the full transition.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.