Skip to content

Commit

Permalink
Update doc references that moved
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Mar 7, 2024
1 parent 29f6d0d commit 45de0fd
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 88 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ 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`,
Expand Down
8 changes: 4 additions & 4 deletions docs/guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ These correlations do not suffer as much from masking effects,
so the compensation is not as necessary. However, it does produce a slightly better estimate
of the correlation function if you are able to use a random catalog.

Furthermore, the `process <GGCorrelation.process>` functions can take lists of Catalogs if desired,
Furthermore, the `process <Corr2.process>` functions can take lists of Catalogs if desired,
in which case it will
do all the possible combinations. This is especially relevant for doing randoms,
since the statistics get better if you generate several randoms and do all the correlations to beat down the noise::
Expand All @@ -244,7 +244,7 @@ Manually accumulating the correlation function
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For even more control over the calculation, you can break up the steps in the
`process <GGCorrelation.process>` functions. There are typically three steps:
`process <Corr2.process>` functions. There are typically three steps:

1. Calculate the variance of the field as needed (i.e. for anything but NN correlations).
2. Accumulate the correlations into the bins for each auto-correlation and cross-correlation desired.
Expand All @@ -261,9 +261,9 @@ function, you could write the following::
ng.process_cross(c1,c2)
ng.finalize(varg)

In addition to `process_cross <NGCorrelation.process_cross>`,
In addition to `process_cross <Corr2.process_cross>`,
classes that allow auto-correlations have a
`process_auto <GGCorrelation.process_auto>` method for manually processing
`process_auto <BaseZZCorrelation.process_auto>` method for manually processing
auto-correlations. See the doc strings for these methods for more information.

Breaking up the calculation manually like this is probably not often necessary anymore.
Expand Down
5 changes: 4 additions & 1 deletion docs/kz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ KZCorrelation: Scalar-spin-0 correlations
:special-members:
:show-inheritance:


.. autoclass:: treecorr.BaseKZCorrelation
:members:
:special-members:
:show-inheritance:
5 changes: 4 additions & 1 deletion docs/nz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ NZCorrelation: Count-spin-0 correlations
:special-members:
:show-inheritance:


.. autoclass:: treecorr.BaseNZCorrelation
:members:
:special-members:
:show-inheritance:
4 changes: 2 additions & 2 deletions docs/patches.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ The overall procedure for doing this is as follows:
4. Make sure not to do anything that requires the catalog be loaded from disk.
TreeCorr will delay doing the actual load until it needs to do so.
Here, we want to make sure it never loads the full data.
5. Run the `process <NNCorrelation.process>` function (for whichever correlation
5. Run the `process <Corr2.process>` function (for whichever correlation
type you need) using the ``low_mem=True`` option.

Here are some worked examples. First, an auto-correlation of a
Expand Down Expand Up @@ -336,7 +336,7 @@ Another use case that is enabled by using patches is
to divide up the work of calculating a correlation function
over multiple machines with MPI using `mpi4py <https://mpi4py.readthedocs.io/en/stable/>`_.

For this usage, the `process <NNCorrelation.process>` functions take an optional ``comm``
For this usage, the `process <Corr2.process>` functions take an optional ``comm``
parameter. When running in an MPI job, you can pass in ``comm=MPI.COMM_WORLD``,
and TreeCorr will divide up the work among however many nodes you are using.
The results will be sent back the the rank 0 node and combined to produce the
Expand Down
5 changes: 4 additions & 1 deletion docs/zz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ ZZCorrelation: Spin-0-spin-0 correlations
:special-members:
:show-inheritance:


.. autoclass:: treecorr.BaseZZCorrelation
:members:
:special-members:
:show-inheritance:
6 changes: 3 additions & 3 deletions treecorr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
from .nkcorrelation import NKCorrelation
from .kkcorrelation import KKCorrelation

from .nzcorrelation import NZCorrelation
from .kzcorrelation import KZCorrelation
from .zzcorrelation import ZZCorrelation
from .nzcorrelation import NZCorrelation, BaseNZCorrelation
from .kzcorrelation import KZCorrelation, BaseKZCorrelation
from .zzcorrelation import ZZCorrelation, BaseZZCorrelation

from .nvcorrelation import NVCorrelation
from .kvcorrelation import KVCorrelation
Expand Down
2 changes: 1 addition & 1 deletion treecorr/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2807,7 +2807,7 @@ def write_patches(self, save_patch_dir=None):
"""Write the patches to disk as separate files.
This can be used in conjunction with ``low_mem=True`` option of `get_patches` (and
implicitly by the various `process <GGCorrelation.process>` methods) to only keep
implicitly by the various `process <Corr2.process>` methods) to only keep
at most two patches in memory at a time.
Parameters:
Expand Down
8 changes: 4 additions & 4 deletions treecorr/corr2base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ def process_cross(self, cat1, cat2, *, metric=None, num_threads=None):
This accumulates the weighted sums into the bins, but does not finalize
the calculation by dividing by the total weight at the end. After
calling this function as often as desired, the `finalize` command will
calling this function as often as desired, the ``finalize`` command will
finish the calculation.
Parameters:
Expand Down Expand Up @@ -1109,7 +1109,7 @@ def process(self, cat1, cat2=None, metric=None, num_threads=None, comm=None, low
This only works if using patches. (default: False)
initialize (bool): Whether to begin the calculation with a call to
`Corr2.clear`. (default: True)
finalize (bool): Whether to complete the calculation with a call to `finalize`.
finalize (bool): Whether to complete the calculation with a call to finalize.
(default: True)
patch_method (str): Which patch method to use. (default: 'global')
"""
Expand Down Expand Up @@ -1210,8 +1210,8 @@ def __iadd__(self, other):
.. note::
For this to make sense, both objects should not have had `finalize` called yet.
Then, after adding them together, you should call `finalize` on the sum.
For this to make sense, both objects should not have had ``finalize`` called yet.
Then, after adding them together, you should call ``finalize`` on the sum.
"""
if not isinstance(other, self.__class__):
raise TypeError(f"Can only add another {self._cls} object")
Expand Down
10 changes: 5 additions & 5 deletions treecorr/ggcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class GGCorrelation(BaseZZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_auto` and/or
`process_cross`, then the units will not be applied to ``meanr`` or ``meanlogr`` until
the `finalize` function is called.
If you separate out the steps of the `Corr2.process` command and use
`BaseZZCorrelation.process_auto` and/or `Corr2.process_cross`, then the units will not be
applied to ``meanr`` or ``meanlogr`` until the `finalize` function is called.
The typical usage pattern is as follows:
Expand Down Expand Up @@ -112,8 +112,8 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, varg1, varg2):
"""Finalize the calculation of the correlation function.
The `process_auto` and `process_cross` commands accumulate values in each bin,
so they can be called multiple times if appropriate. Afterwards, this command
The `BaseZZCorrelation.process_auto` and `Corr2.process_cross` commands accumulate values
in each bin, so they can be called multiple times if appropriate. Afterwards, this command
finishes the calculation by dividing each column by the total weight.
Parameters:
Expand Down
4 changes: 2 additions & 2 deletions treecorr/kgcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class KGCorrelation(BaseKZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -114,7 +114,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vark, varg):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
8 changes: 4 additions & 4 deletions treecorr/kkcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class KKCorrelation(Corr2):
.. note::
If you separate out the steps of the `process` command and use `process_auto` and/or
`process_cross`, then the units will not be applied to ``meanr`` or ``meanlogr`` until
the `finalize` function is called.
If you separate out the steps of the `Corr2.process` command and use `process_auto`
and/or `Corr2.process_cross`, then the units will not be applied to ``meanr`` or
``meanlogr`` until the `finalize` function is called.
The typical usage pattern is as follows:
Expand Down Expand Up @@ -144,7 +144,7 @@ def process_auto(self, cat, *, metric=None, num_threads=None):
def finalize(self, vark1, vark2):
"""Finalize the calculation of the correlation function.
The `process_auto` and `process_cross` commands accumulate values in each bin,
The `process_auto` and `Corr2.process_cross` commands accumulate values in each bin,
so they can be called multiple times if appropriate. Afterwards, this command
finishes the calculation by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/kqcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class KQCorrelation(BaseKZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -107,7 +107,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vark, varq):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/ktcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class KTCorrelation(BaseKZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -107,7 +107,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vark, vart):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/kvcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class KVCorrelation(BaseKZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -108,7 +108,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vark, varv):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/kzcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class KZCorrelation(BaseKZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -197,7 +197,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vark, varz):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/ngcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class NGCorrelation(BaseNZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -112,7 +112,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, varg):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/nkcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class NKCorrelation(Corr2):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -140,7 +140,7 @@ def copy(self):
def finalize(self, vark):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
8 changes: 4 additions & 4 deletions treecorr/nncorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ class NNCorrelation(Corr2):
.. note::
If you separate out the steps of the `process` command and use `process_auto` and/or
`process_cross`, then the units will not be applied to ``meanr`` or ``meanlogr`` until
the `finalize` function is called.
If you separate out the steps of the `Corr2.process` command and use `process_auto`
and/or `Corr2.process_cross`, then the units will not be applied to ``meanr`` or
``meanlogr`` until the `finalize` function is called.
The typical usage pattern is as follows:
Expand Down Expand Up @@ -200,7 +200,7 @@ def process_cross(self, cat1, cat2, *, metric=None, num_threads=None):
def finalize(self):
"""Finalize the calculation of the correlation function.
The `process_auto` and `process_cross` commands accumulate values in each bin,
The `process_auto` and `Corr2.process_cross` commands accumulate values in each bin,
so they can be called multiple times if appropriate. Afterwards, this command
finishes the calculation of meanr, meanlogr by dividing by the total weight.
"""
Expand Down
4 changes: 2 additions & 2 deletions treecorr/nqcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class NQCorrelation(BaseNZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, varq):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/ntcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class NTCorrelation(BaseNZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, vart):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
4 changes: 2 additions & 2 deletions treecorr/nvcorrelation.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class NVCorrelation(BaseNZCorrelation):
.. note::
If you separate out the steps of the `process` command and use `process_cross`,
If you separate out the steps of the `Corr2.process` command and use `Corr2.process_cross`,
then the units will not be applied to ``meanr`` or ``meanlogr`` until the `finalize`
function is called.
Expand Down Expand Up @@ -111,7 +111,7 @@ def __init__(self, config=None, *, logger=None, **kwargs):
def finalize(self, varv):
"""Finalize the calculation of the correlation function.
The `process_cross` command accumulates values in each bin, so it can be called
The `Corr2.process_cross` command accumulates values in each bin, so it can be called
multiple times if appropriate. Afterwards, this command finishes the calculation
by dividing each column by the total weight.
Expand Down
Loading

0 comments on commit 45de0fd

Please sign in to comment.