Skip to content

[WIP] CTF estimator refactor - #1416

Draft
garrettwrong wants to merge 38 commits into
developfrom
ctfest_tweaks
Draft

garrettwrong wants to merge 38 commits into
developfrom
ctfest_tweaks

Conversation

@garrettwrong

Copy link
Copy Markdown
Collaborator

Reconciles some errors in the first Python implementation relative to the MATLAB.

  • incorrect taper call
  • model bounds
  • adjusted defaults for number of tapers and psd size

Refactoring:

  • Various optimizations.
  • Adds BFGS (replacement for repeated gd loop, left for repro).
  • Extends to any steerable basis (FFB and FLE under test, others are implemented via ctf tests extension).
  • Implements optional 1D and 2D plots
  • Moves most redundant function args to instance variables
  • Migrates IO into helper function(s)
  • Created main estimate method.
  • Cleanup CLI and main method calls.
  • Parameterize several internal hard-coded params/tols/stop conditions.

Still WIP, some todos.

  • Need to meet with Ayelet to answer a few questions.
  • Need to run against full experimental datasets to get results and times
  • Try with K2 datasets and attempt to implement alt model for K2 if still needed now.

I will probably prefer make a separate PR handling any source integration changes to support a "from micrograph" preprocessing example. Currently this will produce the STAR files on disk which the sources were designed to consume. That design isn't very good IMO, but that's another matter... If source changes bleed into this it will make the PR a bear.

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.97326% with 131 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.83%. Comparing base (e4a05cc) to head (af31621).

Files with missing lines Patch % Lines
src/aspire/ctf/ctf_estimator.py 65.76% 126 Missing ⚠️
src/aspire/commands/estimate_ctf.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1416      +/-   ##
===========================================
- Coverage    90.65%   89.83%   -0.83%     
===========================================
  Files          135      135              
  Lines        14932    15064     +132     
===========================================
- Hits         13537    13532       -5     
- Misses        1395     1532     +137     

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

1 participant