Skip to content

Support distancelaw CLI without fragment file; improve tests - #95

Merged
js2264 merged 11 commits into
masterfrom
js2264/ps
May 6, 2026
Merged

js2264 merged 11 commits into
masterfrom
js2264/ps

Conversation

@js2264

@js2264 js2264 commented May 6, 2026

Copy link
Copy Markdown
Member

This pull request primarily aims to allow hicstuff distancelaw --pairs ... without having to also pass a fragment file.

The PR also focuses on code cleanup and configuration improvements. In the Python code, it consolidates and simplifies multi-line statements, especially error handling and logging, into single lines for better readability. In the .pylintrc configuration, it updates and comments out some settings, and clarifies exception handling. No core logic or functionality is changed.

js2264 and others added 4 commits May 5, 2026 21:58
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@js2264

js2264 commented May 6, 2026

Copy link
Copy Markdown
Member Author

@copilot review this PR

@codecov

codecov Bot commented May 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.61324% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.08%. Comparing base (2f2145a) to head (7d5c216).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
hicstuff/distance_law.py 27.90% 62 Missing ⚠️
hicstuff/hicstuff.py 28.88% 32 Missing ⚠️
hicstuff/commands.py 62.50% 18 Missing ⚠️
hicstuff/io.py 70.45% 13 Missing ⚠️
hicstuff/pipeline.py 82.81% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #95      +/-   ##
==========================================
+ Coverage   60.69%   65.08%   +4.39%     
==========================================
  Files          15       15              
  Lines        3414     3491      +77     
==========================================
+ Hits         2072     2272     +200     
+ Misses       1342     1219     -123     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI and others added 2 commits May 6, 2026 15:24

Copilot AI commented May 6, 2026

Copy link
Copy Markdown

@copilot review this PR

Here's a summary of the PR review findings and fixes applied:

Bugs found and fixed (commit 7ef52ef, 2a193ca):

  1. import_distance_law couldn't parse files exported by the updated export_distance_law — the new ## header lines (version, metadata) caused a ParserError. Fixed by adding comment="#" to pd.read_csv so header lines are skipped on import.

  2. get_ylim incompatible with NumPy ≥ 2.0np.where() returns a 1-D array, and int(array([5])) raises TypeError in NumPy 2.0+. Fixed by using explicit [0] indexing (int(min_index[0]), int(np.where(...)[0][0])). This was a pre-existing bug exposed by the new CLI test.

  3. Spelling typo in get_ylim comment: CaluclateCalculate.

No issues found with:

  • The new get_pairs_distance_pos() and _get_chrom_info_from_pairs() functions — logic is sound
  • The --frags optional change in commands.py — correct mutual-exclusion check with --dist-tbl
  • The gzip support via hio.read_compressed — works correctly for both plain and .gz pairs files
  • All 11 distance law tests now pass locally

Copilot finished work on behalf of js2264 May 6, 2026 15:27
@js2264
js2264 merged commit d1a17f5 into master May 6, 2026
1 check passed
@js2264
js2264 deleted the js2264/ps branch May 6, 2026 16:45
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