stile v0.1 import fails: 'treecorr.corr2' removed in newer treecorr #710
Copy link
Copy link
Closed
Description
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_runner
Traceback ends:
File ".../stile/treecorr_utils.py", line 8
ModuleNotFoundError: No module named 'treecorr.corr2'
Root cause
The Dockerfile pins treecorr==5.1.1 and installs stile @ git+https://github.com/tobias-liaudat/Stile@v0.1. treecorr 5.x flattened its namespace and removed the treecorr.corr2 submodule; stile v0.1 still imports it.
Options
- Bump stile to a newer version (if one exists that supports treecorr 5.x). Check Stile upstream.
- Pin
treecorr<5in the Dockerfile. Regresses other modules that rely on treecorr 5 features (if any). - Fork stile and patch the import.
Caught by
tests/unit/test_imports.py for the 4 modules above (xfailed in #708).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
cailmdaley commentedon Apr 22, 2026
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.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: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)
treecorr<5in the Dockerfilesedin the Dockerfile to patch the installed Stile filesedon a site-packages file is ugly, and silently breaks if Stile's layout ever changesStileunder CosmoStat, apply the one-line fix, repoint the pinstile's 4 dependents broken (asxfailin #708)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.martinkilbinger commentedon Apr 22, 2026
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
Merge pull request #715 from CosmoStat/refactor/remove-rho-stats
refactor: remove rho-stats from shapepipe