Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 2pt correlations of complex spin-0 fields using the letter Z #174

Merged
merged 34 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
dbd298c
Add z1,z2 options to Catalog
rmjarvis Mar 2, 2024
fce6034
Add NZCorrelation
rmjarvis Mar 2, 2024
374f518
Add KZCorrelation
rmjarvis Mar 3, 2024
7c54d10
Add ZZCorrelation
rmjarvis Mar 4, 2024
9e5f6a4
Add to CHANGELOG
rmjarvis Mar 4, 2024
6d1b942
doc updates
rmjarvis Mar 4, 2024
db25968
Switch BFD test to use NZ rather than NK
rmjarvis Mar 4, 2024
abaa2eb
Use double when accumulating w in Cells
rmjarvis Mar 4, 2024
233644a
Fix compiler error with windows compiler
rmjarvis Mar 4, 2024
d0647a9
Move duplicate code from NZ, NV, NG, NT, NQ classes into BaseNZCorrel…
rmjarvis Mar 4, 2024
6c7ea77
Move duplicate code from KZ, KV, KG, KT, KQ classes into BaseKZCorrel…
rmjarvis Mar 4, 2024
c0b022f
Move duplicate code from ZZ, VV, GG, TT, QQ classes into BaseZZCorre…
rmjarvis Mar 4, 2024
280e32f
Use super() rather than explicit class.method syntax
rmjarvis Mar 5, 2024
ff1e791
Move more things up to the base Corr2 class
rmjarvis Mar 5, 2024
3c09d0e
Fix logging of sig_sn
rmjarvis Mar 5, 2024
167b523
Add 3.11, 3.12 to CI
rmjarvis Mar 5, 2024
e3c3257
Don't test Tutorial on windows
rmjarvis Mar 5, 2024
cca78bb
Update versions of test dependencies
rmjarvis Mar 5, 2024
478b498
Don't check for py2 versions of imports
rmjarvis Mar 5, 2024
acefdd6
Don't fail tests if fitsio not installed
rmjarvis Mar 5, 2024
f2e5e45
Emit real warnings when skipping tests for ImportError
rmjarvis Mar 5, 2024
4f928f5
Use single quote
rmjarvis Mar 5, 2024
d580eb4
Copyright 2024
rmjarvis Mar 5, 2024
2d20c49
Remove old version of what is now MockMPI
rmjarvis Mar 5, 2024
8e22a4b
Relax tolerance on kkk jackknife, since failing on windows
rmjarvis Mar 5, 2024
954b888
Only install halotools on py>=3.9
rmjarvis Mar 5, 2024
cee5be2
Skip mpi tests on pypy
rmjarvis Mar 5, 2024
c2aabac
coverage
rmjarvis Mar 6, 2024
35cd046
Only emit the invalid but unneeded message if using corr2
rmjarvis Mar 6, 2024
5e6ca06
write can be in BaseZZCorrelation
rmjarvis Mar 6, 2024
d46d6f1
Move _sum back down to individual classes
rmjarvis Mar 6, 2024
8582f8d
Fix some doc errors
rmjarvis Mar 7, 2024
ed7eaa2
Allow from_file to be called directly from Corr2 class
rmjarvis Mar 7, 2024
4221ce4
Update doc references that moved
rmjarvis Mar 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@ jobs:
matrix:
# First all python versions in basic linux
os: [ ubuntu-latest ]
py: [ 3.7, 3.8, 3.9, "3.10", "pypy-3.9" ]
py: [ 3.7, 3.8, 3.9, '3.10', 3.11, 3.12, 'pypy-3.10' ]
CC: [ gcc ]
CXX: [ g++ ]

# Add some other particular combinations to test
include:
# One in MacOS
- os: macos-latest
py: 3.9
py: 3.11
CC: cc
CXX: c++

# Check one with clang compiler
- os: ubuntu-latest
py: 3.8
py: 3.11
CC: clang
CXX: clang++

# Check one with gcc-11
- os: ubuntu-latest
py: 3.9
py: 3.11
CC: gcc-11
CXX: g++-11

# Check one on Windows
- os: windows-latest
py: 3.9
py: 3.11
CC: gcc
CXX: g++

Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
pip install -U -r requirements.txt

# Extra packages needed for testing
pip install -U nose mpi4py coverage mockmpi pytest
pip install -U coverage mockmpi pytest

# Note: I'd rather include h5py here, but I can't get it to install properly
# on GHA for pypy3. So only do that for regular py3.
Expand All @@ -118,7 +118,14 @@ jobs:
# They are slow to install on pypy, where some are installed from scratch.
if: matrix.py > 3.0
run: |
pip install -U matplotlib nbval ipykernel scipy pandas guppy3 h5py pyarrow
pip install -U matplotlib nbval ipykernel scipy pandas guppy3 h5py pyarrow mpi4py

- name: Install halotools
# halotools is currently (3/2024) broken on 3.7, 3.8, 3.12
# Just run on the ones we know it works.
if: ((matrix.py == '3.9') || (matrix.py == '3.10') || (matrix.py == '3.11')) && (matrix.os != 'windows-latest')
run: |
pip install -U halotools

- name: Install fitsio everywhere but Windows
if: matrix.os != 'windows-latest'
Expand Down Expand Up @@ -152,7 +159,8 @@ jobs:
- name: Test MPI
# The code is already mostly checked in the main tests with mock_mpi.
# These just check that the code works when run in a real mpi session.
if: matrix.os != 'windows-latest'
# Skip windows and pypy for this.
if: (matrix.os != 'windows-latest') && (matrix.py > 3.0)
run: |
cd tests
which -a mpiexec
Expand All @@ -162,7 +170,7 @@ jobs:
cd ..

- name: Test Tutorial notebook
if: matrix.py == 3.7
if: matrix.py == '3.10'
run: |
cd tests
pytest --nbval Tutorial.ipynb --sanitize-with sanitize.cfg --current-env
Expand Down
8 changes: 5 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ API Changes
- Changed estimate_cov with method='shot' to only return the diagonal, rather than gratuitously
making a full, mostly empty diagonal matrix. (#166)
- Changed name of Catalog.write kwarg from cat_precision to just precision. (#169)
- Added additionaly information in the header of output files to enable ``from_file``. (#172)
- Added additionaly information in the header of output files to enable `Corr2.from_file`. (#172)


Performance improvements
Expand Down Expand Up @@ -85,10 +85,12 @@ New features
multipole algorithm or the old triangle algorithm. (#171)
- Added serialization of rr, dr, etc. when writing with write_patch_results=True option,
so you no longer have to separately write files for them to recover the covariance. (#172)
- Added :ref:`from_file <GGCorrlation.from_file>` class methods to construct a Correlation
object from a file without needing to know the correct configuration parameters. (#172)
- Added `Corr2.from_file` class methods to construct a Correlation object from a file without
needing to know the correct configuration parameters. (#172)
- Added ``write_cov`` option to write functions to include the covariance in the output file.
(#172)
- Added complex, spin-0 correlations using the letter Z, including `NZCorrelation`,
`KZCorrelation`, and `ZZCorrelation`. (#174)


Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion TreeCorr_LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2003-2019, Mike Jarvis
Copyright (c) 2003-2024, Mike Jarvis
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
168 changes: 0 additions & 168 deletions devel/mock_comm_with_fork.py

This file was deleted.

2 changes: 1 addition & 1 deletion devel/mpi_example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2003-2019 by Mike Jarvis
# Copyright (c) 2003-2024 by Mike Jarvis
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
Expand Down
10 changes: 8 additions & 2 deletions docs/catalog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ Other utilities related to catalogs
.. autofunction::
treecorr.calculateVarK
.. autofunction::
treecorr.calculateVarG
treecorr.calculateVarZ
.. autofunction::
treecorr.calculateVarV
.. autofunction::
treecorr.calculateVarG
.. autofunction::
treecorr.calculateVarT
.. autofunction::
treecorr.calculateVarQ
.. automodule:: treecorr.catalog
:members:
:exclude-members: Catalog, read_catalogs, calculateVarG, calculateVarK, calculateVarV
:exclude-members: Catalog, read_catalogs, calculateVarK, calculateVarZ, calculateVarV, calculateVarG, calculateVarT, calculateVatQ

File Readers
------------
Expand Down
7 changes: 5 additions & 2 deletions docs/correlation2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ correlation functions:
nn
nk
kk
nz
kz
zz
nv
kv
vv
Expand All @@ -18,10 +21,10 @@ correlation functions:
gg
nt
kt
gt
tt
nq
kq
gq
qq

Each of the above classes is a sub-class of the base class Corr2, so they have a number of
features in common about how they are constructed. The common features are documented here.
Expand Down
11 changes: 0 additions & 11 deletions docs/correlation3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ auto-correlation functions:
ggg
kkk

.. note::

There are classes that can handle cross-correlations of the same type:

* `treecorr.NNNCrossCorrelation`
* `treecorr.GGGCrossCorrelation`
* `treecorr.KKKCrossCorrelation`

However, we do not yet have the ability to compute 3-point cross-correlations across
different types (such as NNG or KGG, etc.)

Each of the above classes is a sub-class of the base class Corr3, so they have a number of
features in common about how they are constructed. The common features are documented here.

Expand Down
22 changes: 20 additions & 2 deletions docs/field.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ There are several kinds of `Field` classes.
- `KField` holds both counts of objects and the mean "kappa" of those objects.
It is used for correlations with a K in the name, including
`KKCorrelation`, `NKCorrelation`, `KGCorrelation`, and `KKKCorrelation`.
- `ZField` holds both counts of objects and the mean complex spin-0 field of those objects.
It is used for correlations with a V in the name, including
`VVCorrelation`, `NVCorrelation`, and `KVCorrelation`.
- `VField` holds both counts of objects and the mean vector field of those objects.
It is used for correlations with a V in the name, including
`VVCorrelation`, `NVCorrelation`, and `KVCorrelation`.
- `GField` holds both counts of objects and the mean shear of those objects.
It is used for correlations with a G in the name, including
`GGCorrelation`, `NGCorrelation`, `KGCorrelation`, and `GGGCorrelation`.
- `VField` holds both counts of objects and the mean velocity of those objects.
- `TField` holds both counts of objects and the mean spin-3 field of those objects.
It is used for correlations with a V in the name, including
`VVCorrelation`, `NVCorrelation`, and `KVCorrelation`.
- `QField` holds both counts of objects and the mean spin-4 field of those objects.
It is used for correlations with a V in the name, including
`VVCorrelation`, `NVCorrelation`, and `KVCorrelation`.

Expand All @@ -36,8 +45,17 @@ command do so for you.
.. autoclass:: treecorr.KField
:members:

.. autoclass:: treecorr.GField
.. autoclass:: treecorr.ZField
:members:

.. autoclass:: treecorr.VField
:members:

.. autoclass:: treecorr.GField
:members:

.. autoclass:: treecorr.TField
:members:

.. autoclass:: treecorr.QField
:members:
6 changes: 0 additions & 6 deletions docs/ggg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ GGGCorrelation: Shear-shear-shear correlations
:members:
:special-members:
:show-inheritance:

.. autoclass:: treecorr.GGGCrossCorrelation
:members:
:special-members:
:show-inheritance:

Loading