Repository navigation
stile v0.1 import fails: 'treecorr.corr2' removed in newer treecorr #710
Description
Activity
Investigation: no newer Stile version fixes this
I looked for a Stile release that's compatible with
treecorr>=5, since the obvious first move is "just bump the version." There isn't one.tobias-liaudat/Stile— only thev0.1tag (the one we pin);masterlast touched 2020-10-30 and still importsfrom treecorr.corr2 import corr2_valid_params.msimet/Stile(the original) — last commit 2018; unmaintained.- All 5 other forks I could find (
Jeanne-jw,dylancromer,WentaoLuo,EiffL,enourbakhsh) — same broken import.
So bumping
@v0.1to any other ref on any existing fork just moves the failure around.What actually broke
treecorr 5.xflattened the namespace. The symbol itself still exists; it just moved:# treecorr 4.x from treecorr.corr2 import corr2_valid_params # works # treecorr 5.x from treecorr import corr2_valid_params # works from treecorr.corr2 import corr2_valid_params # ModuleNotFoundError
I verified
from treecorr import corr2_valid_paramsworks against the 5.1.2 we ship, andimport stilesucceeds once that one line instile/treecorr_utils.pyis patched.Options (none are clean)
# Option Pros Cons 1 Pin treecorr<5in the DockerfileOne-line, no patching Regresses whichever modules benefit from treecorr 5 features; we'd owe ourselves a diff to see if anything current actually cares 2 Post-install sedin the Dockerfile to patch the installed Stile fileSelf-contained; one-line fix lives in the image build sedon a site-packages file is ugly, and silently breaks if Stile's layout ever changes3 Fork Stileunder CosmoStat, apply the one-line fix, repoint the pinProper artifact; reviewable; other users can pin to it One more abandoned repo to own; small but real infra burden 4 Leave stile's 4 dependents broken (asxfailin #708)Zero work now mccd_plots_runner, random_cat_runner and their packages stay broken in-container Recommendation
I lean toward (2) as a short-term fix (matches the urgency of the other bugs we're shaking out) with (3) as the right long-term answer if/when anyone else hits this. (1) is only clean if no one is using treecorr-5-specific features; I haven't surveyed that.
But I genuinely don't have strong feelings — happy to do whichever you prefer. If you want (1) I can check quickly whether anything on
developactually needs treecorr 5.x.My suggestion is to remove leave it broken at the moment or apply a minial fix, and later remove the dependency on stile, in particular the tlaudiat fork. Should be easy, it's only used for the rho stats, and we have alternative ways to compute these, e.g. with https://github.com/CosmoStat/shear_psf_leakage.
I modified this issue for this: #657- added a commit that references this issue
on Apr 23, 2026 - added a commit that references this issue
on Apr 24, 2026
Symptom
4 shapepipe modules fail to import:
shapepipe.modules.mccd_package.mccd_plot_utilitiesshapepipe.modules.mccd_plots_runnershapepipe.modules.random_cat_package.random_catshapepipe.modules.random_cat_runnerTraceback ends:
Root cause
The Dockerfile pins
treecorr==5.1.1and installsstile @ git+https://github.com/tobias-liaudat/Stile@v0.1. treecorr 5.x flattened its namespace and removed thetreecorr.corr2submodule; stilev0.1still imports it.Options
treecorr<5in the Dockerfile. Regresses other modules that rely on treecorr 5 features (if any).Caught by
tests/unit/test_imports.pyfor the 4 modules above (xfailed in #708).