nbodykit.algorithms.pair_counters.corrfunc.base

Functions

tonativeendian(arr)

Classes

CorrfuncResult(data)

A class used internally to hold the array-like result of a pair counting algorithm from Corrfunc.

MPICorrfuncCallable(callable, comm[, ...])

A base class to represent an MPI-enabled Corrfunc callable.

Exceptions

MissingCorrfuncError()

class nbodykit.algorithms.pair_counters.corrfunc.base.CorrfuncResult(data)[source]

A class used internally to hold the array-like result of a pair counting algorithm from Corrfunc.

This class is useful for reducing pair count results in parallel while accounting for columns that are pair-weighted.

Parameters

data (numpy.ndarray) – the numpy structured array result from Corrfunc

Attributes
dtype
shape

Methods

reshape

class nbodykit.algorithms.pair_counters.corrfunc.base.MPICorrfuncCallable(callable, comm, show_progress=True)[source]

A base class to represent an MPI-enabled Corrfunc callable.

This class adds the following functionality to the Corrfunc code:

  • If show_progress is True, execute the function in chunks, logging to screen the progress along the way. This is useful for potentially long running pair counting jobs.

  • When calling the function, capture stdout/stderr and C-level output and if an error occurs, raise an exception with all generated output for the user.

The relevant subclasses of this class are in mocks and theory.

Attributes
binning_dims

Methods

__call__(loads, kwargs[, callback])

Calls callable in iterations, optionally calling callback before each iteration.

__call__(loads, kwargs, callback=None)[source]

Calls callable in iterations, optionally calling callback before each iteration.

This allows the Corrfunc function callable to be called in chunks, giving the user a progress report after each iteration.

Parameters
  • loads (list of int) – the list of loads for every rank; this corresponds to the number of particles in the in A if we are correlating A x B

  • kwargs (dict) – the dictionary of arguments to pass to func

  • callback (callable, optional) – a callable takings kwargs as its first argument and a slice object as its second argument; this will be called first during each iteration

Returns

result – the total binned pair counting result

Return type

BinnedStatistic

exception nbodykit.algorithms.pair_counters.corrfunc.base.MissingCorrfuncError[source]
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.