Names side by side¶
The two APIs are one library. A C++ name in camelCase is the Python name in
snake_case; a C++ configuration struct is a Python class of the same name,
passed as config= or correction=; a flat
std::vector<double> of 3 * N entries becomes a NumPy array of shape
(N, 3). Python angles are in the angle_unit given, C++ angles in radians.
Errors¶
Invalid input and failures raise otswap::Error in C++, otswap.Error in
Python, whose message names the object at fault. An error of the neighbour
search is one too: its message starts with meshsearch: , and in C++ the
original meshsearch::Error is nested in it (std::rethrow_if_nested
recovers it). The extrapolation of b(z) beyond its table is not an error:
Python issues an ExtrapolationWarning, C++ reports it and counts it in
nExtrapolated. A correction raises for the whole call, with no partial
catalogue, when one corrected position falls outside the distance table.
C++ |
Python |
Notes |
|---|---|---|
|
|
C++ records the throw location: |
a line in the report, the count |
|
b(z) extrapolated beyond its table |
|
— |
rethrown as |
— |
|
Ctrl+C, at the next report line of a call |
Configuration¶
C++ |
Python |
Notes |
|---|---|---|
|
|
keyword |
|
|
keyword |
|
|
the |
|
— |
Python prints to |
|
|
also a pair |
|
|
also a pair |
|
|
also a pair |
|
|
the |
|
keyword |
Distances and coordinates¶
C++ |
Python |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
Python takes arrays |
|
|
properties |
|
|
read-only views; |
|
|
|
|
|
Python takes an (N, 3) array and returns distance, right ascension, declination per row |
|
— |
Python takes |
Mask¶
C++ |
Python |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
Python takes arrays |
|
|
properties |
Reconstruction¶
C++ |
Python |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Results¶
C++ |
Python |
Notes |
|---|---|---|
|
|
read-only views in Python |
|
|
read-only in Python; set by |
|
|
settable in Python, checked on assignment; a new copy on each access |
|
|
a copy; |
|
|
a copy; None in a box, and in a Cartesian lightcone without a distance table |
— |
|
the unit of |
— |
|
a result from arrays read back from a file; |
|
|
|
|
|
a copy in Python |
|
|
False in a lightcone |
|
|
the cell side of the neighbour grids used; None when not made by a reconstruction |
|
|
a bool view in Python, as |
|
|
a bool view in Python, as |
|
|
None in a box; in no file: |
|
|
None when no limits were given |
|
|
Python’s |
|
|
Redshift-space correction¶
C++ |
Python |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
a struct; a named tuple. The periodic overload is |
|
|
|
|
|
|
|
|
Python checks the table when it is built |
|
|
|
|
|
read-only in Python; a new copy on each access, as |
|
|
an |
Tables¶
C++ |
Python |
Notes |
|---|---|---|
|
|
|
|
|
|
|
|
keywords as |
|
— |
|
|
|
|
|
|
a list of str |
|
|
columns from their data; no row function |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
keyword-only |
|
strings |
|
Version¶
C++ |
Python |
Notes |
|---|---|---|
|
|
the version built, a string such as |
OpenMP runtime¶
C++ |
Python |
Notes |
|---|---|---|
— |
|
the directory of the OpenMP runtime of a macOS wheel, or None; see Using otswap from another package |
Random draws¶
C++ |
Python |
Notes |
|---|---|---|
|
— |
C++ only, in |