Closed msimet closed 9 years ago
I got the following error and found that this is due to recent change on API in TreeCorr (G2Correlation -> GGCorrelation). I think you assume we use v3.0, but it might be better to adjust that to v3.1. http://rmjarvis.github.io/TreeCorr/html/changes.html#api-changes Actually this v3.1 was released after your PR, so my slow review should be blamed!
[miyatake@tiger3 Stile]$ python examples/example_run.py
ERROR: RuntimeError: module compiled against API version 9 but this version of numpy is 6 [astropy.io.fits.hdu.compressed]
RuntimeError: module compiled against API version 9 but this version of numpy is 6
ERROR: AttributeError: 'module' object has no attribute 'G2Correlation' [unknown]
Traceback (most recent call last):
File "examples/example_run.py", line 3, in <module>
import stile
File "/tigress/HSC/users/miyatake/Stile/stile/__init__.py", line 8, in <module>
from .sys_tests import (GalaxyShearSysTest, BrightStarShearSysTest, StarXGalaxyShearSysTest,
File "/tigress/HSC/users/miyatake/Stile/stile/sys_tests.py", line 98, in <module>
treecorr_func_dict = {'g2': treecorr.G2Correlation,
AttributeError: 'module' object has no attribute 'G2Correlation'
Okay, I think this is back up and running now. The bug Hironao found has been fixed, and I realized that some different correlation function types weren't fully supported, so those have been added as well.
If you're interested in doing a code review on this branch...please do! Thanks!
OK, I think I've addressed everybody's comments so far...I'll give it a few more days to let people look over the changes, and merge perhaps Tuesday night unless further changes are needed.
This is a PR to merge code that uses the TreeCorr package rather than corr2. A lot of this is inside baseball for the workings of the CorrelationFunctionSysTest, but I will highlight in particular:
corr2_utils.py
(nowtreecorr_utils.py
). You have no idea how excited I am about this.sys_test(data, [data2, random, random2,] config=config_dict, **kwargs)
instead of the oldsys_test(config_dict, data, [data2, random, random2], **kwargs).
The new form is more in line with the call signatures of the other SysTests, and I think it's clearer too.stile
directory (all of which were, I'm sure, my fault in the first place).fieldNames
dict tostile_utils.py
, so we have an obvious in-Python place to look up what the fields should be called. (Possibly we should do this forobject_type
s too?)Unfortunately, due to both rewriting a lot of the file & changing its name, the GitHub interface thinks
stile/treecorr_utils.py
andstile/test_treecorr_utils.py
are entirely new files. Hopefully it's not too terrible to read, though.