Migrate ldsc from Python 2.7 to Python 3.6+ (based on bulik/ldsc#360)#2
Merged
jhjiang2020 merged 5 commits intodevfrom Oct 30, 2025
Merged
Migrate ldsc from Python 2.7 to Python 3.6+ (based on bulik/ldsc#360)#2jhjiang2020 merged 5 commits intodevfrom
jhjiang2020 merged 5 commits intodevfrom
Conversation
- Remove 'from __future__ import division' statements
- Replace xrange with range
- Update print statements to print() function calls
- Replace .ix with .iloc/.loc as appropriate
- Update pandas set_option('precision') to set_option('display.precision')
- Add functools.reduce import
- Update relative imports in ldscore module
- Update np.linalg.lstsq to include rcond=None parameter
- Update map() calls to list(map()) where needed
- Update version to 2.0.0
- Preserve fork-specific enhancements in make_annot.py and ldscore/sumstats.py
Co-authored-by: jhjiang2020 <75499605+jhjiang2020@users.noreply.github.com>
- Apply Python 3 migration changes to all test files - Update requirements.txt to remove version constraints - Update environment.yml to require Python >=3.6 - Update README.md with Python 3 requirements and version 2.0.0 - Update pandas.util.testing imports to pandas.testing - Replace print statements with print() in test files - Replace xrange with range in test files - Remove from __future__ imports from test files Co-authored-by: jhjiang2020 <75499605+jhjiang2020@users.noreply.github.com>
- Convert all tabs to spaces (4-space indentation) - Fix indentation error in munge_sumstats.py daner_n block - Fix tab in ldscore.py - Update requirements.txt to use pytest instead of nose - All scripts now import successfully Co-authored-by: jhjiang2020 <75499605+jhjiang2020@users.noreply.github.com>
- Fix assert statements in test_munge_sumstats.py to use proper comparison syntax - Fix pytest.raises usage in test_ldscore.py (use context manager instead of decorator) - Fix indentation in munge_sumstats.py for column validation loops Co-authored-by: jhjiang2020 <75499605+jhjiang2020@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review and align changes from pull request 360
Migrate ldsc from Python 2.7 to Python 3.6+ (based on bulik/ldsc#360)
Oct 30, 2025
jhjiang2020
approved these changes
Oct 30, 2025
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.
Migrates the codebase from Python 2.7 to Python 3.6+ following bulik/ldsc#360, while preserving fork-specific enhancements from commit 1698c1b (
--ref-ld-ctssupport, enhanced make_annot.py, and str match bug fix).Core Changes
Python 3 Compatibility:
from __future__ import divisionxrange→rangeprintstatements →print()functions.ix→.iloc/.locpd.set_option('precision')→pd.set_option('display.precision')functools.reduceimportimport jackknife→from . import jackknife)rcond=Nonetonp.linalg.lstsqcallsmap()→list(map())where neededConfiguration:
Code Quality:
Example
Before (Python 2):
After (Python 3):
Verification
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.